mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-16 12:45:11 -04:00
sys_ucode OK (#432)
* sys_ucode OK * Update file split of data * Format * Name symbols, sizes -> u32 * Correct undefined_syms * Format
This commit is contained in:
+22
-4
@@ -1,9 +1,27 @@
|
||||
/*
|
||||
* File: sys_ucode.c
|
||||
* Description: Functions for obtaining locations and sizes of microcode
|
||||
*/
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBoot.s")
|
||||
extern u64 rspbootTextStart[];
|
||||
extern u64 rspbootTextEnd[];
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBootSize.s")
|
||||
u64* initialgspUcodeText = gspF3DEX2_NoN_fifoTextStart;
|
||||
u64* initialgspUcodeData = gspF3DEX2_NoN_fifoDataStart;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCode.s")
|
||||
u64* SysUcode_GetUCodeBoot(void) {
|
||||
return rspbootTextStart;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeData.s")
|
||||
size_t SysUcode_GetUCodeBootSize(void) {
|
||||
return (uintptr_t)rspbootTextEnd - (uintptr_t)rspbootTextStart;
|
||||
}
|
||||
|
||||
u64* SysUcode_GetUCode(void) {
|
||||
return initialgspUcodeText;
|
||||
}
|
||||
|
||||
u64* SysUcode_GetUCodeData(void) {
|
||||
return initialgspUcodeData;
|
||||
}
|
||||
|
||||
+10
-16
@@ -32,29 +32,23 @@ void osSpTaskLoad(OSTask* intp) {
|
||||
intp->t.flags &= ~OS_TASK_YIELDED;
|
||||
|
||||
if (tp->t.flags & OS_TASK_LOADABLE) {
|
||||
tp->t.ucode = HW_REG((u32)intp->t.yieldDataPtr + OS_YIELD_DATA_SIZE - 4, u32);
|
||||
tp->t.ucode = HW_REG((uintptr_t)intp->t.yieldDataPtr + OS_YIELD_DATA_SIZE - 4, u32);
|
||||
}
|
||||
}
|
||||
osWritebackDCache(tp, sizeof(OSTask));
|
||||
__osSpSetStatus(SP_CLR_SIG0 | SP_CLR_SIG1 | SP_CLR_SIG2 | SP_SET_INTR_BREAK);
|
||||
|
||||
while (__osSpSetPc((void*)SP_IMEM_START) == -1) {
|
||||
;
|
||||
}
|
||||
while (__osSpRawStartDma(1, (void*)(SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {
|
||||
;
|
||||
}
|
||||
while (__osSpDeviceBusy()) {
|
||||
;
|
||||
}
|
||||
while (__osSpRawStartDma(1, (void*)SP_IMEM_START, tp->t.ucodeBoot, tp->t.ucodeBootSize) == -1) {
|
||||
;
|
||||
}
|
||||
while (__osSpSetPc((void*)SP_IMEM_START) == -1) {}
|
||||
|
||||
while (__osSpRawStartDma(1, (void*)(SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {}
|
||||
|
||||
while (__osSpDeviceBusy()) {}
|
||||
|
||||
while (__osSpRawStartDma(1, (void*)SP_IMEM_START, tp->t.ucodeBoot, tp->t.ucodeBootSize) == -1) {}
|
||||
}
|
||||
|
||||
void osSpTaskStartGo(OSTask* tp) {
|
||||
while (__osSpDeviceBusy()) {
|
||||
;
|
||||
}
|
||||
while (__osSpDeviceBusy()) {}
|
||||
|
||||
__osSpSetStatus(SP_SET_INTR_BREAK | SP_CLR_SSTEP | SP_CLR_BROKE | SP_CLR_HALT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user