Subversion Repositories HelenOS-historic

Rev

Rev 1489 | Rev 1493 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (C) 2006 Jakub Vana
  3.  * Copyright (C) 2006 Ondrej Palkovsky
  4.  * All rights reserved.
  5.  *
  6.  * Redistribution and use in source and binary forms, with or without
  7.  * modification, are permitted provided that the following conditions
  8.  * are met:
  9.  *
  10.  * - Redistributions of source code must retain the above copyright
  11.  *   notice, this list of conditions and the following disclaimer.
  12.  * - Redistributions in binary form must reproduce the above copyright
  13.  *   notice, this list of conditions and the following disclaimer in the
  14.  *   documentation and/or other materials provided with the distribution.
  15.  * - The name of the author may not be used to endorse or promote products
  16.  *   derived from this software without specific prior written permission.
  17.  *
  18.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  19.  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  20.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28.  */
  29.  
  30. #include <stdlib.h>
  31. #include <unistd.h>
  32. #include <string.h>
  33. #include <ddi.h>
  34. #include <sysinfo.h>
  35. #include <align.h>
  36. #include <as.h>
  37. #include <ipc/fb.h>
  38. #include <ipc/ipc.h>
  39. #include <ipc/ns.h>
  40. #include <ipc/services.h>
  41. #include <kernel/errno.h>
  42. #include <async.h>
  43. #include "font-8x16.h"
  44. #include "helenos.xbm"
  45. #include "fb.h"
  46.  
  47. #define DEFAULT_BGCOLOR                0x000080
  48. #define DEFAULT_FGCOLOR                0xffff00
  49.  
  50. /***************************************************************/
  51. /* Pixel specific fuctions */
  52.  
  53. typedef void (*putpixel_fn_t)(unsigned int x, unsigned int y, int color);
  54. typedef int (*getpixel_fn_t)(unsigned int x, unsigned int y);
  55.  
  56. struct {
  57.     __u8 *fbaddress ;
  58.  
  59.     unsigned int xres ;
  60.     unsigned int yres ;
  61.     unsigned int scanline ;
  62.     unsigned int pixelbytes ;
  63.  
  64.     putpixel_fn_t putpixel;
  65.     getpixel_fn_t getpixel;
  66. } screen;
  67.  
  68. typedef struct {
  69.     int initialized;
  70.     unsigned int x, y;
  71.     unsigned int width, height;
  72.  
  73.     /* Text support in window */
  74.     unsigned int rows, cols;
  75.     /* Style for text printing */
  76.     int bgcolor, fgcolor;
  77.     /* Auto-cursor position */
  78.     int cursor_active, cur_col, cur_row;
  79. } viewport_t;
  80.  
  81. #define MAX_VIEWPORTS 128
  82. static viewport_t viewports[128];
  83.  
  84. /* Allow only 1 connection */
  85. static int client_connected = 0;
  86.  
  87. #define RED(x, bits)    ((x >> (16 + 8 - bits)) & ((1 << bits) - 1))
  88. #define GREEN(x, bits)  ((x >> (8 + 8 - bits)) & ((1 << bits) - 1))
  89. #define BLUE(x, bits)   ((x >> (8 - bits)) & ((1 << bits) - 1))
  90.  
  91. #define COL_WIDTH   8
  92. #define ROW_BYTES   (screen.scanline * FONT_SCANLINES)
  93.  
  94. #define POINTPOS(x, y)  ((y) * screen.scanline + (x) * screen.pixelbytes)
  95.  
  96. /** Put pixel - 24-bit depth, 1 free byte */
  97. static void putpixel_4byte(unsigned int x, unsigned int y, int color)
  98. {
  99.     *((__u32 *)(screen.fbaddress + POINTPOS(x, y))) = color;
  100. }
  101.  
  102. /** Return pixel color - 24-bit depth, 1 free byte */
  103. static int getpixel_4byte(unsigned int x, unsigned int y)
  104. {
  105.     return *((__u32 *)(screen.fbaddress + POINTPOS(x, y))) & 0xffffff;
  106. }
  107.  
  108. /** Put pixel - 24-bit depth */
  109. static void putpixel_3byte(unsigned int x, unsigned int y, int color)
  110. {
  111.     unsigned int startbyte = POINTPOS(x, y);
  112.  
  113. #if (defined(BIG_ENDIAN) || defined(FB_BIG_ENDIAN))
  114.     screen.fbaddress[startbyte] = RED(color, 8);
  115.     screen.fbaddress[startbyte + 1] = GREEN(color, 8);
  116.     screen.fbaddress[startbyte + 2] = BLUE(color, 8);
  117. #else
  118.     screen.fbaddress[startbyte + 2] = RED(color, 8);
  119.     screen.fbaddress[startbyte + 1] = GREEN(color, 8);
  120.     screen.fbaddress[startbyte + 0] = BLUE(color, 8);
  121. #endif
  122.  
  123. }
  124.  
  125. /** Return pixel color - 24-bit depth */
  126. static int getpixel_3byte(unsigned int x, unsigned int y)
  127. {
  128.     unsigned int startbyte = POINTPOS(x, y);
  129.  
  130.  
  131.  
  132. #if (defined(BIG_ENDIAN) || defined(FB_BIG_ENDIAN))
  133.     return screen.fbaddress[startbyte] << 16 | screen.fbaddress[startbyte + 1] << 8 | screen.fbaddress[startbyte + 2];
  134. #else
  135.     return screen.fbaddress[startbyte + 2] << 16 | screen.fbaddress[startbyte + 1] << 8 | screen.fbaddress[startbyte + 0];
  136. #endif
  137.                                
  138.  
  139. }
  140.  
  141. /** Put pixel - 16-bit depth (5:6:5) */
  142. static void putpixel_2byte(unsigned int x, unsigned int y, int color)
  143. {
  144.     /* 5-bit, 6-bits, 5-bits */
  145.     *((__u16 *)(screen.fbaddress + POINTPOS(x, y))) = RED(color, 5) << 11 | GREEN(color, 6) << 5 | BLUE(color, 5);
  146. }
  147.  
  148. /** Return pixel color - 16-bit depth (5:6:5) */
  149. static int getpixel_2byte(unsigned int x, unsigned int y)
  150. {
  151.     int color = *((__u16 *)(screen.fbaddress + POINTPOS(x, y)));
  152.     return (((color >> 11) & 0x1f) << (16 + 3)) | (((color >> 5) & 0x3f) << (8 + 2)) | ((color & 0x1f) << 3);
  153. }
  154.  
  155. /** Put pixel - 8-bit depth (3:2:3) */
  156. static void putpixel_1byte(unsigned int x, unsigned int y, int color)
  157. {
  158.     screen.fbaddress[POINTPOS(x, y)] = RED(color, 3) << 5 | GREEN(color, 2) << 3 | BLUE(color, 3);
  159. }
  160.  
  161. /** Return pixel color - 8-bit depth (3:2:3) */
  162. static int getpixel_1byte(unsigned int x, unsigned int y)
  163. {
  164.     int color = screen.fbaddress[POINTPOS(x, y)];
  165.     return (((color >> 5) & 0x7) << (16 + 5)) | (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5);
  166. }
  167.  
  168. static void putpixel(int vp, unsigned int x, unsigned int y, int color)
  169. {
  170.     screen.putpixel(viewports[vp].x + x, viewports[vp].y + y, color);
  171. }
  172. static int getpixel(int vp, unsigned int x, unsigned int y)
  173. {
  174.     return screen.getpixel(viewports[vp].x + x, viewports[vp].y + y);
  175. }
  176.  
  177. /** Fill line with color BGCOLOR */
  178. static void clear_line(int vp, unsigned int y)
  179. {
  180.     unsigned int x;
  181.     for (x = 0; x < viewports[vp].width; x++)
  182.         putpixel(vp, x, y, viewports[vp].bgcolor);
  183. }
  184.  
  185. /** Fill viewport with background color */
  186. static void clear_port(int vp)
  187. {
  188.     unsigned int y;
  189.  
  190.     clear_line(vp, 0);
  191.     for (y = viewports[vp].y+1; y < viewports[vp].y+viewports[vp].height; y++) {
  192.         memcpy(&screen.fbaddress[POINTPOS(viewports[vp].x,y)],
  193.                &screen.fbaddress[POINTPOS(viewports[vp].x,viewports[vp].y)],
  194.                screen.pixelbytes * viewports[vp].width);
  195.     }  
  196. }
  197.  
  198. /** Scroll port up/down
  199.  *
  200.  * @param vp Viewport to scroll
  201.  * @param rows Positive number - scroll up, negative - scroll down
  202.  */
  203. static void scroll_port(int vp, int rows)
  204. {
  205.     int y;
  206.     int startline;
  207.     int endline;
  208.    
  209.     if (rows > 0) {
  210.         for (y=viewports[vp].y; y < viewports[vp].y+viewports[vp].height - rows*FONT_SCANLINES; y++)
  211.             memcpy(&screen.fbaddress[POINTPOS(viewports[vp].x,y)],
  212.                    &screen.fbaddress[POINTPOS(viewports[vp].x,y + rows*FONT_SCANLINES)],
  213.                    screen.pixelbytes * viewports[vp].width);
  214.         /* Clear last row */
  215.         startline = viewports[vp].y+FONT_SCANLINES*(viewports[vp].rows-1);
  216.         endline = viewports[vp].y + viewports[vp].height;
  217.         clear_line(vp, startline);
  218.         for (y=startline+1;y < endline; y++)
  219.             memcpy(&screen.fbaddress[POINTPOS(viewports[vp].x,y)],
  220.                    &screen.fbaddress[POINTPOS(viewports[vp].x,startline)],
  221.                    screen.pixelbytes * viewports[vp].width);
  222.                  
  223.     } else if (rows < 0) {
  224.         rows = -rows;
  225.         for (y=viewports[vp].y + viewports[vp].height-1; y >= viewports[vp].y + rows*FONT_SCANLINES; y--)
  226.             memcpy(&screen.fbaddress[POINTPOS(viewports[vp].x,y)],
  227.                 &screen.fbaddress[POINTPOS(viewports[vp].x,y - rows*FONT_SCANLINES)],
  228.                 screen.pixelbytes * viewports[vp].width);
  229.         /* Clear first row */
  230.         clear_line(0, viewports[vp].bgcolor);
  231.         for (y=1;y < rows*FONT_SCANLINES; y++)
  232.             memcpy(&screen.fbaddress[POINTPOS(viewports[vp].x,viewports[vp].y+y)],
  233.                    &screen.fbaddress[POINTPOS(viewports[vp].x,viewports[vp].y)],
  234.                    screen.pixelbytes * viewports[vp].width);
  235.     }
  236. }
  237.  
  238. static void invert_pixel(int vp,unsigned int x, unsigned int y)
  239. {
  240.     putpixel(vp, x, y, ~getpixel(vp, x, y));
  241. }
  242.  
  243.  
  244. /** Draw one line of glyph at a given position */
  245. static void draw_glyph_line(int vp,unsigned int glline, unsigned int x, unsigned int y)
  246. {
  247.     unsigned int i;
  248.  
  249.     for (i = 0; i < 8; i++)
  250.         if (glline & (1 << (7 - i))) {
  251.             putpixel(vp, x + i, y, viewports[vp].fgcolor);
  252.         } else
  253.             putpixel(vp, x + i, y, viewports[vp].bgcolor);
  254. }
  255.  
  256. /***************************************************************/
  257. /* Character-console functions */
  258.  
  259. /** Draw character at given position */
  260. static void draw_glyph(int vp,__u8 glyph, unsigned int row, unsigned int col)
  261. {
  262.     unsigned int y;
  263.  
  264.     for (y = 0; y < FONT_SCANLINES; y++)
  265.         draw_glyph_line(vp ,fb_font[glyph * FONT_SCANLINES + y], col * COL_WIDTH, row * FONT_SCANLINES + y);
  266. }
  267.  
  268. /** Invert character at given position */
  269. static void invert_char(int vp,unsigned int row, unsigned int col)
  270. {
  271.     unsigned int x;
  272.     unsigned int y;
  273.  
  274.     for (x = 0; x < COL_WIDTH; x++)
  275.         for (y = 0; y < FONT_SCANLINES; y++)
  276.             invert_pixel(vp, col * COL_WIDTH + x, row * FONT_SCANLINES + y);
  277. }
  278.  
  279. static void draw_logo(int vp,unsigned int startx, unsigned int starty)
  280. {
  281.     unsigned int x;
  282.     unsigned int y;
  283.     unsigned int byte;
  284.     unsigned int rowbytes;
  285.  
  286.     rowbytes = (helenos_width - 1) / 8 + 1;
  287.  
  288.     for (y = 0; y < helenos_height; y++)
  289.         for (x = 0; x < helenos_width; x++) {
  290.             byte = helenos_bits[rowbytes * y + x / 8];
  291.             byte >>= x % 8;
  292.             if (byte & 1)
  293.                 putpixel(vp ,startx + x, starty + y, viewports[vp].fgcolor);
  294.         }
  295. }
  296.  
  297. /***************************************************************/
  298. /* Stdout specific functions */
  299.  
  300.  
  301. /** Create new viewport
  302.  *
  303.  * @return New viewport number
  304.  */
  305. static int viewport_create(unsigned int x, unsigned int y,unsigned int width,
  306.                unsigned int height)
  307. {
  308.     int i;
  309.  
  310.     for (i=0; i < MAX_VIEWPORTS; i++) {
  311.         if (!viewports[i].initialized)
  312.             break;
  313.     }
  314.     if (i == MAX_VIEWPORTS)
  315.         return ELIMIT;
  316.  
  317.     if (width ==0 || height == 0 ||
  318.         x+width > screen.xres || y+height > screen.yres)
  319.         return EINVAL;
  320.     if (width < FONT_SCANLINES || height < COL_WIDTH)
  321.         return EINVAL;
  322.  
  323.     viewports[i].x = x;
  324.     viewports[i].y = y;
  325.     viewports[i].width = width;
  326.     viewports[i].height = height;
  327.    
  328.     viewports[i].rows = height / FONT_SCANLINES;
  329.     viewports[i].cols = width / COL_WIDTH;
  330.  
  331.     viewports[i].bgcolor = DEFAULT_BGCOLOR;
  332.     viewports[i].fgcolor = DEFAULT_FGCOLOR;
  333.    
  334.     viewports[i].cur_col = 0;
  335.     viewports[i].cur_row = 0;
  336.     viewports[i].cursor_active = 0;
  337.  
  338.     viewports[i].initialized = 1;
  339.  
  340.     return i;
  341. }
  342.  
  343.  
  344. /** Initialize framebuffer as a chardev output device
  345.  *
  346.  * @param addr Address of theframebuffer
  347.  * @param x    Screen width in pixels
  348.  * @param y    Screen height in pixels
  349.  * @param bpp  Bits per pixel (8, 16, 24, 32)
  350.  * @param scan Bytes per one scanline
  351.  *
  352.  */
  353. static void screen_init(__address addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan)
  354. {
  355.     switch (bpp) {
  356.         case 8:
  357.             screen.putpixel = putpixel_1byte;
  358.             screen.getpixel = getpixel_1byte;
  359.             screen.pixelbytes = 1;
  360.             break;
  361.         case 16:
  362.             screen.putpixel = putpixel_2byte;
  363.             screen.getpixel = getpixel_2byte;
  364.             screen.pixelbytes = 2;
  365.             break;
  366.         case 24:
  367.             screen.putpixel = putpixel_3byte;
  368.             screen.getpixel = getpixel_3byte;
  369.             screen.pixelbytes = 3;
  370.             break;
  371.         case 32:
  372.             screen.putpixel = putpixel_4byte;
  373.             screen.getpixel = getpixel_4byte;
  374.             screen.pixelbytes = 4;
  375.             break;
  376.     }
  377.  
  378.        
  379.     screen.fbaddress = (unsigned char *) addr;
  380.     screen.xres = xres;
  381.     screen.yres = yres;
  382.     screen.scanline = scan;
  383.    
  384.     /* Create first viewport */
  385.     viewport_create(0,0,xres,yres);
  386.  
  387.     clear_port(0);
  388. }
  389.  
  390. static void draw_char(int vp, char c, unsigned int row, unsigned int col)
  391. {
  392.     viewport_t *vport = &viewports[vp];
  393.  
  394.     if (vport->cursor_active && (vport->cur_col != col || vport->cur_row != row))
  395.         invert_char(vp, vport->cur_row, vport->cur_col);
  396.    
  397.     draw_glyph(vp, c, row, col);
  398.  
  399.     vport->cur_col = col;
  400.     vport->cur_row = row;
  401.  
  402.     vport->cur_col++;
  403.     if (vport->cur_col>= vport->cols) {
  404.         vport->cur_col = 0;
  405.         vport->cur_row++;
  406.         if (vport->cur_row >= vport->rows)
  407.             vport->cur_row--;
  408.     }
  409.     if (vport->cursor_active)
  410.         invert_char(vp, vport->cur_row, vport->cur_col);
  411. }
  412.  
  413. static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall)
  414. {
  415.     ipc_callid_t callid;
  416.     ipc_call_t call;
  417.     int retval;
  418.     int i;
  419.     unsigned int row,col;
  420.     char c;
  421.  
  422.     int vp = 0;
  423.     viewport_t *vport = &viewports[0];
  424.  
  425.     if (client_connected) {
  426.         ipc_answer_fast(iid, ELIMIT, 0,0);
  427.         return;
  428.     }
  429.     client_connected = 1;
  430.     ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */
  431.  
  432.     while (1) {
  433.         callid = async_get_call(&call);
  434.         switch (IPC_GET_METHOD(call)) {
  435.         case IPC_M_PHONE_HUNGUP:
  436.             client_connected = 0;
  437.             /* cleanup other viewports */
  438.             for (i=1; i < MAX_VIEWPORTS; i++)
  439.                 vport->initialized = 0;
  440.             ipc_answer_fast(callid,0,0,0);
  441.             return; /* Exit thread */
  442.         case FB_PUTCHAR:
  443.             c = IPC_GET_ARG1(call);
  444.             row = IPC_GET_ARG2(call);
  445.             col = IPC_GET_ARG3(call);
  446.             if (row >= vport->rows || col >= vport->cols) {
  447.                 retval = EINVAL;
  448.                 break;
  449.             }
  450.             ipc_answer_fast(callid,0,0,0);
  451.  
  452.             draw_char(vp, c, row, col);
  453.             continue; /* msg already answered */
  454.         case FB_CLEAR:
  455.             clear_port(vp);
  456.             if (vport->cursor_active)
  457.                 invert_char(vp, vport->cur_row, vport->cur_col);
  458.             retval = 0;
  459.             break;
  460.         case FB_CURSOR_GOTO:
  461.             row = IPC_GET_ARG1(call);
  462.             col = IPC_GET_ARG2(call);
  463.             if (row >= vport->rows || col >= vport->cols) {
  464.                 retval = EINVAL;
  465.                 break;
  466.             }
  467.             retval = 0;
  468.             if (viewports[vp].cursor_active) {
  469.                 invert_char(vp, vport->cur_row, vport->cur_col);
  470.                 invert_char(vp, row, col);
  471.             }
  472.             vport->cur_col = col;
  473.             vport->cur_row = row;
  474.             break;
  475.         case FB_CURSOR_VISIBILITY:
  476.             i = IPC_GET_ARG1(call);
  477.             retval = 0;
  478.             if ((i && vport->cursor_active) || (!i && !vport->cursor_active))
  479.                 break;
  480.  
  481.             vport->cursor_active = i;
  482.             invert_char(vp, vport->cur_row, vport->cur_col);
  483.             break;
  484.         case FB_GET_CSIZE:
  485.             ipc_answer_fast(callid, 0, vport->rows, vport->cols);
  486.             continue;
  487.         case FB_SCROLL:
  488.             i = IPC_GET_ARG1(call);
  489.             if (i > vport->rows || i < (- (int)vport->rows)) {
  490.                 retval = EINVAL;
  491.                 break;
  492.             }
  493.             if (vport->cursor_active)
  494.                 invert_char(vp, vport->cur_row, vport->cur_col);
  495.             scroll_port(vp, i);
  496.             if (vport->cursor_active)
  497.                 invert_char(vp, vport->cur_row, vport->cur_col);
  498.             retval = 0;
  499.             break;
  500.         case FB_VIEWPORT_SWITCH:
  501.             i = IPC_GET_ARG1(call);
  502.             if (i < 0 || i >= MAX_VIEWPORTS) {
  503.                 retval = EINVAL;
  504.                 break;
  505.             }
  506.             if (! viewports[i].initialized ) {
  507.                 retval = EADDRNOTAVAIL;
  508.                 break;
  509.             }
  510.             vp = i;
  511.             vport = &viewports[vp];
  512.             retval = 0;
  513.             break;
  514.         case FB_VIEWPORT_CREATE:
  515.             retval = viewport_create(IPC_GET_ARG1(call) >> 16,
  516.                          IPC_GET_ARG1(call) & 0xffff,
  517.                          IPC_GET_ARG2(call) >> 16,
  518.                          IPC_GET_ARG2(call) & 0xffff);
  519.             break;
  520.         case FB_VIEWPORT_DELETE:
  521.             i = IPC_GET_ARG1(call);
  522.             if (i < 0 || i >= MAX_VIEWPORTS) {
  523.                 retval = EINVAL;
  524.                 break;
  525.             }
  526.             if (! viewports[i].initialized ) {
  527.                 retval = EADDRNOTAVAIL;
  528.                 break;
  529.             }
  530.             viewports[i].initialized = 0;
  531.             retval = 0;
  532.             break;
  533.         case FB_SET_STYLE:
  534.             vport->fgcolor = IPC_GET_ARG1(call);
  535.             vport->bgcolor = IPC_GET_ARG2(call);
  536.             retval = 0;
  537.             break;
  538.         case FB_GET_RESOLUTION:
  539.             ipc_answer_fast(callid, 0, screen.xres,screen.yres);
  540.             continue;
  541.         default:
  542.             retval = ENOENT;
  543.         }
  544.         ipc_answer_fast(callid,retval,0,0);
  545.     }
  546. }
  547.  
  548. int fb_init(void)
  549. {
  550.     __address fb_ph_addr;
  551.     unsigned int fb_width;
  552.     unsigned int fb_height;
  553.     unsigned int fb_bpp;
  554.     unsigned int fb_scanline;
  555.     __address fb_addr;
  556.  
  557.     async_set_client_connection(fb_client_connection);
  558.  
  559.     fb_ph_addr=sysinfo_value("fb.address.physical");
  560.     fb_width=sysinfo_value("fb.width");
  561.     fb_height=sysinfo_value("fb.height");
  562.     fb_bpp=sysinfo_value("fb.bpp");
  563.     fb_scanline=sysinfo_value("fb.scanline");
  564.  
  565.     fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE);
  566.    
  567.     map_physmem(task_get_id(),(void *)((__address)fb_ph_addr),(void *)fb_addr,
  568.             (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH,
  569.             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
  570.    
  571.     screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline);
  572.  
  573.     return 0;
  574. }
  575.  
  576.