diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-03-09 21:39:31 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-03-09 21:39:31 +0100 |
commit | 2174deab670da368367d64463b8fa6b82b5be44f (patch) | |
tree | 81c6cf03fd7a564b7db6a4a2b057ed574b17d543 | |
parent | 9f55195e84a905ecf4bdaa81f3d6ead52171725b (diff) |
Clean exposition of interface to userland
Only the notification bits should be in include/device/.
Keep only the device_intr_ prefix.
-rw-r--r-- | Makefrag.am | 5 | ||||
-rw-r--r-- | device/intr.c | 8 | ||||
-rw-r--r-- | device/intr.h (renamed from include/device/intr.h) | 11 | ||||
-rw-r--r-- | include/device/notify.defs (renamed from include/device/intr.defs) | 4 | ||||
-rw-r--r-- | include/device/notify.h | 34 |
5 files changed, 45 insertions, 17 deletions
diff --git a/Makefrag.am b/Makefrag.am index d9dbc150..971b35ca 100644 --- a/Makefrag.am +++ b/Makefrag.am @@ -312,6 +312,7 @@ libkernel_a_SOURCES += \ device/ds_routines.c \ device/ds_routines.h \ device/intr.c \ + device/intr.h \ device/if_ether.h \ device/if_hdr.h \ device/io_req.h \ @@ -358,8 +359,8 @@ include_device_HEADERS = \ include/device/device_reply.defs \ include/device/device_request.defs \ include/device/device_types.defs \ - include/device/intr.defs \ - include/device/intr.h \ + include/device/notify.defs \ + include/device/notify.h \ include/device/device_types.h \ include/device/disk_status.h \ include/device/net_status.h \ diff --git a/device/intr.c b/device/intr.c index eb37ecf5..1e9ab898 100644 --- a/device/intr.c +++ b/device/intr.c @@ -253,7 +253,7 @@ static boolean_t deliver_intr (int line, ipc_port_t dest_port) { ipc_kmsg_t kmsg; - mach_intr_notification_t *n; + device_intr_notification_t *n; mach_port_t dest = (mach_port_t) dest_port; if (dest == MACH_PORT_NULL) @@ -264,17 +264,17 @@ deliver_intr (int line, ipc_port_t dest_port) return FALSE; ikm_init(kmsg, sizeof *n); - n = (mach_intr_notification_t *) &kmsg->ikm_header; + n = (device_intr_notification_t *) &kmsg->ikm_header; mach_msg_header_t *m = &n->intr_header; mach_msg_type_t *t = &n->intr_type; m->msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND, 0); m->msgh_size = sizeof *n; - m->msgh_seqno = INTR_NOTIFY_MSGH_SEQNO; + m->msgh_seqno = DEVICE_NOTIFY_MSGH_SEQNO; m->msgh_local_port = MACH_PORT_NULL; m->msgh_remote_port = MACH_PORT_NULL; - m->msgh_id = MACH_INTR_NOTIFY; + m->msgh_id = DEVICE_INTR_NOTIFY; t->msgt_name = MACH_MSG_TYPE_INTEGER_32; t->msgt_size = 32; diff --git a/include/device/intr.h b/device/intr.h index 53d81bb5..48843cf0 100644 --- a/include/device/intr.h +++ b/device/intr.h @@ -4,13 +4,7 @@ #include <device/device_types.h> #include <kern/queue.h> - -typedef struct -{ - mach_msg_header_t intr_header; - mach_msg_type_t intr_type; - int line; -} mach_intr_notification_t; +#include <device/notify.h> typedef struct intr_entry { @@ -21,8 +15,7 @@ typedef struct intr_entry int unacked_interrupts; /* Number of times irqs were disabled for this */ } user_intr_t; -#define INTR_NOTIFY_MSGH_SEQNO 0 -#define MACH_INTR_NOTIFY 100 +#define DEVICE_NOTIFY_MSGH_SEQNO 0 int install_user_intr_handler (unsigned int line, unsigned long flags, diff --git a/include/device/intr.defs b/include/device/notify.defs index 368b96c6..ea374d26 100644 --- a/include/device/intr.defs +++ b/include/device/notify.defs @@ -29,8 +29,8 @@ subsystem notify 100; #include <mach/std_types.defs> serverprefix do_; -serverdemux intr_notify_server; +serverdemux device_intr_notify_server; -simpleroutine mach_intr_notify( +simpleroutine device_intr_notify( notify : notify_port_t; name : int); diff --git a/include/device/notify.h b/include/device/notify.h new file mode 100644 index 00000000..b6907b03 --- /dev/null +++ b/include/device/notify.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010 Free Software Foundation, Inc. + * + * 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. + * + * THE FREE SOFTWARE FOUNDATIONALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + */ + +/* + * Device notification definitions. + */ + +#ifndef _MACH_DEVICE_NOTIFY_H_ +#define _MACH_DEVICE_NOTIFY_H_ + +#include <mach/port.h> +#include <mach/message.h> + +typedef struct +{ + mach_msg_header_t intr_header; + mach_msg_type_t intr_type; + int line; +} device_intr_notification_t; + +#define DEVICE_INTR_NOTIFY 100 + +#endif /* _MACH_DEVICE_NOTIFY_H_ */ |