From 6054cda4de2341b9a77ec4421411725f3684006b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 10 Jul 2020 00:23:32 +0200 Subject: Add hardware interrupt notification mechanism This allows privileged userland drivers to get notifications of hardware interrupts. Initial work by Zheng Da, reworked by Damien Zammit and myself. * Makefrag.am (libkernel_a_SOURCES): Add device/intr.c and device/intr.h. (include_device_HEADERS): Add include/device/notify.defs and include/device/notify.h. * device/dev_hdr.h (name_equal): Add declaration. * device/ds_routines.c: Include (ds_device_intr_register, ds_device_intr_ack): New functions. * device/intr.c, device/intr.h: New files. * doc/mach.texi (Device Interrupt): New section. * i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386/irq.c and i386/i386/irq.h. * i386/i386/irq.c, i386/i386/irq.h: New files. * i386/i386at/conf.c: Include . (irqname): New macro. (dev_name_list): Add irq device. * include/device/device.defs (device_intr_register, device_intr_ack): New RPCs. * include/device/notify.defs, include/device/notify.h: New files. * kern/startup.c: Include (start_kernel_threads): Start intr_thread thread. * linux/dev/arch/i386/kernel/irq.c: Include (linux_action): Add user_intr field. (linux_intr): Call user_intr action if any. (mask_irq, unmask_irq): Move functions to i386/i386/pic.c (__disable_irq, __enable_irq): Move functions to i386/i386/irq.c. (install_user_intr_handler): New function. (request_irq): Initialize user_intr field. * linux/src/include/asm-i386/irq.h (__disable_irq, __enable_irq): Remove prototypes. * i386/i386/pic.c (mask_irq, unmask_irq): New functions. * i386/i386/pic.h (mask_irq, unmask_irq): New prototypes. --- Makefrag.am | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefrag.am') diff --git a/Makefrag.am b/Makefrag.am index 9cf976a5..ea612275 100644 --- a/Makefrag.am +++ b/Makefrag.am @@ -314,6 +314,8 @@ libkernel_a_SOURCES += \ device/ds_routines.h \ device/if_ether.h \ device/if_hdr.h \ + device/intr.c \ + device/intr.h \ device/io_req.h \ device/net_io.c \ device/net_io.h \ @@ -361,6 +363,8 @@ include_device_HEADERS = \ include/device/device_types.h \ include/device/disk_status.h \ include/device/net_status.h \ + include/device/notify.defs \ + include/device/notify.h \ include/device/tape_status.h \ include/device/tty_status.h -- cgit v1.2.3