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


Ignore:
Timestamp:
2007-06-01T14:15:42Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ea7890e7
Parents:
60133d0
Message:

initial merge of branches/fs
(not finished, huge cleanup is needed)

File:
1 edited

Legend:

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

    r60133d0 rff3a34b  
    4343#include <sysinfo/sysinfo.h>
    4444#include <ddi/ddi.h>
     45#include <print.h>
     46#include <align.h>
    4547
    4648static parea_t rd_parea;                /**< Physical memory area for rd. */
    4749
     50/**
     51 * RAM disk initialization routine. At this point, the RAM disk memory is shared
     52 * and information about the share is provided as sysinfo values to the userspace
     53 * tasks.
     54 */ 
    4855int init_rd(rd_header * header, size_t size)
    4956{
     
    7582                return RE_UNSUPPORTED;
    7683       
     84        if (dsize % FRAME_SIZE)
     85                return RE_UNSUPPORTED;
     86
    7787        if (hsize > size)
    7888                return RE_INVALID;
     
    8191                dsize = size - hsize;
    8292       
    83         rd_parea.pbase = KA2PA((void *) header + hsize);
     93        rd_parea.pbase = ALIGN_DOWN((uintptr_t) KA2PA((void *) header + hsize), FRAME_SIZE);
    8494        rd_parea.vbase = (uintptr_t) ((void *) header + hsize);
    8595        rd_parea.frames = SIZE2FRAMES(dsize);
     
    8898
    8999        sysinfo_set_item_val("rd", NULL, true);
     100        sysinfo_set_item_val("rd.header_size", NULL, hsize);   
    90101        sysinfo_set_item_val("rd.size", NULL, dsize);
    91102        sysinfo_set_item_val("rd.address.physical", NULL, (unative_t)
Note: See TracChangeset for help on using the changeset viewer.