Changeset 7f1c620 in mainline for genarch/src/fb/fb.c
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
genarch/src/fb/fb.c
r991779c5 r7f1c620 50 50 SPINLOCK_INITIALIZE(fb_lock); 51 51 52 static __u8*fbaddress = NULL;53 54 static __u8*blankline = NULL;55 static __u8*dbbuffer = NULL; /* Buffer for fast scrolling console */52 static uint8_t *fbaddress = NULL; 53 54 static uint8_t *blankline = NULL; 55 static uint8_t *dbbuffer = NULL; /* Buffer for fast scrolling console */ 56 56 static int dboffset; 57 57 … … 99 99 static void rgb_3byte(void *dst, int rgb) 100 100 { 101 __u8*scr = dst;101 uint8_t *scr = dst; 102 102 #if (defined(BIG_ENDIAN) || defined(FB_BIG_ENDIAN)) 103 103 scr[0] = RED(rgb, 8); … … 113 113 static int byte3_rgb(void *src) 114 114 { 115 __u8*scr = src;115 uint8_t *scr = src; 116 116 #if (defined(BIG_ENDIAN) || defined(FB_BIG_ENDIAN)) 117 117 return scr[0] << 16 | scr[1] << 8 | scr[2]; … … 125 125 { 126 126 /* 5-bit, 6-bits, 5-bits */ 127 *(( __u16*)(dst)) = RED(rgb, 5) << 11 | GREEN(rgb, 6) << 5 | BLUE(rgb, 5);127 *((uint16_t *)(dst)) = RED(rgb, 5) << 11 | GREEN(rgb, 6) << 5 | BLUE(rgb, 5); 128 128 } 129 129 … … 131 131 static int byte2_rgb(void *src) 132 132 { 133 int color = *( __u16*)(src);133 int color = *(uint16_t *)(src); 134 134 return (((color >> 11) & 0x1f) << (16 + 3)) | (((color >> 5) & 0x3f) << (8 + 2)) | ((color & 0x1f) << 3); 135 135 } … … 138 138 static void rgb_1byte(void *dst, int rgb) 139 139 { 140 *( __u8*)dst = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | BLUE(rgb, 3);140 *(uint8_t *)dst = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | BLUE(rgb, 3); 141 141 } 142 142 … … 144 144 static int byte1_rgb(void *src) 145 145 { 146 int color = *( __u8*)src;146 int color = *(uint8_t *)src; 147 147 return (((color >> 5) & 0x7) << (16 + 5)) | (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5); 148 148 } … … 185 185 static void scroll_screen(void) 186 186 { 187 __u8*lastline = &fbaddress[(rows - 1) * ROW_BYTES];187 uint8_t *lastline = &fbaddress[(rows - 1) * ROW_BYTES]; 188 188 int firstsz; 189 189 … … 226 226 227 227 /** Draw character at given position */ 228 static void draw_glyph( __u8glyph, unsigned int col, unsigned int row)228 static void draw_glyph(uint8_t glyph, unsigned int col, unsigned int row) 229 229 { 230 230 unsigned int y; … … 337 337 * 338 338 */ 339 void fb_init( __addressaddr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan)339 void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan) 340 340 { 341 341 switch (bpp) { … … 367 367 368 368 /* Map the framebuffer */ 369 fbaddress = ( __u8 *) hw_map((__address) addr, fbsize);369 fbaddress = (uint8_t *) hw_map((uintptr_t) addr, fbsize); 370 370 371 371 xres = x; … … 400 400 401 401 /* Initialized blank line */ 402 blankline = ( __u8*) malloc(ROW_BYTES, FRAME_ATOMIC);402 blankline = (uint8_t *) malloc(ROW_BYTES, FRAME_ATOMIC); 403 403 if (!blankline) 404 404 panic("Failed to allocate blank line for framebuffer.");
Note:
See TracChangeset
for help on using the changeset viewer.