Changeset 253f35a1 in mainline
- Timestamp:
- 2006-09-07T19:56:44Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab1ae2d9
- Parents:
- 801579fe
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/Makefile.inc
r801579fe r253f35a1 77 77 78 78 DEFS += -DKBD_ADDR_OVRD=0x1fff13083f8ULL 79 80 DEFS += -DFB_INVERT_COLORS 79 81 endif 80 82 -
kernel/arch/sparc64/include/drivers/z8530.h
r801579fe r253f35a1 72 72 73 73 /* Write Register 0 */ 74 #define WR0_TX_IP_RST (0x5<<3) /** Reset pending TX interrupt. */ 74 75 #define WR0_ERR_RST (0x6<<3) 75 76 -
kernel/arch/sparc64/src/console.c
r801579fe r253f35a1 94 94 } 95 95 96 /** Acquire console back for kernel 97 * 98 */ 99 void arch_grab_console(void) 100 { 101 #ifdef CONFIG_Z8530 102 z8530_grab(); 103 #endif 104 } 105 106 /** Return console to userspace 107 * 108 */ 109 void arch_release_console(void) 110 { 111 #ifdef CONFIG_Z8530 112 z8530_release(); 113 #endif 114 } 96 115 /** @} 97 116 */ -
kernel/arch/sparc64/src/drivers/fhc.c
r801579fe r253f35a1 58 58 fhc = (void *) hw_map(FHC_UART_ADDR, PAGE_SIZE); 59 59 60 (void) fhc[FHC_UART_ICLR];61 60 fhc[FHC_UART_ICLR] = 0; 62 (void) fhc[FHC_UART_IMAP]; 63 fhc[FHC_UART_IMAP] = Z8530_INTRCV_DATA0; /* hardcoded for Simics simulation */ 64 (void) fhc[FHC_UART_IMAP]; 65 fhc[FHC_UART_IMAP] = 0x80000000; /* hardcoded for Simics simulation */ 61 fhc[FHC_UART_IMAP] = 0x80000000; 66 62 } 67 63 68 64 void fhc_uart_reset(void) 69 65 { 70 (void) fhc[FHC_UART_ICLR];71 66 fhc[FHC_UART_ICLR] = 0; 72 67 } -
kernel/arch/sparc64/src/sparc64.c
r801579fe r253f35a1 94 94 } 95 95 96 /** Acquire console back for kernel97 *98 */99 void arch_grab_console(void)100 {101 }102 /** Return console to userspace103 *104 */105 void arch_release_console(void)106 {107 }108 109 96 /** Switch to userspace. */ 110 97 void userspace(uspace_arg_t *kernel_uarg) -
kernel/arch/sparc64/src/trap/interrupt.c
r801579fe r253f35a1 43 43 #include <arch/asm.h> 44 44 #include <arch/barrier.h> 45 45 #include <print.h> 46 46 #include <genarch/kbd/z8530.h> 47 47 … … 62 62 void irq_ipc_bind_arch(unative_t irq) 63 63 { 64 /* TODO */ 64 #ifdef CONFIG_Z8530 65 z8530_belongs_to_kernel = false; 66 #endif 65 67 } 66 68 … … 83 85 * interrupt traps. Call the interrupt handler directly. 84 86 */ 87 88 if (z8530_belongs_to_kernel) 89 z8530_interrupt(); 90 else 91 ipc_irq_send_notif(0); 85 92 fhc_uart_reset(); 86 z8530_interrupt();87 93 break; 94 88 95 #endif 89 96 } -
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 /* -
kernel/generic/src/ipc/irq.c
r801579fe r253f35a1 56 56 #include <syscall/copy.h> 57 57 #include <console/console.h> 58 #include <print.h> 58 59 59 60 typedef struct { … … 68 69 static int irq_conns_size; 69 70 70 #include <print.h> 71 71 72 /* Execute code associated with IRQ notification */ 72 73 static void code_execute(call_t *call, irq_code_t *code) -
kernel/generic/src/ipc/sysipc.c
r801579fe r253f35a1 48 48 #include <security/cap.h> 49 49 #include <mm/as.h> 50 #include <print.h> 50 51 51 52 #define GET_CHECK_PHONE(phone,phoneid,err) { \ -
uspace/fb/fb.c
r801579fe r253f35a1 71 71 72 72 struct { 73 uint8_t *fbaddress ; 74 75 unsigned int xres ; 76 unsigned int yres ; 77 unsigned int scanline ; 78 unsigned int pixelbytes ; 73 uint8_t *fbaddress; 74 75 unsigned int xres; 76 unsigned int yres; 77 unsigned int scanline; 78 unsigned int pixelbytes; 79 unsigned int invert_colors; 79 80 80 81 conv2scr_fn_t rgb2scr; … … 141 142 #define POINTPOS(x, y) ((y) * screen.scanline + (x) * screen.pixelbytes) 142 143 144 static inline int COLOR(int color) 145 { 146 return screen.invert_colors ? ~color : color; 147 } 148 143 149 /* Conversion routines between different color representations */ 144 150 static void rgb_4byte(void *dst, int rgb) … … 164 170 scr[0] = BLUE(rgb, 8); 165 171 #endif 166 167 168 172 } 169 173 … … 218 222 219 223 if (! (vport->paused && vport->dbdata)) 220 (*screen.rgb2scr)(&screen.fbaddress[POINTPOS(dx,dy)], color);224 (*screen.rgb2scr)(&screen.fbaddress[POINTPOS(dx,dy)], COLOR(color)); 221 225 222 226 if (vport->dbdata) { 223 227 int dline = (y + vport->dboffset) % vport->height; 224 228 int doffset = screen.pixelbytes * (dline * vport->width + x); 225 (*screen.rgb2scr)(&vport->dbdata[doffset], color);229 (*screen.rgb2scr)(&vport->dbdata[doffset], COLOR(color)); 226 230 } 227 231 } … … 233 237 int dy = vport->y + y; 234 238 235 return (*screen.scr2rgb)(&screen.fbaddress[POINTPOS(dx,dy)]);239 return COLOR((*screen.scr2rgb)(&screen.fbaddress[POINTPOS(dx,dy)])); 236 240 } 237 241 … … 239 243 int color) 240 244 { 241 (*screen.rgb2scr)(&mem[POINTPOS(x,y)], color);245 (*screen.rgb2scr)(&mem[POINTPOS(x,y)], COLOR(color)); 242 246 } 243 247 … … 455 459 * @param scan Bytes per one scanline 456 460 * @param align Alignment for 24bpp mode. 461 * @param invert_colors Inverted colors. 457 462 * 458 463 */ 459 464 static void 460 screen_init(void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan, int align) 465 screen_init(void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan, 466 int align, int invert_colors) 461 467 { 462 468 switch (bpp) { … … 491 497 screen.yres = yres; 492 498 screen.scanline = scan; 499 screen.invert_colors = invert_colors; 493 500 494 501 /* Create first viewport */ … … 594 601 int pos = (y * pmap->width + x) * screen.pixelbytes; 595 602 596 (*screen.rgb2scr)(&pmap->data[pos], color);603 (*screen.rgb2scr)(&pmap->data[pos],COLOR(color)); 597 604 } 598 605 … … 1224 1231 unsigned int fb_bpp_align; 1225 1232 unsigned int fb_scanline; 1233 unsigned int fb_invert_colors; 1226 1234 void *fb_addr; 1227 1235 size_t asz; … … 1235 1243 fb_bpp_align=sysinfo_value("fb.bpp-align"); 1236 1244 fb_scanline=sysinfo_value("fb.scanline"); 1245 fb_invert_colors=sysinfo_value("fb.invert-colors"); 1237 1246 1238 1247 asz = fb_scanline*fb_height; … … 1242 1251 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 1243 1252 1244 screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline, fb_bpp_align );1253 screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline, fb_bpp_align, fb_invert_colors); 1245 1254 1246 1255 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.