Changeset 51dbadf3 in mainline
- Timestamp:
- 2006-06-06T07:42:20Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1890e312
- Parents:
- e9073f2
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
re9073f2 r51dbadf3 40 40 fb \ 41 41 console \ 42 tetris 42 tetris \ 43 ipcc \ 44 klog 43 45 44 46 ifeq ($(ARCH), amd64) -
libc/generic/async.c
re9073f2 r51dbadf3 139 139 140 140 static void default_client_connection(ipc_callid_t callid, ipc_call_t *call); 141 static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call); 141 142 static async_client_conn_t client_connection = default_client_connection; 143 static async_client_conn_t interrupt_received = default_interrupt_received; 142 144 143 145 /** Add microseconds to give timeval */ … … 342 344 ipc_answer_fast(callid, ENOENT, 0, 0); 343 345 } 344 345 /** Function that gets called on interrupt receival 346 * 347 * This function is defined as a weak symbol - to be redefined in 348 * user code. 349 */ 350 void interrupt_received(ipc_call_t *call) 351 { 352 } 353 346 static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call) 347 { 348 } 354 349 355 350 /** Wrapper for client connection thread … … 441 436 switch (IPC_GET_METHOD(*call)) { 442 437 case IPC_M_INTERRUPT: 443 interrupt_received(call);438 (*interrupt_received)(callid,call); 444 439 return; 445 440 case IPC_M_CONNECT_ME_TO: … … 758 753 client_connection = conn; 759 754 } 755 void async_set_interrupt_received(async_client_conn_t conn) 756 { 757 interrupt_received = conn; 758 } -
libc/generic/time.c
re9073f2 r51dbadf3 35 35 #include <atomic.h> 36 36 #include <futex.h> 37 #include <ipc/services.h> 37 38 38 39 #include <sysinfo.h> … … 68 69 /* Get the mapping of kernel clock */ 69 70 res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, 70 mapping, PAGE_SIZE, 0,71 mapping, PAGE_SIZE, SERVICE_MEM_REALTIME, 71 72 NULL,&rights,NULL); 72 73 if (res) { -
libc/include/async.h
re9073f2 r51dbadf3 99 99 void async_destroy_manager(void); 100 100 void async_set_client_connection(async_client_conn_t conn); 101 void async_set_interrupt_received(async_client_conn_t conn); 101 102 int _async_init(void); 102 103 /* Should be defined by application */104 void interrupt_received(ipc_call_t *call) __attribute__((weak));105 103 106 104 -
libc/include/ipc/services.h
re9073f2 r51dbadf3 42 42 /* Memory area to be received from NS */ 43 43 #define SERVICE_MEM_REALTIME 1 44 #define SERVICE_MEM_KLOG 2 44 45 45 46 #endif -
ns/ns.c
re9073f2 r51dbadf3 34 34 #include <ipc/ipc.h> 35 35 #include <ipc/ns.h> 36 #include <ipc/services.h> 36 37 #include <stdio.h> 37 38 #include <unistd.h> … … 77 78 int static ping_phone; 78 79 79 static void get_realtime_as(ipc_callid_t callid, ipc_call_t *call) 80 { 81 static void *addr = NULL; 80 static void *clockaddr = NULL; 81 static void *klogaddr = NULL; 82 83 static void get_as(ipc_callid_t callid, ipc_call_t *call, char *name, void **addr) 84 { 82 85 void *ph_addr; 83 86 84 if (! addr) {85 ph_addr = (void *)sysinfo_value( "clock.faddr");87 if (!*addr) { 88 ph_addr = (void *)sysinfo_value(name); 86 89 if (!ph_addr) { 87 90 ipc_answer_fast(callid, ENOENT, 0, 0); 88 91 return; 89 92 } 90 addr = as_get_mappable_page(PAGE_SIZE);91 map_physmem(ph_addr, addr, 1, AS_AREA_READ | AS_AREA_CACHEABLE);92 } 93 ipc_answer_fast(callid, 0, (ipcarg_t) addr, AS_AREA_READ);93 *addr = as_get_mappable_page(PAGE_SIZE); 94 map_physmem(ph_addr, *addr, 1, AS_AREA_READ | AS_AREA_CACHEABLE); 95 } 96 ipc_answer_fast(callid, 0, (ipcarg_t)*addr, AS_AREA_READ); 94 97 } 95 98 … … 110 113 switch (IPC_GET_METHOD(call)) { 111 114 case IPC_M_AS_AREA_RECV: 112 get_realtime_as(callid, &call); 115 switch (IPC_GET_ARG3(call)) { 116 case SERVICE_MEM_REALTIME: 117 get_as(callid, &call, "clock.faddr", &clockaddr); 118 break; 119 case SERVICE_MEM_KLOG: 120 get_as(callid, &call, "klog.faddr", &klogaddr); 121 break; 122 default: 123 ipc_answer_fast(callid, ENOENT, 0, 0); 124 } 113 125 continue; 114 126 case IPC_M_PHONE_HUNGUP:
Note:
See TracChangeset
for help on using the changeset viewer.