00001 00006 /* 00007 * The contents of this file are subject to the Mozilla Public License 00008 * Version 1.0 (the "License"); you may not use this file except in 00009 * compliance with the License. You may obtain a copy of the License 00010 * at http://www.mozilla.org/MPL/ 00011 * 00012 * Software distributed under the License is distributed on an "AS IS" 00013 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00014 * the License for the specific language governing rights and 00015 * limitations under the License. 00016 * 00017 * The Original Code is legOS code, released October 17, 1999. 00018 * 00019 * The Initial Developer of the Original Code is Markus L. Noga. 00020 * Portions created by Markus L. Noga are Copyright (C) 1999 00021 * Markus L. Noga. All Rights Reserved. 00022 * 00023 * Contributor(s): Markus L. Noga <markus@noga.de> 00024 */ 00025 00026 #ifndef __rom_system_h__ 00027 #define __rom_system_h__ 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 #include <sys/irq.h> 00034 00036 // 00037 // Functions 00038 // 00040 00042 extern inline void power_off(void) 00043 { 00044 __asm__ __volatile__("\n\ 00045 push r6\n\ 00046 bset #7,@0xc4:8 ; software standby mode\n\ 00047 jsr @ power_off ; ROM call\n\ 00048 pop r6\n\ 00049 "); 00050 } 00051 00053 // instruction. 00054 extern inline void power_init(void) { 00055 __asm__ __volatile__("\n\ 00056 push r6\n\ 00057 jsr @ power_init ; ROM call\n\ 00058 bclr #7,@0xc4:8 ; disable software standby\n\ 00059 pop r6\n\ 00060 "); 00061 } 00062 00064 extern void reset(void) __attribute__((noreturn)); 00065 00067 extern inline void rom_reset(void) __attribute__((noreturn)); 00068 extern inline void rom_reset(void) { 00069 disable_irqs(); 00070 reset(); 00071 } 00072 00073 #ifdef __cplusplus 00074 } 00075 #endif 00076 00077 #endif // __rom_system_h__
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |