Changeset 7c34822e in mainline for uspace/rd/rd.c
- Timestamp:
- 2006-11-30T15:38:45Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7bf7ef7
- Parents:
- 8c19cf28
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/rd/rd.c
r8c19cf28 r7c34822e 39 39 #include <ipc/services.h> 40 40 #include <ipc/ns.h> 41 #include <sysinfo.h> 42 #include <as.h> 43 #include <ddi.h> 44 #include <align.h> 45 #include <bool.h> 41 46 #include <errno.h> 42 47 #include <async.h> … … 65 70 66 71 72 static bool rd_init(void) 73 { 74 size_t rd_size = sysinfo_value("rd.size"); 75 void * rd_ph_addr = (void *) sysinfo_value("rd.address.physical"); 76 77 if (rd_size == 0) 78 return false; 79 80 void * rd_addr = as_get_mappable_page(rd_size); 81 82 map_physmem(rd_ph_addr, rd_addr, ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); 83 84 return true; 85 } 86 87 67 88 int main(int argc, char **argv) 68 89 { 69 ipcarg_t phonead; 90 if (rd_init()) { 91 ipcarg_t phonead; 92 93 async_set_client_connection(rd_connection); 94 95 /* Register service at nameserver */ 96 if (ipc_connect_to_me(PHONE_NS, SERVICE_RD, 0, &phonead) != 0) 97 return -1; 98 99 async_manager(); 100 101 /* Never reached */ 102 return 0; 103 } 70 104 71 async_set_client_connection(rd_connection); 72 73 /* Register service at nameserver */ 74 if (ipc_connect_to_me(PHONE_NS, SERVICE_RD, 0, &phonead) != 0) 75 return -1; 76 77 async_manager(); 78 79 /* Never reached */ 80 return 0; 105 return -1; 81 106 } 82 107
Note:
See TracChangeset
for help on using the changeset viewer.