2 * (C) Copyright 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
12 * I/O interruptions specific constants & structures
17 } __attribute__((packed
));
19 #define PSA_INT_GPR ((u64*) 0x200)
20 #define PSA_TMP_PSW ((struct psw*) 0x280)
22 #define IO_INT_OLD_PSW ((void*) 0x170)
23 #define IO_INT_NEW_PSW ((void*) 0x1f0)
24 #define IO_INT_CODE ((struct io_int_code*) 0xb8)
26 #define EXT_INT_OLD_PSW ((void*) 0x130)
27 #define EXT_INT_NEW_PSW ((void*) 0x1b0)
28 #define EXT_INT_CODE ((u16*) 0x86)
30 #define SVC_INT_OLD_PSW ((void*) 0x140)
31 #define SVC_INT_NEW_PSW ((void*) 0x1c0)
32 #define SVC_INT_CODE ((u16*) 0x8a)
34 #define PGM_INT_OLD_PSW ((void*) 0x150)
35 #define PGM_INT_NEW_PSW ((void*) 0x1d0)
36 #define PGM_INT_ILC ((u8*) 0x8d)
37 #define PGM_INT_CODE ((u16*) 0x8e)
40 * Assembly stubs to call the C-handlers
42 extern void IO_INT(void);
43 extern void EXT_INT(void);
44 extern void SVC_INT(void);
45 extern void PGM_INT(void);
46 extern void MCH_INT(void);
49 * local_int_disable - disable interruptions & return old mask
51 #define local_int_disable() ({ \
52 unsigned long __flags; \
53 __asm__ __volatile__ ( \
54 "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \
59 * local_int_restore - restore interrupt mask
62 #define local_int_restore(x) \
63 __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory")
66 * local_int_restore - restore interrupt mask
69 static inline int interruptable()
83 return (x
& 0x43) != 0;
86 extern void set_timer(void);
89 * The Supervisor-Service call table
91 #define SVC_SCHEDULE 0
92 #define SVC_SCHEDULE_BLOCKED 1
93 #define SVC_SCHEDULE_EXIT 2
95 extern u64 svc_table
[NR_SVC
];
97 /* Interrupt handlers */
98 extern void __pgm_int_handler(void);
99 extern void __ext_int_handler(void);
100 extern void __io_int_handler(void);
102 /* Interrupt handler stack pointer */
103 extern u8
*int_stack_ptr
;