Changeset 253f35a1 in mainline for kernel/genarch
- Timestamp:
- 2006-09-07T19:56:44Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab1ae2d9
- Parents:
- 801579fe
- Location:
- kernel/genarch
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/include/kbd/z8530.h
r801579fe r253f35a1 38 38 #define KERN_Z8530_H_ 39 39 40 #include <typedefs.h> 41 40 42 #define Z8530_INTRCV_DATA0 0x39 /* hardcoded for use in Simics */ 43 44 extern bool z8530_belongs_to_kernel; 41 45 42 46 extern void z8530_init(void); -
kernel/genarch/src/fb/fb.c
r801579fe r253f35a1 61 61 static unsigned int bitspp = 0; 62 62 static unsigned int pixelbytes = 0; 63 #ifdef FB_INVERT_COLORS 64 static bool invert_colors = true; 65 #else 66 static bool invert_colors = false; 67 #endif 63 68 64 69 static unsigned int position = 0; … … 66 71 static unsigned int rows = 0; 67 72 68 69 73 #define COL_WIDTH 8 70 74 #define ROW_BYTES (scanline * FONT_SCANLINES) … … 85 89 static void (*rgb2scr)(void *, int); 86 90 static int (*scr2rgb)(void *); 91 92 static inline int COLOR(int color) 93 { 94 return invert_colors ? ~color : color; 95 } 87 96 88 97 /* Conversion routines between different color representations */ … … 160 169 static void putpixel(unsigned int x, unsigned int y, int color) 161 170 { 162 (*rgb2scr)(&fbaddress[POINTPOS(x,y)], color);171 (*rgb2scr)(&fbaddress[POINTPOS(x,y)], COLOR(color)); 163 172 164 173 if (dbbuffer) { 165 174 int dline = (y + dboffset) % yres; 166 (*rgb2scr)(&dbbuffer[POINTPOS(x,dline)], color);175 (*rgb2scr)(&dbbuffer[POINTPOS(x,dline)], COLOR(color)); 167 176 } 168 177 } … … 173 182 if (dbbuffer) { 174 183 int dline = (y + dboffset) % yres; 175 return (*scr2rgb)(&dbbuffer[POINTPOS(x,dline)]);176 } 177 return (*scr2rgb)(&fbaddress[POINTPOS(x,y)]);184 return COLOR((*scr2rgb)(&dbbuffer[POINTPOS(x,dline)])); 185 } 186 return COLOR((*scr2rgb)(&fbaddress[POINTPOS(x,y)])); 178 187 } 179 188 … … 275 284 byte >>= x % 8; 276 285 if (byte & 1) 277 putpixel(startx + x, starty + y, LOGOCOLOR);286 putpixel(startx + x, starty + y, COLOR(LOGOCOLOR)); 278 287 } 279 288 } … … 398 407 sysinfo_set_item_val("fb.scanline", NULL, scan); 399 408 sysinfo_set_item_val("fb.address.physical", NULL, addr); 409 sysinfo_set_item_val("fb.invert-colors", NULL, invert_colors); 400 410 401 411 /* Allocate double buffer */ … … 417 427 if (!blankline) 418 428 panic("Failed to allocate blank line for framebuffer."); 419 for (y=0; y < FONT_SCANLINES; y++) 420 for (x=0; x < xres; x++) 421 (*rgb2scr)(&blankline[POINTPOS(x,y)],BGCOLOR); 429 for (y=0; y < FONT_SCANLINES; y++) { 430 for (x=0; x < xres; x++) { 431 (*rgb2scr)(&blankline[POINTPOS(x,y)], COLOR(BGCOLOR)); 432 } 433 } 422 434 423 435 clear_screen(); -
kernel/genarch/src/kbd/key.c
r801579fe r253f35a1 68 68 spinlock_lock(&keylock); 69 69 switch (sc) { 70 71 70 case SC_LSHIFT: 71 case SC_RSHIFT: 72 72 keyflags &= ~PRESSED_SHIFT; 73 73 break; 74 74 case SC_CAPSLOCK: 75 75 keyflags &= ~PRESSED_CAPSLOCK; 76 76 if (lockflags & LOCKED_CAPSLOCK) … … 79 79 lockflags |= LOCKED_CAPSLOCK; 80 80 break; 81 81 default: 82 82 break; 83 83 } -
kernel/genarch/src/kbd/z8530.c
r801579fe r253f35a1 42 42 #include <arch/drivers/z8530.h> 43 43 #include <arch/interrupt.h> 44 #include <arch/drivers/kbd.h> 44 45 #include <cpu.h> 45 46 #include <arch/asm.h> … … 49 50 #include <console/console.h> 50 51 #include <interrupt.h> 52 #include <sysinfo/sysinfo.h> 53 #include <print.h> 51 54 52 55 /* … … 54 57 */ 55 58 #define IGNORE_CODE 0x7f /* all keys up */ 59 60 bool z8530_belongs_to_kernel = true; 56 61 57 62 static void z8530_suspend(chardev_t *); … … 70 75 void z8530_grab(void) 71 76 { 77 z8530_belongs_to_kernel = true; 72 78 } 73 79 … … 75 81 void z8530_release(void) 76 82 { 83 z8530_belongs_to_kernel = false; 77 84 } 78 85 … … 83 90 stdin = &kbrd; 84 91 92 sysinfo_set_item_val("kbd", NULL, true); 93 sysinfo_set_item_val("kbd.irq", NULL, 0); 94 sysinfo_set_item_val("kbd.address.virtual", NULL, (uintptr_t) kbd_virt_address); 95 85 96 (void) z8530_read_a(RR8); 86 97 87 z8530_write_a(WR1, WR1_IARCSC); /* interrupt on all characters */ 98 /* 99 * Clear any pending TX interrupts or we never manage 100 * to set FHC UART interrupt state to idle. 101 */ 102 z8530_write_a(WR0, WR0_TX_IP_RST); 103 104 z8530_write_a(WR1, WR1_IARCSC); /* interrupt on all characters */ 88 105 89 106 /* 8 bits per character and enable receiver */ 90 107 z8530_write_a(WR3, WR3_RX8BITSCH | WR3_RX_ENABLE); 91 108 92 z8530_write_a(WR9, WR9_MIE); /* Master Interrupt Enable. */109 z8530_write_a(WR9, WR9_MIE); /* Master Interrupt Enable. */ 93 110 94 111 /*
Note:
See TracChangeset
for help on using the changeset viewer.