move first file to src in NitroSDK

This commit is contained in:
Seth Barberee
2026-05-06 08:50:26 -07:00
parent bc956fa51e
commit ea23a1a42f
7 changed files with 55 additions and 8 deletions

View File

@@ -2,5 +2,6 @@
#define NITRO_H_
#include <nitro/types.h>
#include <nitro/os.h>
#endif //NITRO_H_

47
lib/include/nitro/os.h Normal file
View File

@@ -0,0 +1,47 @@
#ifndef NITRO_OS_H_
#define NITRO_OS_H_
//#include <nitro/os/context.h>
#include <nitro/os/system.h>
//#include <nitro/os/systemWork.h>
//#include <nitro/os/thread.h>
//#include <nitro/os/mutex.h>
//#include <nitro/os/interrupt.h>
//#include <nitro/os/systemCall.h>
//#include <nitro/os/spinLock.h>
//#include <nitro/os/printf.h>
//#include <nitro/os/init.h>
//#include <nitro/os/exception.h>
//#include <nitro/os/valarm.h>
//#include <nitro/os/emulator.h>
//#include <nitro/os/tick.h>
//#include <nitro/os/alarm.h>
//#include <nitro/os/ownerInfo.h>
//#include <nitro/os/context.h>
//#include <nitro/os/system.h>
//#include <nitro/os/systemWork.h>
//#include <nitro/os/thread.h>
//#include <nitro/os/mutex.h>
//#include <nitro/os/interrupt.h>
//#include <nitro/os/systemCall.h>
//#include <nitro/os/spinLock.h>
//#include <nitro/os/printf.h>
//#include <nitro/os/init.h>
//#include <nitro/os/exception.h>
//#include <nitro/os/valarm.h>
//#include <nitro/os/emulator.h>
//#include <nitro/os/tick.h>
//#include <nitro/os/alarm.h>
//#include <nitro/os/common/entropy.h>
//#include <nitro/os/irqHandler.h>
//#ifdef SDK_ARM9
//#include <nitro/os/cache.h>
//#include <nitro/os/protectionRegion.h>
//#include <nitro/os/protectionUnit.h>
//#include <nitro/os/tcm.h>
//#include <nitro/os/ARM9/vramExclusive.h>
//#endif //SDK_ARM9
#endif //NITRO_OS_H_

View File

@@ -0,0 +1,29 @@
#ifndef NITRO_OS_SYSTEM_H_
#define NITRO_OS_SYSTEM_H_
// Enables processor interrupts by clearing the i flag in the program status register (cpsr).
// return: Old value of cpsr & 0x80 (0x80 if interrupts were disabled, 0x0 if they were already enabled)
u8 ClearIrqFlag();
// Disables processor interrupts by setting the i flag in the program status register (cpsr).
// return: Old value of cpsr & 0x80 (0x80 if interrupts were already disabled, 0x0 if they were enabled)
u8 EnableIrqFlag();
// Sets the value of the processor's interrupt flag according to the specified parameter.
// flag: Value to set the flag to (0x80 to set it, which disables interrupts; 0x0 to unset it, which enables interrupts)
// return: Old value of cpsr & 0x80 (0x80 if interrupts were disabled, 0x0 if they were enabled)
u8 SetIrqFlag(u8 flag);
// Disables processor all interrupts (both standard and fast) by setting the i and f flags in the program status register (cpsr).
// return: Old value of cpsr & 0xC0 (contains the previous values of the i and f flags)
u8 EnableIrqFiqFlags(void);
// Sets the value of the processor's interrupt flags (i and f) according to the specified parameter.
// flags: Value to set the flags to (0xC0 to set both flags, 0x80 to set the i flag and clear the f flag, 0x40 to set the f flag and clear the i flag and 0x0 to clear both flags)
// return: Old value of cpsr & 0xC0 (contains the previous values of the i and f flags)
u8 SetIrqFiqFlags(u8 flags);
// Gets the current value of the processor's interrupt request (i) flag
// return: cpsr & 0x80 (0x80 if interrupts are disabled, 0x0 if they are enabled)
u8 GetIrqFlag();
// Gets the processor's current operating mode.
// See https://problemkaputt.de/gbatek.htm#armcpuflagsconditionfieldcond
// return: cpsr & 0x1f (the cpsr mode bits M4-M0)
u8 GetProcessorMode();
#endif //NITRO_OS_SYSTEM_H_