Files | |
file | fb.h |
file | font-8x16.h |
file | i8042.h |
file | memory_init.h |
file | ofw.h |
file | fb.c |
file | font-8x16.c |
file | i8042.c |
file | memory_init.c |
file | ofw.c |
Data Structures | |
struct | ofw_args_t |
struct | memmap_t |
Defines | |
#define | FONT_GLIPHS 256 |
#define | FONT_SCANLINES 16 |
#define | SC_ESC 0x01 |
#define | SC_BACKSPACE 0x0e |
#define | SC_LSHIFT 0x2a |
#define | SC_RSHIFT 0x36 |
#define | SC_CAPSLOCK 0x3a |
#define | SC_SPEC_ESCAPE 0xe0 |
#define | SC_LEFTARR 0x4b |
#define | SC_RIGHTARR 0x4d |
#define | SC_UPARR 0x48 |
#define | SC_DOWNARR 0x50 |
#define | SC_DELETE 0x53 |
#define | SC_HOME 0x47 |
#define | SC_END 0x4f |
#define | MAX_OFW_ARGS 10 |
#define | COL_WIDTH 8 |
#define | ROW_BYTES (scanline * FONT_SCANLINES) |
#define | BGCOLOR 0x000080 |
#define | FGCOLOR 0xffff00 |
#define | LOGOCOLOR 0x2020b0 |
#define | RED(x, bits) ((x >> (16 + 8 - bits)) & ((1 << bits) - 1)) |
#define | GREEN(x, bits) ((x >> (8 + 8 - bits)) & ((1 << bits) - 1)) |
#define | BLUE(x, bits) ((x >> (8 - bits)) & ((1 << bits) - 1)) |
#define | POINTPOS(x, y) ((y) * scanline + (x) * pixelbytes) |
#define | KBD_ENABLE 0xf4 |
#define | KBD_DISABLE 0xf5 |
#define | KBD_ACK 0xfa |
#define | i8042_SET_COMMAND 0x60 |
#define | i8042_COMMAND 0x49 |
#define | i8042_BUFFER_FULL_MASK 0x01 |
#define | i8042_WAIT_MASK 0x02 |
#define | SPECIAL '?' |
#define | KEY_RELEASE 0x80 |
#define | IGNORE_CODE 0x7f |
#define | PRESSED_SHIFT (1<<0) |
#define | PRESSED_CAPSLOCK (1<<1) |
#define | LOCKED_CAPSLOCK (1<<0) |
#define | ACTIVE_READ_BUFF_SIZE 16 |
#define | MEMMAP_MAX_RECORDS 32 |
Typedefs | |
typedef __native | ofw_arg_t |
typedef int | ihandle |
typedef int | phandle |
typedef void(* | ofw_entry )(ofw_args_t *) |
Functions | |
void | fb_init (__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan) |
void | i8042_init (void) |
void | i8042_poll (void) |
void | i8042_grab (void) |
void | i8042_release (void) |
void | ofw_init_memmap (void) |
size_t | ofw_get_memory_size (void) |
void | ofw_init_zones (void) |
void | ofw_init (void) |
void | ofw_done (void) |
__native | ofw_call (const char *service, const int nargs, const int nret,...) |
void | ofw_putchar (const char ch) |
char | ofw_getchar (void) |
phandle | ofw_find_device (const char *name) |
int | ofw_get_property (const phandle device, const char *name, void *buf, const int buflen) |
void * | ofw_claim (const void *addr, const int size, const int align) |
SPINLOCK_INITIALIZE (fb_lock) | |
static void | rgb_4byte (void *dst, int rgb) |
static int | byte4_rgb (void *src) |
static void | rgb_3byte (void *dst, int rgb) |
static int | byte3_rgb (void *src) |
static void | rgb_2byte (void *dst, int rgb) |
static int | byte2_rgb (void *src) |
static void | rgb_1byte (void *dst, int rgb) |
static int | byte1_rgb (void *src) |
static void | putpixel (unsigned int x, unsigned int y, int color) |
static int | getpixel (unsigned int x, unsigned int y) |
static void | clear_screen (void) |
static void | scroll_screen (void) |
static void | invert_pixel (unsigned int x, unsigned int y) |
static void | draw_glyph_line (unsigned int glline, unsigned int x, unsigned int y) |
static void | draw_glyph (__u8 glyph, unsigned int col, unsigned int row) |
static void | invert_char (unsigned int col, unsigned int row) |
static void | draw_char (char chr) |
static void | draw_logo (unsigned int startx, unsigned int starty) |
static void | invert_cursor (void) |
static void | fb_putchar (chardev_t *dev, char ch) |
static void | key_released (__u8 sc) |
static void | key_pressed (__u8 sc) |
static char | key_read (chardev_t *d) |
SPINLOCK_INITIALIZE (keylock) | |
static void | i8042_suspend (chardev_t *) |
static void | i8042_resume (chardev_t *) |
static void | i8042_interrupt (int n, istate_t *istate) |
static void | i8042_wait (void) |
static __u8 | active_read_buff_read (void) |
static void | active_read_buff_write (__u8 ch) |
static void | active_read_key_pressed (__u8 sc) |
Variables | |
spinlock_t | fb_lock |
unsigned char | fb_font [FONT_GLIPHS *FONT_SCANLINES] |
ofw_entry | ofw |
static __u8 * | fbaddress = NULL |
static __u8 * | blankline = NULL |
static __u8 * | dbbuffer = NULL |
static int | dboffset |
static unsigned int | xres = 0 |
static unsigned int | yres = 0 |
static unsigned int | scanline = 0 |
static unsigned int | bitspp = 0 |
static unsigned int | pixelbytes = 0 |
static unsigned int | position = 0 |
static unsigned int | columns = 0 |
static unsigned int | rows = 0 |
static void(* | rgb2scr )(void *, int) |
static int(* | scr2rgb )(void *) |
static chardev_t | framebuffer |
static chardev_operations_t | fb_ops |
unsigned char | fb_font [FONT_GLIPHS *FONT_SCANLINES] |
static __u8 | active_read_buff [ACTIVE_READ_BUFF_SIZE] |
static volatile int | keyflags |
static volatile int | lockflags |
static chardev_t | kbrd |
static chardev_operations_t | ops |
static char | sc_primary_map [] |
static char | sc_secondary_map [] |
static iroutine | oldvector |
static memmap_t | memmap [MEMMAP_MAX_RECORDS] |
size_t | total_mem = 0 |
ofw_entry | ofw |
phandle | ofw_chosen |
ihandle | ofw_stdin |
ihandle | ofw_stdout |
|
Definition at line 95 of file i8042.c. Referenced by active_read_buff_read(), and active_read_buff_write(). |
|
Definition at line 72 of file fb.c. Referenced by fb_init(). |
|
Definition at line 78 of file fb.c. Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte(). |
|
Definition at line 69 of file fb.c. Referenced by draw_glyph(), fb_init(), and invert_char(). |
|
Definition at line 73 of file fb.c. Referenced by draw_glyph_line(). |
|
Definition at line 38 of file font-8x16.h. |
|
Definition at line 39 of file font-8x16.h. Referenced by draw_glyph(), fb_init(), invert_char(), and scroll_screen(). |
|
Definition at line 77 of file fb.c. Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte(). |
|
Definition at line 76 of file i8042.c. Referenced by i8042_init(), i8042_poll(), and key_read(). |
|
Definition at line 74 of file i8042.c. Referenced by i8042_grab(). |
|
Definition at line 73 of file i8042.c. Referenced by i8042_grab(). |
|
Definition at line 77 of file i8042.c. Referenced by i8042_wait(). |
|
These codes read from i8042 data register are silently ignored. Definition at line 85 of file i8042.c. Referenced by i8042_poll(), and key_read(). |
|
|
|
|
|
Keyboard commands. |
|
Definition at line 80 of file i8042.c. Referenced by i8042_interrupt(), i8042_poll(), and key_read(). |
|
Definition at line 93 of file i8042.c. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Definition at line 74 of file fb.c. Referenced by draw_logo(). |
|
|
|
Definition at line 43 of file memory_init.c. Referenced by ofw_init_memmap(), and ofw_init_zones(). |
|
Definition at line 80 of file fb.c. Referenced by fb_init(), getpixel(), and putpixel(). |
|
Definition at line 92 of file i8042.c. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Definition at line 91 of file i8042.c. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Definition at line 76 of file fb.c. Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte(). |
|
Definition at line 70 of file fb.c. Referenced by fb_init(), and scroll_screen(). |
|
|
|
Definition at line 43 of file i8042.h. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Definition at line 49 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Definition at line 48 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Definition at line 51 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Scancodes. |
|
Definition at line 50 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Definition at line 45 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Definition at line 41 of file i8042.h. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Definition at line 46 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Definition at line 42 of file i8042.h. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Definition at line 44 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Definition at line 47 of file i8042.h. Referenced by active_read_key_pressed(), and key_pressed(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 449 of file i8042.c. References active_read_buff, and ACTIVE_READ_BUFF_SIZE. Referenced by key_read(). |
|
Definition at line 459 of file i8042.c. References active_read_buff, and ACTIVE_READ_BUFF_SIZE. Referenced by active_read_key_pressed(). |
|
Definition at line 469 of file i8042.c. References active_read_buff_write(), is_lower, keyflags, LOCKED_CAPSLOCK, lockflags, PRESSED_CAPSLOCK, PRESSED_SHIFT, SC_CAPSLOCK, SC_DELETE, SC_DOWNARR, SC_END, SC_HOME, SC_LEFTARR, SC_LSHIFT, sc_primary_map, SC_RIGHTARR, SC_RSHIFT, sc_secondary_map, SC_SPEC_ESCAPE, and SC_UPARR. Referenced by key_read(). Here is the call graph for this function: |
|
Return pixel color - 8-bit depth (3:2:3) Definition at line 144 of file fb.c. Referenced by fb_init(). |
|
16-bit depth (5:6:5) Definition at line 131 of file fb.c. Referenced by fb_init(). |
|
Definition at line 113 of file fb.c. Referenced by fb_init(). |
|
Definition at line 94 of file fb.c. Referenced by fb_init(). |
|
Fill screen with background color Definition at line 172 of file fb.c. References blankline, dbbuffer, fbaddress, memcpy, pixelbytes, scanline, xres, and yres. Referenced by fb_init(). |
|
Draw character at default position Definition at line 248 of file fb.c. References columns, draw_glyph(), and position. Referenced by fb_putchar(). Here is the call graph for this function: |
|
Draw character at given position Definition at line 228 of file fb.c. References COL_WIDTH, draw_glyph_line(), fb_font, and FONT_SCANLINES. Referenced by draw_char(). Here is the call graph for this function: |
|
Draw one line of glyph at a given position Definition at line 213 of file fb.c. References FGCOLOR, and putpixel(). Referenced by draw_glyph(). Here is the call graph for this function: |
|
Definition at line 253 of file fb.c. References LOGOCOLOR, and putpixel(). Referenced by fb_init(). Here is the call graph for this function: |
|
Initialize framebuffer as a chardev output device
Definition at line 339 of file fb.c. References ASSERT, BGCOLOR, bitspp, blankline, byte1_rgb(), byte2_rgb(), byte3_rgb(), byte4_rgb(), chardev_initialize(), clear_screen(), COL_WIDTH, columns, dbbuffer, dboffset, draw_logo(), fb_ops, fbaddress, fnzb, FONT_SCANLINES, frame_alloc_rc, FRAME_ATOMIC, framebuffer, hw_map(), invert_cursor(), malloc(), NULL, panic, PFN2ADDR(), pixelbytes, POINTPOS, printf(), rgb2scr, rgb_1byte(), rgb_2byte(), rgb_3byte(), rgb_4byte(), ROW_BYTES, rows, scanline, scr2rgb, SIZE2FRAMES(), stdout, sysinfo_set_item_val(), xres, and yres. Referenced by standalone_sparc64_console_init(). Here is the call graph for this function: |
|
Print character to screen Emulate basic terminal commands Definition at line 283 of file fb.c. References columns, draw_char(), fb_lock, invert_cursor(), position, rows, scroll_screen(), spinlock_lock, and spinlock_unlock(). Here is the call graph for this function: |
|
Get pixel from viewport Definition at line 161 of file fb.c. References dbbuffer, dboffset, fbaddress, POINTPOS, scr2rgb, and yres. Referenced by invert_pixel(). |
|
Initialize keyboard and service interrupts using kernel routine Definition at line 278 of file i8042.c. References exc_register(), i8042_COMMAND, i8042_command_write(), i8042_data_write(), i8042_interrupt(), i8042_SET_COMMAND, i8042_wait(), oldvector, and VECTOR_KBD. Referenced by i8042_init(). Here is the call graph for this function: |
|
Initialize i8042. Definition at line 295 of file i8042.c. References chardev_initialize(), i8042_BUFFER_FULL_MASK, i8042_data_read(), i8042_grab(), i8042_status_read(), IRQ_KBD, kbrd, NULL, oldvector, ops, stdin, and trap_virtual_enable_irqs. Referenced by kbd_init(). Here is the call graph for this function: |
|
Process i8042 interrupt.
Definition at line 323 of file i8042.c. References i8042_data_read(), key_pressed(), KEY_RELEASE, key_released(), and trap_virtual_eoi. Referenced by i8042_grab(). Here is the call graph for this function: |
|
Poll for key press and release events. This function can be used to implement keyboard polling. Definition at line 561 of file i8042.c. References i8042_BUFFER_FULL_MASK, i8042_data_read(), i8042_status_read(), IGNORE_CODE, key_pressed(), KEY_RELEASE, and key_released(). Referenced by kkbdpoll(). Here is the call graph for this function: |
|
Resume the former interrupt vector Definition at line 288 of file i8042.c. References exc_register(), oldvector, and VECTOR_KBD. Here is the call graph for this function: |
|
|
|
|
|
Wait until the controller reads its data. Definition at line 336 of file i8042.c. References i8042_status_read(), and i8042_WAIT_MASK. Referenced by i8042_grab(). Here is the call graph for this function: |
|
Invert character at given position Definition at line 237 of file fb.c. References COL_WIDTH, FONT_SCANLINES, and invert_pixel(). Referenced by invert_cursor(). Here is the call graph for this function: |
|
Definition at line 274 of file fb.c. References columns, invert_char(), and position. Referenced by fb_init(), and fb_putchar(). Here is the call graph for this function: |
|
Definition at line 206 of file fb.c. References getpixel(), and putpixel(). Referenced by invert_char(). Here is the call graph for this function: |
|
Process keypress.
Definition at line 371 of file i8042.c. References chardev_push_character(), is_lower, kbrd, keyflags, LOCKED_CAPSLOCK, lockflags, PRESSED_CAPSLOCK, PRESSED_SHIFT, SC_CAPSLOCK, SC_DELETE, SC_DOWNARR, SC_END, SC_HOME, SC_LEFTARR, SC_LSHIFT, sc_primary_map, SC_RIGHTARR, SC_RSHIFT, sc_secondary_map, SC_SPEC_ESCAPE, SC_UPARR, spinlock_lock, and spinlock_unlock(). Referenced by i8042_interrupt(), and i8042_poll(). Here is the call graph for this function: |
|
Definition at line 538 of file i8042.c. References active_read_buff_read(), active_read_key_pressed(), i8042_BUFFER_FULL_MASK, i8042_data_read(), i8042_status_read(), IGNORE_CODE, KEY_RELEASE, and key_released(). Here is the call graph for this function: |
|
Process release of key.
Definition at line 346 of file i8042.c. References keyflags, LOCKED_CAPSLOCK, lockflags, PRESSED_CAPSLOCK, PRESSED_SHIFT, SC_CAPSLOCK, SC_LSHIFT, SC_RSHIFT, spinlock_lock, and spinlock_unlock(). Referenced by i8042_interrupt(), i8042_poll(), and key_read(). Here is the call graph for this function: |
|
Definition at line 66 of file ofw.c. References ofw_args_t::args, ofw_args_t::nargs, ofw_args_t::nret, ofw, ofw_args_t::service, va_arg, va_end, and va_start. Referenced by ofw_claim(), ofw_done(), ofw_find_device(), ofw_get_property(), ofw_getchar(), and ofw_putchar(). |
|
Definition at line 126 of file ofw.c. References ofw_call(). Here is the call graph for this function: |
|
Definition at line 60 of file ofw.c. References cpu_halt(), and ofw_call(). Referenced by ofw_init(). Here is the call graph for this function: |
|
Definition at line 116 of file ofw.c. References ofw_call(). Referenced by ofw_init(), and ofw_init_memmap(). Here is the call graph for this function: |
|
Definition at line 74 of file memory_init.c. References total_mem. Referenced by get_memory_size(). |
|
Definition at line 121 of file ofw.c. References ofw_call(). Referenced by ofw_init(), and ofw_init_memmap(). Here is the call graph for this function: |
|
Read character from OFW's input. This call is non-blocking.
Definition at line 103 of file ofw.c. References ofw_call(), and ofw_stdin. Referenced by ofw_sparc64_getchar(). Here is the call graph for this function: |
|
Definition at line 47 of file ofw.c. References ofw_chosen, ofw_done(), ofw_find_device(), ofw_get_property(), ofw_stdin, and ofw_stdout. Here is the call graph for this function: |
|
Definition at line 53 of file memory_init.c. References memmap, MEMMAP_MAX_RECORDS, ofw_find_device(), ofw_get_property(), panic, and total_mem. Here is the call graph for this function: |
|
Definition at line 79 of file memory_init.c. References ADDR2PFN(), ALIGN_DOWN, memmap, MEMMAP_MAX_RECORDS, PAGE_SIZE, SIZE2FRAMES(), and zone_create(). Referenced by frame_arch_init(). Here is the call graph for this function: |
|
Definition at line 89 of file ofw.c. References ofw_call(), and ofw_stdout. Referenced by ofw_sparc64_putchar(). Here is the call graph for this function: |
|
Definition at line 150 of file fb.c. References dbbuffer, dboffset, fbaddress, POINTPOS, and yres. Referenced by draw_glyph_line(), draw_logo(), and invert_pixel(). |
|
Put pixel - 8-bit depth (3:2:3) Definition at line 138 of file fb.c. References BLUE, GREEN, and RED. Referenced by fb_init(). |
|
16-bit depth (5:6:5) Definition at line 124 of file fb.c. References BLUE, GREEN, and RED. Referenced by fb_init(). |
|
Definition at line 99 of file fb.c. References BLUE, GREEN, and RED. Referenced by fb_init(). |
|
Definition at line 89 of file fb.c. Referenced by fb_init(). |
|
Scroll screen one row up Definition at line 185 of file fb.c. References blankline, dbbuffer, dboffset, fbaddress, FONT_SCANLINES, memcpy, ROW_BYTES, rows, scanline, and yres. Referenced by fb_putchar(). |
|
keylock protects keyflags and lockflags. |
|
|
|
Definition at line 97 of file i8042.c. Referenced by active_read_buff_read(), and active_read_buff_write(). |
|
Definition at line 61 of file fb.c. Referenced by fb_init(). |
|
Definition at line 54 of file fb.c. Referenced by clear_screen(), fb_init(), and scroll_screen(). |
|
Definition at line 65 of file fb.c. Referenced by draw_char(), fb_init(), fb_putchar(), and invert_cursor(). |
|
Definition at line 55 of file fb.c. Referenced by clear_screen(), fb_init(), getpixel(), putpixel(), and scroll_screen(). |
|
Definition at line 56 of file fb.c. Referenced by fb_init(), getpixel(), putpixel(), and scroll_screen(). |
|
Definition at line 37 of file font-8x16.c. Referenced by draw_glyph(). |
|
Definition at line 37 of file font-8x16.c. Referenced by draw_glyph(). |
|
Referenced by fb_putchar(). |
|
Initial value: { .write = fb_putchar, } Definition at line 325 of file fb.c. Referenced by fb_init(). |
|
Definition at line 52 of file fb.c. Referenced by clear_screen(), fb_init(), getpixel(), putpixel(), and scroll_screen(). |
|
Definition at line 324 of file fb.c. Referenced by fb_init(). |
|
Definition at line 106 of file i8042.c. Referenced by i8042_init(), and key_pressed(). |
|
Tracking of multiple keypresses. Definition at line 100 of file i8042.c. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Tracking of multiple keys lockings. Definition at line 101 of file i8042.c. Referenced by active_read_key_pressed(), key_pressed(), and key_released(). |
|
Definition at line 50 of file memory_init.c. Referenced by ofw_init_memmap(), and ofw_init_zones(). |
|
Definition at line 41 of file ofw.c. Referenced by ofw_call(). |
|
Definition at line 41 of file ofw.c. Referenced by ofw_call(). |
|
Definition at line 43 of file ofw.c. Referenced by ofw_init(). |
|
Definition at line 44 of file ofw.c. Referenced by ofw_getchar(), and ofw_init(). |
|
Definition at line 45 of file ofw.c. Referenced by ofw_init(), and ofw_putchar(). |
|
Definition at line 276 of file i8042.c. Referenced by i8042_grab(), i8042_init(), and i8042_release(). |
|
Initial value: { .suspend = i8042_suspend, .resume = i8042_resume, .read = key_read } Definition at line 107 of file i8042.c. Referenced by i8042_init(). |
|
Definition at line 62 of file fb.c. Referenced by clear_screen(), and fb_init(). |
|
Definition at line 64 of file fb.c. Referenced by clever_readline(), draw_char(), fb_putchar(), and invert_cursor(). |
|
Definition at line 85 of file fb.c. Referenced by fb_init(). |
|
Definition at line 66 of file fb.c. Referenced by fb_init(), fb_putchar(), and scroll_screen(). |
|
Primary meaning of scancodes. Definition at line 114 of file i8042.c. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Secondary meaning of scancodes. Definition at line 194 of file i8042.c. Referenced by active_read_key_pressed(), and key_pressed(). |
|
Definition at line 60 of file fb.c. Referenced by clear_screen(), fb_init(), and scroll_screen(). |
|
Definition at line 86 of file fb.c. Referenced by fb_init(), and getpixel(). |
|
Definition at line 51 of file memory_init.c. Referenced by ofw_get_memory_size(), and ofw_init_memmap(). |
|
Definition at line 58 of file fb.c. Referenced by clear_screen(), and fb_init(). |
|
Definition at line 59 of file fb.c. Referenced by clear_screen(), fb_init(), getpixel(), putpixel(), and scroll_screen(). |