Files
pokediamond/include/nitro/os_system.h
T
2020-04-23 14:33:04 +02:00

45 lines
967 B
C

//
// Created by mart on 4/23/20.
//
#ifndef POKEDIAMOND_OS_SYSTEM_H
#define POKEDIAMOND_OS_SYSTEM_H
#include "consts.h"
typedef enum {
OS_PROCMODE_USER=16,
OS_PROCMODE_FIQ=17,
OS_PROCMODE_IRQ=18,
OS_PROCMODE_SVC=19,
OS_PROCMODE_ABORT=23,
OS_PROCMODE_UNDEF=27,
OS_PROCMODE_SYS=31
} OSProcMode;
typedef enum {
OS_INTRMODE_IRQ_DISABLE = HW_PSR_IRQ_DISABLE,
OS_INTRMODE_IRQ_ENABLE = 0
} OSIntrMode_Irq;
typedef enum {
OS_INTRMODE_FIQ_DISABLE = HW_PSR_FIQ_DISABLE,
OS_INTRMODE_FIQ_ENABLE = 0
} OSIntrMode_Fiq;
typedef union {
OSIntrMode_Fiq mode_fiq;
OSIntrMode_Irq mode_irq;
} OSIntrMode;
OSIntrMode OS_EnableInterrupts();
OSIntrMode OS_DisableInterrupts();
OSIntrMode OS_RestoreInterrupts(OSIntrMode state);
OSIntrMode OS_DisableInterrupts_IrqAndFiq();
OSIntrMode OS_RestoreInterrupts_IrqAndFiq(OSIntrMode state);
OSIntrMode_Irq OS_GetCpsrIrq();
OSProcMode OS_GetProcMode();
#endif //POKEDIAMOND_OS_SYSTEM_H