Changeset f8ddd17 in mainline for uspace/fb


Ignore:
Timestamp:
2006-12-09T20:20:50Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b82a13c
Parents:
9ab9c2ec
Message:

Rework support for virtually indexed cache.
Instead of repeatedly flushing the data cache, which was a huge overkill, refuse to create an illegal address alias
in the kernel (again) and allocate appropriate page color in userspace instead. Extend the detection also to
SYS_PHYSMEM_MAP syscall.

Add support for tracking physical memory areas mappable by SYS_PHYSMEM_MAP.

Lots of coding style changes.

Location:
uspace/fb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/fb/ega.c

    r9ab9c2ec rf8ddd17  
    3535 */
    3636
    37 
    3837#include <stdlib.h>
    3938#include <unistd.h>
     
    6362saved_screen saved_screens[MAX_SAVED_SCREENS];
    6463
    65 
    6664#define EGA_IO_ADDRESS 0x3d4
    6765#define EGA_IO_SIZE 2
     
    127125        int i;
    128126        if (rows > 0) {
    129                 memcpy (scr_addr,((char *)scr_addr) + rows * scr_width * 2, scr_width * scr_height * 2 - rows * scr_width * 2);
     127                memcpy (scr_addr,((char *)scr_addr) + rows * scr_width * 2,
     128                        scr_width * scr_height * 2 - rows * scr_width * 2);
    130129                for (i = 0; i < rows * scr_width ; i ++)
    131                         (((short *)scr_addr) + scr_width * scr_height - rows * scr_width) [i] = ((style << 8) + ' ');
     130                        (((short *)scr_addr) + scr_width * scr_height - rows *
     131                                scr_width) [i] = ((style << 8) + ' ');
    132132        } else if (rows < 0) {
    133 
    134                 memcpy (((char *)scr_addr) - rows * scr_width * 2 ,scr_addr ,scr_width * scr_height * 2 + rows * scr_width * 2);
     133                memcpy (((char *)scr_addr) - rows * scr_width * 2, scr_addr,
     134                        scr_width * scr_height * 2 + rows * scr_width * 2);
    135135                for (i = 0; i < - rows * scr_width ; i++)
    136136                        ((short *)scr_addr) [i] = ((style << 8 ) + ' ');
     
    309309        scr_width=sysinfo_value("fb.width");
    310310        scr_height=sysinfo_value("fb.height");
    311         iospace_enable(task_get_id(),(void *)EGA_IO_ADDRESS,2);
    312 
    313         sz = scr_width*scr_height*2;
    314         scr_addr = as_get_mappable_page(sz);
    315 
    316         physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >> PAGE_WIDTH,
    317                     AS_AREA_READ | AS_AREA_WRITE);
     311        iospace_enable(task_get_id(), (void *) EGA_IO_ADDRESS, 2);
     312
     313        sz = scr_width * scr_height * 2;
     314        scr_addr = as_get_mappable_page(sz, (int)
     315                sysinfo_value("fb.address.color"));
     316
     317        physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >>
     318                PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);
    318319
    319320        async_set_client_connection(ega_client_connection);
  • uspace/fb/fb.c

    r9ab9c2ec rf8ddd17  
    705705                /* We accept one area for data interchange */
    706706                if (IPC_GET_ARG1(*call) == shm_id) {
    707                         void *dest = as_get_mappable_page(IPC_GET_ARG2(*call));
     707                        void *dest = as_get_mappable_page(IPC_GET_ARG2(*call),
     708                                PAGE_COLOR(IPC_GET_ARG1(*call)));
    708709                        shm_size = IPC_GET_ARG2(*call);
    709                         if (!ipc_answer_fast(callid, 0, (sysarg_t)dest, 0))
     710                        if (!ipc_answer_fast(callid, 0, (sysarg_t) dest, 0))
    710711                                shm = dest;
    711712                        else
     
    717718                } else {
    718719                        intersize = IPC_GET_ARG2(*call);
    719                         receive_comm_area(callid,call,(void *)&interbuffer);
     720                        receive_comm_area(callid, call, (void *) &interbuffer);
    720721                }
    721722                return 1;
     
    12831284
    12841285        asz = fb_scanline * fb_height;
    1285         fb_addr = as_get_mappable_page(asz);
     1286        fb_addr = as_get_mappable_page(asz, (int) sysinfo_value("fb.address.color"));
    12861287       
    12871288        physmem_map(fb_ph_addr, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >> PAGE_WIDTH,
    12881289                    AS_AREA_READ | AS_AREA_WRITE);
    12891290
    1290         if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual, fb_invert_colors))
     1291        if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual,
     1292                fb_invert_colors))
    12911293                return 0;
    12921294       
  • uspace/fb/main.c

    r9ab9c2ec rf8ddd17  
    4444        void *dest;
    4545
    46         dest = as_get_mappable_page(IPC_GET_ARG2(*call));
     46        dest = as_get_mappable_page(IPC_GET_ARG2(*call),
     47                PAGE_COLOR(IPC_GET_ARG1(*call)));
    4748        if (ipc_answer_fast(callid, 0, (sysarg_t)dest, 0) == 0) {
    4849                if (*area)
Note: See TracChangeset for help on using the changeset viewer.