Kbd_port
[Keyboard Service]

Dummy keyboard port driver. More...


Files

file  adb.c
 ADB keyboard port driver.
file  chardev.c
 Chardev keyboard port driver.
file  dummy.c
file  gxemul.c
 GXEmul keyboard port driver.
file  i8042.c
 i8042 PS/2 port driver.
file  i8042.h
 i8042 port driver.
file  msim.c
 Msim keyboard port driver.
file  niagara.c
 Niagara console keyboard port driver.
file  ns16550.c
 NS16550 port driver.
file  pl050.c
 pl050 port driver.
file  sgcn.c
 SGCN (Serengeti Console) keyboard port driver.
file  ski.c
 Ski console keyboard port driver.
file  sun.c
 Sun keyboard virtual port driver.
file  z8530.c
 Z8530 keyboard port driver.

Data Structures

struct  i8042
 i8042 HW I/O interface More...
struct  i8042_port_t
 Softstate structure, one for each serial port (primary and aux). More...
struct  input_buffer_t
struct  sgcn_buffer_header_t
 SGCN buffer header. More...

Defines

#define CHAN_A_DATA   6
#define CHAN_A_STATUS   4
#define FCR_REG   2
#define i8042_AUX_DATA   0x20
#define i8042_AUX_DISABLE   0x20
#define i8042_AUX_IE   0x02
#define i8042_CMD_WRITE_AUX   0xd4
 write aux device
#define i8042_CMD_WRITE_CMDB   0x60
 write command byte
#define i8042_INPUT_FULL   0x02
#define i8042_KBD_DISABLE   0x10
#define i8042_KBD_IE   0x01
#define i8042_KBD_TRANSLATE   0x40
#define i8042_OUTPUT_FULL   0x01
#define IER_REG   1
#define IIR_REG   2
#define INPUT_BUFFER_SIZE   ((PAGE_SIZE) - 2 * 8)
#define LCR_REG   3
#define LSR_DATA_READY   0x01
#define LSR_REG   5
#define MCR_REG   4
#define NAME   "i8042"
#define NAME   "kbd"
#define NAME   "kbd"
#define NAMESPACE   "char"
#define PL050_STAT_RXFULL   (1 << 4)
#define POLL_INTERVAL   10000
#define POLL_INTERVAL   10000
#define POLL_INTERVAL   10000
#define RBR_REG   0
#define RR0_RCA   1
#define SGCN_BUFFER(type, offset)   ((type *) (sram_virt_addr + sram_buffer_offset + (offset)))
#define SGCN_BUFFER_HEADER   (SGCN_BUFFER(sgcn_buffer_header_t, 0))
 Returns a pointer to the console buffer header.
#define SKI_GETCHAR   21

Typedefs

typedef i8042 i8042_t

Enumerations

enum  { DEVID_PRI = 0, DEVID_AUX = 1 }

Functions

static void adb_kbd_reg0_data (uint16_t data)
static void gxemul_irq_handler (ipc_callid_t iid, ipc_call_t *call)
 Process data sent when a key is pressed.
static void i8042_connection (ipc_callid_t iid, ipc_call_t *icall)
 Character device connection handler.
static int i8042_init (void)
static void i8042_irq_handler (ipc_callid_t iid, ipc_call_t *call)
static void i8042_port_write (int devid, uint8_t data)
static void kbd_port_events (ipc_callid_t iid, ipc_call_t *icall)
int kbd_port_init (void)
 Initializes keyboard handler.
void kbd_port_reclaim (void)
void kbd_port_write (uint8_t data)
void kbd_port_yield (void)
int main (int argc, char *argv[])
 Main entry point.
static void msim_irq_handler (ipc_callid_t iid, ipc_call_t *call)
static void niagara_key_pressed (void)
 Called regularly by the polling thread.
static void niagara_thread_impl (void *arg)
 Thread to poll SGCN for keypresses.
static void ns16550_irq_handler (ipc_callid_t iid, ipc_call_t *call)
int ns16550_port_init (void)
static void pl050_irq_handler (ipc_callid_t iid, ipc_call_t *call)
static void sgcn_key_pressed (void)
 Handler of the "key pressed" event.
static void sgcn_thread_impl (void *arg)
 Thread to poll SGCN for keypresses.
static int32_t ski_getchar (void)
 Ask Ski if a key was pressed.
static void ski_thread_impl (void *arg)
 Thread to poll Ski for keypresses.
static void wait_ready (void)
static void z8530_irq_handler (ipc_callid_t iid, ipc_call_t *call)
int z8530_port_init (void)

Variables

static int dev_phone
static int dev_phone
static irq_cmd_t gxemul_cmds []
static irq_code_t gxemul_kbd
static i8042_ti8042
static irq_cmd_t i8042_cmds []
static irq_code_t i8042_kbd
static uintptr_t i8042_kernel
static uintptr_t i8042_physical
static i8042_port_t i8042_port [MAX_DEVS]
static const char * in_devs []
 List of devices to try connecting to.
input_buffer_t input_buffer
static uintptr_t input_buffer_addr
 Virtual address mapped to the buffer shared with the kernel counterpart.
irq_cmd_t msim_cmds []
irq_code_t msim_kbd
static irq_cmd_t ns16550_cmds []
irq_code_t ns16550_kbd
static uintptr_t ns16550_kernel
static uintptr_t ns16550_physical
static const int num_devs = sizeof(in_devs) / sizeof(in_devs[0])
static irq_cmd_t pl050_cmds []
static irq_code_t pl050_kbd
static volatile bool polling_disabled = false
static volatile bool polling_disabled = false
static volatile bool polling_disabled = false
static uintptr_t sram_buffer_offset
 SGCN buffer offset within SGCN.
static uintptr_t sram_virt_addr
 Virtual address mapped to SRAM.
static irq_cmd_t z8530_cmds []
irq_code_t z8530_kbd

Detailed Description

Dummy keyboard port driver.


Enumeration Type Documentation

anonymous enum

Enumerator:
DEVID_PRI  primary device
DEVID_AUX  AUX device.

Definition at line 71 of file i8042.c.


Function Documentation

static void gxemul_irq_handler ( ipc_callid_t  iid,
ipc_call_t call 
) [static]

Process data sent when a key is pressed.

Parameters:
keybuffer Buffer of pressed keys.
call IPC call.
Returns:
Always 1.

Definition at line 99 of file gxemul.c.

int kbd_port_init ( void   ) 

Initializes keyboard handler.

Maps the shared buffer and creates the polling thread.

Definition at line 52 of file adb.c.

int main ( int  argc,
char *  argv[] 
)

Main entry point.

Parameters:
[in] argc Nmber of arguments in argv vector (ignored).
[in] argv Cmdline argument vector (ignored).
Returns:
Error code.
Driver debug level is set here.

Definition at line 126 of file i8042.c.

static void niagara_key_pressed ( void   )  [static]

Called regularly by the polling thread.

Reads codes of all the pressed keys from the buffer.

Definition at line 126 of file niagara.c.

static void sgcn_key_pressed ( void   )  [static]

Handler of the "key pressed" event.

Reads codes of all the pressed keys from the buffer.

Definition at line 151 of file sgcn.c.

static int32_t ski_getchar ( void   )  [static]

Ask Ski if a key was pressed.

Use SSC (Simulator System Call) to get character from the debug console. This call is non-blocking.

Returns:
ASCII code of pressed key or 0 if no key pressed.

Definition at line 110 of file ski.c.


Generated on Thu Jun 2 07:45:58 2011 for HelenOS/USB by  doxygen 1.4.7