Changeset bf9afa07 in mainline for fb/fb.c


Ignore:
Timestamp:
2006-06-02T11:35:05Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d22049
Parents:
49d072e
Message:

Allocation function for allocating free areas for mmap, map_physmem etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fb/fb.c

    r49d072e rbf9afa07  
    360360 *
    361361 */
    362 static void screen_init(__address addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan)
     362static void screen_init(void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan)
    363363{
    364364        switch (bpp) {
     
    598598int fb_init(void)
    599599{
    600         __address fb_ph_addr;
     600        void *fb_ph_addr;
    601601        unsigned int fb_width;
    602602        unsigned int fb_height;
    603603        unsigned int fb_bpp;
    604604        unsigned int fb_scanline;
    605         __address fb_addr;
     605        void *fb_addr;
     606        size_t asz;
    606607
    607608        async_set_client_connection(fb_client_connection);
    608609
    609         fb_ph_addr=sysinfo_value("fb.address.physical");
     610        fb_ph_addr=(void *)sysinfo_value("fb.address.physical");
    610611        fb_width=sysinfo_value("fb.width");
    611612        fb_height=sysinfo_value("fb.height");
     
    613614        fb_scanline=sysinfo_value("fb.scanline");
    614615
    615         fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE);
     616        asz = fb_scanline*fb_height;
     617        fb_addr = as_get_mappable_page(asz);
    616618       
    617         map_physmem((void *)((__address)fb_ph_addr),(void *)fb_addr,
    618                     (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH,
     619        map_physmem(fb_ph_addr, fb_addr, ALIGN_UP(asz,PAGE_SIZE) >>PAGE_WIDTH,
    619620                    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    620621       
Note: See TracChangeset for help on using the changeset viewer.