Changeset 6119f24 in mainline for uspace/lib/c/generic/ipc/ns.c


Ignore:
Timestamp:
2011-01-29T18:58:24Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10477601, 6aef742
Parents:
d7533c7
Message:

map klog area and clock page directly in tasks which require them (do not use the memory sharing from naming service via IPC)
this avoids the circular dependency between gettimeofday() and the async framework (as reported by Jakub Jermar)
it also simplifies the code of the naming service (the memory sharing was never strictly necessary, it was only a demonstrator)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/ipc/ns.c

    rd7533c7 r6119f24  
    3434
    3535#include <async.h>
    36 #include <ipc/services.h>
    3736#include <ipc/ns.h>
    38 #include <sysinfo.h>
    39 #include <errno.h>
    40 #include <as.h>
    41 #include <macros.h>
    4237
    4338int service_register(sysarg_t service)
     
    5651}
    5752
    58 wchar_t *service_klog_share_in(size_t *length)
    59 {
    60         size_t pages;
    61         if (sysinfo_get_value("klog.pages", &pages) != EOK)
    62                 return NULL;
    63        
    64         size_t size = pages * PAGE_SIZE;
    65         *length = size / sizeof(wchar_t);
    66        
    67         wchar_t *klog = (wchar_t *) as_get_mappable_page(size);
    68         if (klog == NULL)
    69                 return NULL;
    70        
    71         int res = async_share_in_start_1_0(PHONE_NS, (void *) klog, size,
    72             SERVICE_MEM_KLOG);
    73         if (res != EOK) {
    74                 as_area_destroy((void *) klog);
    75                 return NULL;
    76         }
    77        
    78         return klog;
    79 }
    80 
    81 void *service_realtime_share_in(void)
    82 {
    83         void *rtime = as_get_mappable_page(PAGE_SIZE);
    84         if (rtime == NULL)
    85                 return NULL;
    86        
    87         int res = async_share_in_start_1_0(PHONE_NS, rtime, PAGE_SIZE,
    88             SERVICE_MEM_REALTIME);
    89         if (res != EOK) {
    90                 as_area_destroy((void *) rtime);
    91                 return NULL;
    92         }
    93        
    94         return rtime;
    95 }
    96 
    9753/** @}
    9854 */
Note: See TracChangeset for help on using the changeset viewer.