genarch
[Miscellanea]


Files

file  fb.h
file  font-8x16.h
file  division.h
file  fb.c
file  font-8x16.c
file  division.c

Defines

#define FONT_GLIPHS   256
#define FONT_SCANLINES   16
#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 ABSVAL(x)   ( (x) > 0 ? (x) : -(x))
#define SGN(x)   ( (x) >= 0 ? 1 : 0 )

Functions

void fb_init (__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan)
int __divsi3 (int a, int b)
long long __divdi3 (long long a, long long b)
unsigned int __udivsi3 (unsigned int a, unsigned int b)
unsigned long long __udivdi3 (unsigned long long a, unsigned long long b)
int __modsi3 (int a, int b)
long long __moddi3 (long long a, long long b)
unsigned int __umodsi3 (unsigned int a, unsigned int b)
unsigned long long __umoddi3 (unsigned long long a, unsigned long long b)
unsigned long long __udivmoddi3 (unsigned long long a, unsigned long long b, unsigned long long *c)
 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 unsigned int divandmod32 (unsigned int a, unsigned int b, unsigned int *remainder)
static unsigned long long divandmod64 (unsigned long long a, unsigned long long b, unsigned long long *remainder)

Variables

spinlock_t fb_lock
unsigned char fb_font [FONT_GLIPHS *FONT_SCANLINES]
static __u8fbaddress = NULL
static __u8blankline = NULL
static __u8dbbuffer = 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]

Define Documentation

#define ABSVAL  )     ( (x) > 0 ? (x) : -(x))
 

Definition at line 37 of file division.c.

Referenced by __divdi3(), and __divsi3().

#define BGCOLOR   0x000080
 

Definition at line 72 of file fb.c.

Referenced by fb_init().

#define BLUE x,
bits   )     ((x >> (8 - bits)) & ((1 << bits) - 1))
 

Definition at line 78 of file fb.c.

Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte().

#define COL_WIDTH   8
 

Definition at line 69 of file fb.c.

Referenced by draw_glyph(), fb_init(), and invert_char().

#define FGCOLOR   0xffff00
 

Definition at line 73 of file fb.c.

Referenced by draw_glyph_line().

#define FONT_GLIPHS   256
 

Definition at line 38 of file font-8x16.h.

#define FONT_SCANLINES   16
 

Definition at line 39 of file font-8x16.h.

Referenced by draw_glyph(), fb_init(), invert_char(), and scroll_screen().

#define GREEN x,
bits   )     ((x >> (8 + 8 - bits)) & ((1 << bits) - 1))
 

Definition at line 77 of file fb.c.

Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte().

#define LOGOCOLOR   0x2020b0
 

Definition at line 74 of file fb.c.

Referenced by draw_logo().

#define POINTPOS x,
 )     ((y) * scanline + (x) * pixelbytes)
 

Definition at line 80 of file fb.c.

Referenced by fb_init(), getpixel(), and putpixel().

#define RED x,
bits   )     ((x >> (16 + 8 - bits)) & ((1 << bits) - 1))
 

Definition at line 76 of file fb.c.

Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte().

#define ROW_BYTES   (scanline * FONT_SCANLINES)
 

Definition at line 70 of file fb.c.

Referenced by fb_init(), and scroll_screen().

#define SGN  )     ( (x) >= 0 ? 1 : 0 )
 

Definition at line 38 of file division.c.

Referenced by __divdi3(), __divsi3(), __moddi3(), and __modsi3().


Function Documentation

long long __divdi3 long long  a,
long long  b
 

Definition at line 120 of file division.c.

References ABSVAL, divandmod64(), and SGN.

Here is the call graph for this function:

int __divsi3 int  a,
int  b
 

Definition at line 108 of file division.c.

References ABSVAL, divandmod32(), and SGN.

Here is the call graph for this function:

long long __moddi3 long long  a,
long long  b
 

Definition at line 160 of file division.c.

References divandmod64(), and SGN.

Here is the call graph for this function:

int __modsi3 int  a,
int  b
 

Definition at line 146 of file division.c.

References divandmod32(), and SGN.

Here is the call graph for this function:

unsigned long long __udivdi3 unsigned long long  a,
unsigned long long  b
 

Definition at line 139 of file division.c.

References divandmod64().

Here is the call graph for this function:

unsigned long long __udivmoddi3 unsigned long long  a,
unsigned long long  b,
unsigned long long *  c
 

Definition at line 189 of file division.c.

References divandmod64().

Here is the call graph for this function:

unsigned int __udivsi3 unsigned int  a,
unsigned int  b
 

Definition at line 132 of file division.c.

References divandmod32().

Here is the call graph for this function:

unsigned long long __umoddi3 unsigned long long  a,
unsigned long long  b
 

Definition at line 182 of file division.c.

References divandmod64().

Here is the call graph for this function:

unsigned int __umodsi3 unsigned int  a,
unsigned int  b
 

Definition at line 174 of file division.c.

References divandmod32().

Here is the call graph for this function:

static int byte1_rgb void *  src  )  [static]
 

Return pixel color - 8-bit depth (3:2:3)

Definition at line 144 of file fb.c.

Referenced by fb_init().

static int byte2_rgb void *  src  )  [static]
 

16-bit depth (5:6:5)

Definition at line 131 of file fb.c.

Referenced by fb_init().

static int byte3_rgb void *  src  )  [static]
 

Definition at line 113 of file fb.c.

Referenced by fb_init().

static int byte4_rgb void *  src  )  [static]
 

Definition at line 94 of file fb.c.

Referenced by fb_init().

static void clear_screen void   )  [static]
 

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().

static unsigned int divandmod32 unsigned int  a,
unsigned int  b,
unsigned int *  remainder
[static]
 

Definition at line 40 of file division.c.

