Changeset 7f1c620 in mainline for genarch/src/fb/fb.c


Ignore:
Timestamp:
2006-07-04T17:17:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • genarch/src/fb/fb.c

    r991779c5 r7f1c620  
    5050SPINLOCK_INITIALIZE(fb_lock);
    5151
    52 static __u8 *fbaddress = NULL;
    53 
    54 static __u8 *blankline = NULL;
    55 static __u8 *dbbuffer = NULL; /* Buffer for fast scrolling console */
     52static uint8_t *fbaddress = NULL;
     53
     54static uint8_t *blankline = NULL;
     55static uint8_t *dbbuffer = NULL; /* Buffer for fast scrolling console */
    5656static int dboffset;
    5757
     
    9999static void rgb_3byte(void *dst, int rgb)
    100100{
    101         __u8 *scr = dst;
     101        uint8_t *scr = dst;
    102102#if (defined(BIG_ENDIAN) || defined(FB_BIG_ENDIAN))
    103103        scr[0] = RED(rgb, 8);
     
    113113static int byte3_rgb(void *src)
    114114{
    115         __u8 *scr = src;
     115        uint8_t *scr = src;
    116116#if (defined(BIG_ENDIAN) || defined(FB_BIG_ENDIAN))
    117117        return scr[0] << 16 | scr[1] << 8 | scr[2];
     
    125125{
    126126        /* 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);
    128128}
    129129
     
    131131static int byte2_rgb(void *src)
    132132{
    133         int color = *(__u16 *)(src);
     133        int color = *(uint16_t *)(src);
    134134        return (((color >> 11) & 0x1f) << (16 + 3)) | (((color >> 5) & 0x3f) << (8 + 2)) | ((color & 0x1f) << 3);
    135135}
     
    138138static void rgb_1byte(void *dst, int rgb)
    139139{
    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);
    141141}
    142142
     
    144144static int byte1_rgb(void *src)
    145145{
    146         int color = *(__u8 *)src;
     146        int color = *(uint8_t *)src;
    147147        return (((color >> 5) & 0x7) << (16 + 5)) | (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5);
    148148}
     
    185185static void scroll_screen(void)
    186186{
    187         __u8 *lastline = &fbaddress[(rows - 1) * ROW_BYTES];
     187        uint8_t *lastline = &fbaddress[(rows - 1) * ROW_BYTES];
    188188        int firstsz;
    189189
     
    226226
    227227/** Draw character at given position */
    228 static void draw_glyph(__u8 glyph, unsigned int col, unsigned int row)
     228static void draw_glyph(uint8_t glyph, unsigned int col, unsigned int row)
    229229{
    230230        unsigned int y;
     
    337337 *
    338338 */
    339 void fb_init(__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan)
     339void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan)
    340340{
    341341        switch (bpp) {
     
    367367       
    368368        /* Map the framebuffer */
    369         fbaddress = (__u8 *) hw_map((__address) addr, fbsize);
     369        fbaddress = (uint8_t *) hw_map((uintptr_t) addr, fbsize);
    370370       
    371371        xres = x;
     
    400400
    401401        /* Initialized blank line */
    402         blankline = (__u8 *) malloc(ROW_BYTES, FRAME_ATOMIC);
     402        blankline = (uint8_t *) malloc(ROW_BYTES, FRAME_ATOMIC);
    403403        if (!blankline)
    404404                panic("Failed to allocate blank line for framebuffer.");
Note: See TracChangeset for help on using the changeset viewer.