irq.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Ondrej Palkovsky
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00035 #ifndef __IRQ_H__
00036 #define __IRQ_H__
00037 
00039 #define IRQ_MAX_PROG_SIZE 10
00040 
00042 #define IPC_IRQ_RESERVED_VIRTUAL 10
00043 
00044 #define IPC_IRQ_KLOG       (-1)
00045 #define IPC_IRQ_KBDRESTART (-2)
00046 
00047 typedef enum {
00048         CMD_MEM_READ_1 = 0,
00049         CMD_MEM_READ_2,
00050         CMD_MEM_READ_4,
00051         CMD_MEM_READ_8,
00052         CMD_MEM_WRITE_1,
00053         CMD_MEM_WRITE_2,
00054         CMD_MEM_WRITE_4,
00055         CMD_MEM_WRITE_8,
00056         CMD_PORT_READ_1,
00057         CMD_PORT_WRITE_1,
00058         CMD_IA64_GETCHAR,
00059         CMD_PPC32_GETCHAR,
00060         CMD_LAST
00061 } irq_cmd_type;
00062 
00063 typedef struct {
00064         irq_cmd_type cmd;
00065         void *addr;
00066         unsigned long long value; 
00067         int dstarg;
00068 } irq_cmd_t;
00069 
00070 typedef struct {
00071         unsigned int cmdcount;
00072         irq_cmd_t *cmds;
00073 } irq_code_t;
00074 
00075 #ifdef KERNEL
00076 
00077 #include <ipc/ipc.h>
00078 
00079 extern void ipc_irq_make_table(int irqcount);
00080 extern int ipc_irq_register(answerbox_t *box, int irq, irq_code_t *ucode);
00081 extern void ipc_irq_send_notif(int irq);
00082 extern void ipc_irq_send_msg(int irq, __native a1, __native a2, __native a3);
00083 extern void ipc_irq_unregister(answerbox_t *box, int irq);
00084 extern void irq_ipc_bind_arch(__native irq);
00085 extern void ipc_irq_cleanup(answerbox_t *box);
00086 
00087 #endif
00088 
00089 #endif
00090 

Generated on Sun Jun 18 17:28:03 2006 for HelenOS Kernel (ppc64) by  doxygen 1.4.6