Referenced by __divsi3(), __modsi3(), __udivsi3(), and __umodsi3().

static unsigned long long divandmod64 unsigned long long  a,
unsigned long long  b,
unsigned long long *  remainder
[static]
 

Definition at line 74 of file division.c.

Referenced by __divdi3(), __moddi3(), __udivdi3(), __udivmoddi3(), and __umoddi3().

static void draw_char char  chr  )  [static]
 

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:

static void draw_glyph __u8  glyph,
unsigned int  col,
unsigned int  row
[static]
 

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:

static void draw_glyph_line unsigned int  glline,
unsigned int  x,
unsigned int  y
[static]
 

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:

static void draw_logo unsigned int  startx,
unsigned int  starty
[static]
 

Definition at line 253 of file fb.c.

References LOGOCOLOR, and putpixel().

Referenced by fb_init().

Here is the call graph for this function:

void fb_init __address  addr,
unsigned int  x,
unsigned int  y,
unsigned int  bpp,
unsigned int  scan
 

Initialize framebuffer as a chardev output device

Parameters:
addr Physical address of the framebuffer
x Screen width in pixels
y Screen height in pixels
bpp Bits per pixel (8, 16, 24, 32)
scan Bytes per one scanline

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 arch_post_mm_init().

Here is the call graph for this function:

static void fb_putchar chardev_t dev,
char  ch
[static]
 

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:

static int getpixel unsigned int  x,
unsigned int  y
[static]
 

Get pixel from viewport

Definition at line 161 of file fb.c.

References dbbuffer, dboffset, fbaddress, POINTPOS, scr2rgb, and yres.

Referenced by invert_pixel().

static void invert_char unsigned int  col,
unsigned int  row
[static]
 

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:

static void invert_cursor void   )  [static]
 

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:

static void invert_pixel unsigned int  x,
unsigned int  y
[static]
 

Definition at line 206 of file fb.c.

References getpixel(), and putpixel().

Referenced by invert_char().

Here is the call graph for this function:

static void putpixel unsigned int  x,
unsigned int  y,
int  color
[static]
 

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().

static void rgb_1byte void *  dst,
int  rgb
[static]
 

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().

static void rgb_2byte void *  dst,
int  rgb
[static]
 

16-bit depth (5:6:5)

Definition at line 124 of file fb.c.

References BLUE, GREEN, and RED.

Referenced by fb_init().

static void rgb_3byte void *  dst,
int  rgb
[static]
 

Definition at line 99 of file fb.c.

References BLUE, GREEN, and RED.

Referenced by fb_init().

static void rgb_4byte void *  dst,
int  rgb
[static]
 

Definition at line 89 of file fb.c.

Referenced by fb_init().

static void scroll_screen void   )  [static]
 

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().

SPINLOCK_INITIALIZE fb_lock   ) 
 


Variable Documentation

unsigned int bitspp = 0 [static]
 

Definition at line 61 of file fb.c.

Referenced by fb_init().

__u8* blankline = NULL [static]
 

Definition at line 54 of file fb.c.

Referenced by clear_screen(), fb_init(), and scroll_screen().

unsigned int columns = 0 [static]
 

Definition at line 65 of file fb.c.

Referenced by draw_char(), fb_init(), fb_putchar(), and invert_cursor().

__u8* dbbuffer = NULL [static]
 

Definition at line 55 of file fb.c.

Referenced by clear_screen(), fb_init(), getpixel(), putpixel(), and scroll_screen().

int dboffset [static]
 

Definition at line 56 of file fb.c.

Referenced by fb_init(), getpixel(), putpixel(), and scroll_screen().

unsigned char fb_font[FONT_GLIPHS *FONT_SCANLINES]
 

Definition at line 37 of file font-8x16.c.

Referenced by draw_glyph().

unsigned char fb_font[FONT_GLIPHS *FONT_SCANLINES]
 

Definition at line 37 of file font-8x16.c.

Referenced by draw_glyph().

spinlock_t fb_lock
 

Referenced by fb_putchar().

chardev_operations_t fb_ops [static]
 

Initial value:

 {
        .write = fb_putchar,
}

Definition at line 325 of file fb.c.

Referenced by fb_init().

__u8* fbaddress = NULL [static]
 

Definition at line 52 of file fb.c.

Referenced by clear_screen(), fb_init(), getpixel(), putpixel(), and scroll_screen().

chardev_t framebuffer [static]
 

Definition at line 324 of file fb.c.

Referenced by fb_init().

unsigned int pixelbytes = 0 [static]
 

Definition at line 62 of file fb.c.

Referenced by clear_screen(), and fb_init().

unsigned int position = 0 [static]
 

Definition at line 64 of file fb.c.

Referenced by clever_readline(), draw_char(), fb_putchar(), and invert_cursor().

void(* rgb2scr)(void *, int) [static]
 

Definition at line 85 of file fb.c.

Referenced by fb_init().

unsigned int rows = 0 [static]
 

Definition at line 66 of file fb.c.

Referenced by fb_init(), fb_putchar(), and scroll_screen().

unsigned int scanline = 0 [static]
 

Definition at line 60 of file fb.c.

Referenced by clear_screen(), fb_init(), and scroll_screen().

int(* scr2rgb)(void *) [static]
 

Definition at line 86 of file fb.c.

Referenced by fb_init(), and getpixel().

unsigned int xres = 0 [static]
 

Definition at line 58 of file fb.c.

Referenced by clear_screen(), and fb_init().

unsigned int yres = 0 [static]
 

Definition at line 59 of file fb.c.

Referenced by clear_screen(), fb_init(), getpixel(), putpixel(), and scroll_screen().


Generated on Sun Jun 18 17:27:26 2006 for HelenOS Kernel (ppc32) by  doxygen 1.4.6