Changeset f8ddd17 in mainline for kernel/generic/src/lib/rd.c
- Timestamp:
- 2006-12-09T20:20:50Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b82a13c
- Parents:
- 9ab9c2ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/rd.c
r9ab9c2ec rf8ddd17 42 42 #include <mm/frame.h> 43 43 #include <sysinfo/sysinfo.h> 44 #include <ddi/ddi.h> 45 46 static parea_t rd_parea; /**< Physical memory area for rd. */ 44 47 45 48 int init_rd(rd_header * header, size_t size) 46 49 { 47 50 /* 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)) 49 53 return RE_INVALID; 50 54 … … 77 81 dsize = size - hsize; 78 82 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 79 89 sysinfo_set_item_val("rd", NULL, true); 80 90 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)); 82 95 83 96 return RE_OK;
Note:
See TracChangeset
for help on using the changeset viewer.