~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/um/include/shared/irq_kern.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
  4  */
  5 
  6 #ifndef __IRQ_KERN_H__
  7 #define __IRQ_KERN_H__
  8 
  9 #include <linux/interrupt.h>
 10 #include <linux/time-internal.h>
 11 #include <asm/ptrace.h>
 12 #include "irq_user.h"
 13 
 14 #define UM_IRQ_ALLOC    -1
 15 
 16 int um_request_irq(int irq, int fd, enum um_irq_type type,
 17                    irq_handler_t handler, unsigned long irqflags,
 18                    const char *devname, void *dev_id);
 19 
 20 #ifdef CONFIG_UML_TIME_TRAVEL_SUPPORT
 21 /**
 22  * um_request_irq_tt - request an IRQ with timetravel handler
 23  *
 24  * @irq: the IRQ number, or %UM_IRQ_ALLOC
 25  * @fd: The file descriptor to request an IRQ for
 26  * @type: read or write
 27  * @handler: the (generic style) IRQ handler
 28  * @irqflags: Linux IRQ flags
 29  * @devname: name for this to show
 30  * @dev_id: data pointer to pass to the IRQ handler
 31  * @timetravel_handler: the timetravel interrupt handler, invoked with the IRQ
 32  *      number, fd, dev_id and time-travel event pointer.
 33  *
 34  * Returns: The interrupt number assigned or a negative error.
 35  *
 36  * Note that the timetravel handler is invoked only if the time_travel_mode is
 37  * %TT_MODE_EXTERNAL, and then it is invoked even while the system is suspended!
 38  * This function must call time_travel_add_irq_event() for the event passed with
 39  * an appropriate delay, before sending an ACK on the socket it was invoked for.
 40  *
 41  * If this was called while the system is suspended, then adding the event will
 42  * cause the system to resume.
 43  *
 44  * Since this function will almost certainly have to handle the FD's condition,
 45  * a read will consume the message, and after that it is up to the code using
 46  * it to pass such a message to the @handler in whichever way it can.
 47  *
 48  * If time_travel_mode is not %TT_MODE_EXTERNAL the @timetravel_handler will
 49  * not be invoked at all and the @handler must handle the FD becoming
 50  * readable (or writable) instead. Use um_irq_timetravel_handler_used() to
 51  * distinguish these cases.
 52  *
 53  * See virtio_uml.c for an example.
 54  */
 55 int um_request_irq_tt(int irq, int fd, enum um_irq_type type,
 56                       irq_handler_t handler, unsigned long irqflags,
 57                       const char *devname, void *dev_id,
 58                       void (*timetravel_handler)(int, int, void *,
 59                                                  struct time_travel_event *));
 60 #else
 61 static inline
 62 int um_request_irq_tt(int irq, int fd, enum um_irq_type type,
 63                       irq_handler_t handler, unsigned long irqflags,
 64                       const char *devname, void *dev_id,
 65                       void (*timetravel_handler)(int, int, void *,
 66                                                  struct time_travel_event *))
 67 {
 68         return um_request_irq(irq, fd, type, handler, irqflags,
 69                               devname, dev_id);
 70 }
 71 #endif
 72 
 73 static inline bool um_irq_timetravel_handler_used(void)
 74 {
 75         return time_travel_mode == TT_MODE_EXTERNAL;
 76 }
 77 
 78 void um_free_irq(int irq, void *dev_id);
 79 void free_irqs(void);
 80 #endif
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php