brickOS Kernel Developer v0.9.0
irq.h
Go to the documentation of this file.
1
12/*
13 * The contents of this file are subject to the Mozilla Public License
14 * Version 1.0 (the "License"); you may not use this file except in
15 * compliance with the License. You may obtain a copy of the License
16 * at http://www.mozilla.org/MPL/
17 *
18 * Software distributed under the License is distributed on an "AS IS"
19 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20 * the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * The Original Code is legOS code, released October 17, 1999.
24 *
25 * The Initial Developer of the Original Code is Markus L. Noga.
26 * Portions created by Markus L. Noga are Copyright (C) 1999
27 * Markus L. Noga. All Rights Reserved.
28 *
29 * Contributor(s): Markus L. Noga <markus@noga.de>
30 */
31
32#ifndef __sys_irq_h__
33#define __sys_irq_h__
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
40//
41// Definitions
42//
44
45#ifdef CONF_RCX_COMPILER
46#define HANDLER_WRAPPER(wrapstring,handstring)
47#else
48#define HANDLER_WRAPPER(wrapstring,handstring) \
49__asm__ (".text\n.align 1\n.global _" wrapstring "\n_" wrapstring \
50": push r0\npush r1\npush r2\npush r3\njsr @_" handstring \
51"\npop r3\npop r2\npop r1\npop r0\nrts\n")
52#endif
53
55//
56// Variables
57//
59
60extern void *reset_vector;
61extern void *nmi_vector;
62extern void *irq0_vector;
63extern void *irq1_vector;
64extern void *irq2_vector;
65extern void *icia_vector;
66extern void *icib_vector;
67extern void *icic_vector;
68extern void *icid_vector;
69extern void *ocia_vector;
70extern void *ocib_vector;
71extern void *fovi_vector;
72extern void *cmi0a_vector;
73extern void *cmi0b_vector;
74extern void *ovi0_vector;
75extern void *cmi1a_vector;
76extern void *cmi1b_vector;
77extern void *ovi1_vector;
78extern void *eri_vector;
79extern void *rxi_vector;
80extern void *txi_vector;
81extern void *tei_vector;
82extern void *ad_vector;
83extern void *wovf_vector;
84
85extern void *rom_reset_vector;
86extern void rom_ocia_handler();
87extern void rom_ocia_return();
88extern void rom_dummy_handler();
89
90
92//
93// Functions
94//
96
98extern inline void disable_irqs() {
99 __asm__ __volatile__("\torc #0x80,ccr\n":::"cc");
100}
101
103extern inline void enable_irqs() {
104 __asm__ __volatile__("\tandc #0x7f,ccr\n":::"cc");
105}
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif // __sys_irq_h__
112
__asm__("\n\ .text\n\ .globl _atomic_inc\n\ _atomic_inc:\n\ stc ccr, r1h ; save flags\n\ orc #0x80, ccr ; disable all but NMI\n\ mov.b @r0, r1l\n\ inc r1l\n\ mov.b r1l, @r0\n\ ldc r1h, ccr ; restore flags\n\ rts\n\ ")
void * irq0_vector
IRQ0 interrupt vector.
void * icib_vector
ICIB interrupt vector.
void rom_ocia_return()
return address in ROM OCIA handler
void * tei_vector
TEI interrupt vector.
void * fovi_vector
FOVI interrupt vector.
void * ad_vector
A/D interrupt vector.
void * reset_vector
reset vector
void * ovi1_vector
OVI1 interrupt vector.
void * icid_vector
ICID interrupt vector.
void * ovi0_vector
OVI0 interrupt vector.
void * eri_vector
ERI interrupt vector.
void * irq1_vector
IRQ1 interrupt vector.
void * ocia_vector
OCIA interrupt vector.
void * cmi1a_vector
CMI1A interrupt vector.
void * rxi_vector
RXI interrupt vector.
void * cmi0b_vector
CMI0B interrupt vector.
void rom_dummy_handler()
address of an RTS instruction
void * txi_vector
TXI interrupt vector.
void * cmi1b_vector
CMI1B interrupt vector.
void * nmi_vector
NMI interrupt vector.
void * ocib_vector
OCIB interrupt vector.
void disable_irqs()
disable interrupt processing
Definition irq.h:98
void enable_irqs()
enable interrupt processing
Definition irq.h:103
void * cmi0a_vector
CMI0A interrupt vector.
void * wovf_vector
WOVF interrupt vector.
void * icic_vector
ICIC interrupt vector.
void * rom_reset_vector
ROM reset vector.
void * icia_vector
ICIA interrupt vector.
void rom_ocia_handler()
ROM OCIA interrupt handler.
void * irq2_vector
IRQ2 interrupt vector.