Changeset f8ddd17 in mainline for kernel/generic/src/lib/rd.c


Ignore:
Timestamp:
2006-12-09T20:20:50Z (18 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/rd.c

    r9ab9c2ec rf8ddd17  
    4242#include <mm/frame.h>
    4343#include <sysinfo/sysinfo.h>
     44#include <ddi/ddi.h>
     45
     46static parea_t rd_parea;                /**< Physical memory area for rd. */
    4447
    4548int init_rd(rd_header * header, size_t size)
    4649{
    4750        /* Identify RAM disk */
    48         if ((header->magic[0] != RD_MAG0) || (header->magic[1] != RD_MAG1) || (header->magic[2] != RD_MAG2) || (header->magic[3] != RD_MAG3))
     51        if ((header->magic[0] != RD_MAG0) || (header->magic[1] != RD_MAG1) ||
     52                (header->magic[2] != RD_MAG2) || (header->magic[3] != RD_MAG3))
    4953                return RE_INVALID;
    5054       
     
    7781                dsize = size - hsize;
    7882       
     83        rd_parea.pbase = KA2PA((void *) header + hsize);
     84        rd_parea.vbase = (uintptr_t) ((void *) header + hsize);
     85        rd_parea.frames = SIZE2FRAMES(dsize);
     86        rd_parea.cacheable = true;
     87        ddi_parea_register(&rd_parea);
     88
    7989        sysinfo_set_item_val("rd", NULL, true);
    8090        sysinfo_set_item_val("rd.size", NULL, dsize);
    81         sysinfo_set_item_val("rd.address.physical", NULL, (unative_t) KA2PA((void *) header + hsize));
     91        sysinfo_set_item_val("rd.address.physical", NULL, (unative_t)
     92                KA2PA((void *) header + hsize));
     93        sysinfo_set_item_val("rd.address.color", NULL, (unative_t)
     94                PAGE_COLOR((uintptr_t) header + hsize));
    8295
    8396        return RE_OK;
Note: See TracChangeset for help on using the changeset viewer.