--- Gnu-Mach/kern/ipc_kobject.c 2020/09/02 04:36:57 1.1 +++ Gnu-Mach/kern/ipc_kobject.c 2020/09/02 04:45:18 1.1.1.3 @@ -1,25 +1,25 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -33,12 +33,8 @@ * Functions for letting a port represent a kernel object. */ -#include -#include -#include -#include -#include - +#include +#include #include #include #include @@ -49,6 +45,9 @@ #include #include #include +#include +#include +#include #if MACH_MACHINE_ROUTINES #include @@ -152,17 +151,11 @@ ipc_kobject_server(request) mach_host_server_routine(), device_server_routine(), device_pager_server_routine(), - mach4_server_routine(); + mach4_server_routine(), + gnumach_server_routine(); #if MACH_DEBUG extern mig_routine_t mach_debug_server_routine(); #endif -#if NORMA_TASK - extern mig_routine_t mach_norma_server_routine(); - extern mig_routine_t norma_internal_server_routine(); -#endif -#if NORMA_VM - extern mig_routine_t proxy_server_routine(); -#endif #if MACH_MACHINE_ROUTINES extern mig_routine_t MACHINE_SERVER_ROUTINE(); @@ -176,29 +169,29 @@ ipc_kobject_server(request) || (routine = device_pager_server_routine(&request->ikm_header)) != 0 #if MACH_DEBUG || (routine = mach_debug_server_routine(&request->ikm_header)) != 0 -#endif MACH_DEBUG -#if NORMA_TASK - || (routine = mach_norma_server_routine(&request->ikm_header)) != 0 - || (routine = norma_internal_server_routine(&request->ikm_header)) != 0 -#endif NORMA_TASK -#if NORMA_VM - || (routine = proxy_server_routine(&request->ikm_header)) != 0 -#endif NORMA_VM +#endif /* MACH_DEBUG */ || (routine = mach4_server_routine(&request->ikm_header)) != 0 + || (routine = gnumach_server_routine(&request->ikm_header)) != 0 #if MACH_MACHINE_ROUTINES || (routine = MACHINE_SERVER_ROUTINE(&request->ikm_header)) != 0 -#endif MACH_MACHINE_ROUTINES +#endif /* MACH_MACHINE_ROUTINES */ ) { (*routine)(&request->ikm_header, &reply->ikm_header); - } - else if (!ipc_kobject_notify(&request->ikm_header,&reply->ikm_header)){ + kernel_task->messages_received++; + } else { + if (!ipc_kobject_notify(&request->ikm_header, + &reply->ikm_header)) { ((mig_reply_header_t *) &reply->ikm_header)->RetCode = MIG_BAD_ID; #if MACH_IPC_TEST printf("ipc_kobject_server: bogus kernel message, id=%d\n", request->ikm_header.msgh_id); -#endif MACH_IPC_TEST +#endif /* MACH_IPC_TEST */ + } else { + kernel_task->messages_received++; + } } + kernel_task->messages_sent++; } check_simple_locks(); @@ -218,11 +211,11 @@ ipc_kobject_server(request) case MACH_MSG_TYPE_PORT_SEND: ipc_port_release_send(*destp); break; - + case MACH_MSG_TYPE_PORT_SEND_ONCE: ipc_port_release_sonce(*destp); break; - + default: #if MACH_ASSERT assert(!"ipc_object_destroy: strange destination rights"); @@ -334,9 +327,9 @@ ipc_kobject_destroy( default: #if MACH_ASSERT - printf("ipc_kobject_destroy: port 0x%x, kobj 0x%x, type %d\n", + printf("ipc_kobject_destroy: port 0x%p, kobj 0x%lx, type %d\n", port, port->ip_kobject, ip_kotype(port)); -#endif MACH_ASSERT +#endif /* MACH_ASSERT */ break; } } @@ -368,23 +361,12 @@ ipc_kobject_notify(request_header, reply return FALSE; } switch (ip_kotype(port)) { -#if NORMA_VM - case IKOT_XMM_OBJECT: - return xmm_object_notify(request_header); - - case IKOT_XMM_PAGER: - return xmm_pager_notify(request_header); - - case IKOT_XMM_KERNEL: - return xmm_kernel_notify(request_header); - - case IKOT_XMM_REPLY: - return xmm_reply_notify(request_header); -#endif NORMA_VM - case IKOT_DEVICE: return ds_notify(request_header); + case IKOT_PAGER_PROXY: + return memory_object_proxy_notify(request_header); + default: return FALSE; }