hacks/syborg_keyboard.cpp
author Tom Pritchard <tomp@symbian.org>
Thu, 04 Nov 2010 11:29:57 +0000
changeset 111 e24000569e8a
parent 32 5d6e2a54a44a
permissions -rw-r--r--
Build the existing STUB versions of Java so it can safely be removed from the rom (and also reducing the dependency on etel)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
/*
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
*
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
*
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
* Contributors:
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
*
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
* Description: Minimalistic keyboard driver
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
*
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
*/
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
//#define DEBUG
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
#include "syborg_keyboard.h"
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
LOCAL_C TInt halFunction(TAny* aPtr, TInt aFunction, TAny* a1, TAny* a2)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
  DKeyboardPs2Soc* pH=(DKeyboardPs2Soc*)aPtr;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
  return pH->HalFunction(aFunction,a1,a2);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
void rxMsg(TAny* aPtr)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
  DKeyboardPs2Soc& h=*(DKeyboardPs2Soc*)aPtr;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
  TMessageBase* pM=h.iMsgQ.iMessage;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
  if (pM)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
	h.HandleMsg(pM);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
TInt DKeyboardPs2Soc::FifoPop(void)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
  TInt val = iKeyFifo[iFifoPos];
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
  iFifoPos++;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
  iFifoCount--;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
  
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
  if (iFifoPos == FIFO_SIZE)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
	iFifoPos = 0;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
  return val;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
void DKeyboardPs2Soc::FifoPush(TInt val)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
  TInt slot;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
  if (iFifoCount == FIFO_SIZE)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
	return;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
  
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
  slot = iFifoPos + iFifoCount;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
  if (slot >= FIFO_SIZE)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
	slot -= FIFO_SIZE;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
  iKeyFifo[slot] = val;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
  iFifoCount++;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
void DKeyboardPs2Soc::Isr(TAny* aPtr)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
  __DEBUG_PRINT("DKeyboardPs2Soc::Isr");
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
  DKeyboardPs2Soc& k = *(DKeyboardPs2Soc*)aPtr;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
  // Is now auto-clearing
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
  while(ReadReg(KHwBaseKmiKeyboard, KBD_FIFO_COUNT)!=0)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
	k.FifoPush(ReadReg(KHwBaseKmiKeyboard, KBD_DATA));
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
  
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
  //WriteReg(KHwBaseKmiKeyboard,KBD_CLEAR_INT, 0);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
  Interrupt::Clear(EIntKeyboard); 
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
  k.iRxDfc.Add();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
DKeyboardPs2Soc::DKeyboardPs2Soc()
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
  :	DPowerHandler(KLitKeyboard),
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	iRxDfc(RxDfc,this,Kern::DfcQue0(),1),
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
	iMsgQ(rxMsg,this,NULL,1)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
  iKeyboardOn = ETrue;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
  iFifoPos = 0;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
  iFifoCount = 0;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
TInt DKeyboardPs2Soc::Create()
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
  __DEBUG_PRINT("DKeyboardPs2Soc::Create");
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
  TInt r=KErrNone;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
  iDfcQ=Kern::DfcQue0();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
  iFifoPos = iFifoCount = 0;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
  r=Kern::AddHalEntry(EHalGroupKeyboard,halFunction,this);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
  if (r!=KErrNone)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
	return r;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
  iMsgQ.SetDfcQ(iDfcQ);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
  iMsgQ.Receive();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
  r=Interrupt::Bind(EIntKeyboard,Isr,this);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
  if (r==KErrNone) {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
	Add();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
	KeyboardOn();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
  }
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
  return r;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
void DKeyboardPs2Soc::PowerUp()
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
  PowerUpDone();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
void DKeyboardPs2Soc::PowerDown(TPowerState)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
  PowerDownDone();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
void DKeyboardPs2Soc::KeyboardOn()
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
  __DEBUG_PRINT("DKeyboardPs2Soc::KeyboardOn");
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
  TInt reg = ReadReg(KHwBaseKmiKeyboard,KBD_ID);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
  
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
  Interrupt::Enable(EIntKeyboard);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
  WriteReg(KHwBaseKmiKeyboard,KBD_INT_ENABLE,1);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
void DKeyboardPs2Soc::KeyboardOff()
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
  __DEBUG_PRINT("DKeyboardPs2Soc::KeyboardOff");
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
  Interrupt::Disable(EIntKeyboard);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
  WriteReg(KHwBaseKmiKeyboard,KBD_INT_ENABLE,0);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
