system.h
Go to the documentation of this file.
1
6/*
7 * The contents of this file are subject to the Mozilla Public License
8 * Version 1.0 (the "License"); you may not use this file except in
9 * compliance with the License. You may obtain a copy of the License
10 * at http://www.mozilla.org/MPL/
11 *
12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 * the License for the specific language governing rights and
15 * limitations under the License.
16 *
17 * The Original Code is legOS code, released October 17, 1999.
18 *
19 * The Initial Developer of the Original Code is Markus L. Noga.
20 * Portions created by Markus L. Noga are Copyright (C) 1999
21 * Markus L. Noga. All Rights Reserved.
22 *
23 * Contributor(s): Markus L. Noga <markus@noga.de>
24 */
25
26#ifndef __rom_system_h__
27#define __rom_system_h__
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <sys/irq.h>
34
36//
37// Functions
38//
40
42extern inline void power_off(void)
43{
44 __asm__ __volatile__("\n\
45 push r6\n\
46 bset #7,@0xc4:8 ; software standby mode\n\
47 jsr @ power_off ; ROM call\n\
48 pop r6\n\
49");
50}
51
53// instruction.
54extern inline void power_init(void) {
55 __asm__ __volatile__("\n\
56 push r6\n\
57 jsr @ power_init ; ROM call\n\
58 bclr #7,@0xc4:8 ; disable software standby\n\
59 pop r6\n\
60");
61}
62
64extern void reset(void) __attribute__((noreturn));
65
67extern inline void rom_reset(void) __attribute__((noreturn));
68extern inline void rom_reset(void) {
70 reset();
71}
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif // __rom_system_h__
__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\ ")
Internal LNP Interface: RCX redirected IRQ vectors.
void disable_irqs()
disable interrupt processing
Definition irq.h:98
void power_init(void)
disables software standby mode so tm_idle_task() can use the sleep
Definition system.h:54
void rom_reset(void) __attribute__((noreturn))
turns off interrupts, then issues reset.
Definition system.h:68
void power_off(void)
enters software standby mode.
Definition system.h:42
void reset(void) __attribute__((noreturn))
erases BrickOS, returning control to ROM.

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.9.8