00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __sys_irq_h__
00033 #define __sys_irq_h__
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00040
00041
00042
00044
00045 #ifdef CONF_RCX_COMPILER
00046 #define HANDLER_WRAPPER(wrapstring,handstring)
00047 #else
00048 #define HANDLER_WRAPPER(wrapstring,handstring) \
00049 __asm__ (".text\n.align 1\n.global _" wrapstring "\n_" wrapstring \
00050 ": push r0\npush r1\npush r2\npush r3\njsr @_" handstring \
00051 "\npop r3\npop r2\npop r1\npop r0\nrts\n")
00052 #endif
00053
00055
00056
00057
00059
00060 extern void *reset_vector;
00061 extern void *nmi_vector;
00062 extern void *irq0_vector;
00063 extern void *irq1_vector;
00064 extern void *irq2_vector;
00065 extern void *icia_vector;
00066 extern void *icib_vector;
00067 extern void *icic_vector;
00068 extern void *icid_vector;
00069 extern void *ocia_vector;
00070 extern void *ocib_vector;
00071 extern void *fovi_vector;
00072 extern void *cmi0a_vector;
00073 extern void *cmi0b_vector;
00074 extern void *ovi0_vector;
00075 extern void *cmi1a_vector;
00076 extern void *cmi1b_vector;
00077 extern void *ovi1_vector;
00078 extern void *eri_vector;
00079 extern void *rxi_vector;
00080 extern void *txi_vector;
00081 extern void *tei_vector;
00082 extern void *ad_vector;
00083 extern void *wovf_vector;
00084
00085 extern void *rom_reset_vector;
00086 extern void rom_ocia_handler();
00087 extern void rom_ocia_return();
00088 extern void rom_dummy_handler();
00089
00090
00092
00093
00094
00096
00098 extern inline void disable_irqs() {
00099 __asm__ __volatile__("\torc #0x80,ccr\n":::"cc");
00100 }
00101
00103 extern inline void enable_irqs() {
00104 __asm__ __volatile__("\tandc #0x7f,ccr\n":::"cc");
00105 }
00106
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110
00111 #endif // __sys_irq_h__
00112