void DKeyboardPs2Soc::HandleMsg(TMessageBase* aMsg)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
  __DEBUG_PRINT("DKeyboardPs2Soc::HandleMsg");
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
  if (aMsg->iValue)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
	KeyboardOn();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
  else
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
	KeyboardOff();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
  aMsg->Complete(KErrNone,ETrue);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   146
void DKeyboardPs2Soc::KeyboardInfo(TKeyboardInfoV01& aInfo)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   147
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   148
  aInfo.iKeyboardType=KConfigKeyboardType;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   149
  aInfo.iDeviceKeys=KConfigKeyboardDeviceKeys;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   150
  aInfo.iAppsKeys=KConfigKeyboardAppsKeys;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
TInt DKeyboardPs2Soc::HalFunction(TInt aFunction, TAny* a1, TAny* a2)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
  TInt r=KErrNone;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
  __DEBUG_PRINT("DKeyboardPs2Soc::HalFunction");
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   158
  switch(aFunction)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   159
	{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   160
	case EKeyboardHalKeyboardInfo:
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
	  {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
		TPckgBuf<TKeyboardInfoV01> kPckg;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
		KeyboardInfo(kPckg());
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   164
		Kern::InfoCopy(*(TDes8*)a1,kPckg);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
		break;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
	  }
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   167
	  // UIKLAF Silent running/power management
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   168
	case EKeyboardHalSetKeyboardState:
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   169
	  {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   170
		if(!Kern::CurrentThreadHasCapability(ECapabilityPowerMgmt,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EKeyboardHalSetKeyboardState")))
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   171
		  return KErrPermissionDenied;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
		if ((TBool)a1)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
		  {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   174
			TThreadMessage& m=Kern::Message();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   175
			m.iValue = ETrue;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   176
			m.SendReceive(&iMsgQ);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   177
		  }
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   178
		else
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   179
		  {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   180
			TThreadMessage& m=Kern::Message();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   181
			m.iValue = EFalse;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   182
			m.SendReceive(&iMsgQ);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   183
		  }
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   184
	  }
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   185
	  break;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   186
	case EKeyboardHalKeyboardState:
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   187
	  kumemput32(a1, &iKeyboardOn, sizeof(TBool));
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   188
	  break;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   189
	default:
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   190
	  r=KErrNotSupported;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   191
	  break;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   192
	}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   193
  return r;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   194
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   195
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   196
static void KeyOfDeath()
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   197
	{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   198
	Kern::Fault("KeyOfDeath", 0x0f100f10);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   199
	}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   200
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   201
void DKeyboardPs2Soc::RxDfc(TAny* aPtr)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   202
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   203
  TRawEvent e;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   204
  DKeyboardPs2Soc& k = *(DKeyboardPs2Soc*)aPtr;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   206
  while(k.iFifoCount>0) {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   207
	int keycode = k.FifoPop();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   208
	int dwn = (keycode & 0x80000000) ? 0 : 1;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   209
	__DEBUG_PRINT("DKeyboardPs2Soc::RxDfc %d %d", keycode, dwn);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   210
  
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   211
	keycode &= ~(0x80000000);	
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   212
	if (dwn) {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   213
	  __DEBUG_PRINT("kbd EKeyDown:%d",keycode);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   214
	  e.Set(TRawEvent::EKeyDown,KConvertCode[keycode],0);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   215
	}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   216
	else {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   217
	  __DEBUG_PRINT("kbd EKeyUp:%d",keycode);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   218
	  e.Set(TRawEvent::EKeyUp,KConvertCode[keycode],0);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   219
	}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   220
	if (KConvertCode[keycode] == EStdKeyF10) {
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   221
		KeyOfDeath();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   222
	}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   223
	Kern::AddEvent(e);
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   224
  }
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   225
}
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   226
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   227
DECLARE_STANDARD_EXTENSION()
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   228
{
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   229
  TInt r=KErrNoMemory;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   230
  DKeyboardPs2Soc* pK=new DKeyboardPs2Soc;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   231
  if (pK)
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   232
	r=pK->Create();
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   233
  __KTRACE_OPT(KEXTENSION,__DEBUG_PRINT("Returns %d",r));
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   234
  return r;
5d6e2a54a44a Add a "hacks" directory, seeded with the Syborg F10 KeyOfDeath change
William Roberts <williamr@symbian.org>
parents:
diff changeset
   235
}