Move assembly files for functions that don't need decompiling, and added function headers to os headers so I can delete a couple I made

This commit is contained in:
Ryan Myers
2021-09-30 13:49:27 -04:00
parent 947593ae55
commit ed87ea82f0
29 changed files with 239 additions and 122 deletions
+36
View File
@@ -0,0 +1,36 @@
#ifndef _ULTRA64_OS_INTERNAL_H_
#define _ULTRA64_OS_INTERNAL_H_
/* Internal functions used by the operating system */
/* Do not include this header in application code */
#include "os_thread.h"
/* Variables */
extern u64 osClockRate;
/*
* CPU counter increments at 3/4 of bus clock rate:
*
* Bus Clock Proc Clock Counter (1/2 Proc Clock)
* --------- ---------- ------------------------
* 62.5 Mhz 93.75 Mhz 46.875 Mhz
*/
extern u64 osClockRate;
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL))
#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL))
#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL))
#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL))
/* Functions */
u32 __osProbeTLB(void *);
u32 __osDisableInt(void);
void __osRestoreInt(u32);
OSThread *__osGetCurrFaultedThread(void);
u32 osVirtualToPhysical(void *addr);
#endif
+114 -30
View File
@@ -1,35 +1,119 @@
#ifndef _ULTRA64_OS_INTERNAL_H_
#define _ULTRA64_OS_INTERNAL_H_
/**************************************************************************
* *
* Copyright (C) 1995, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
/* Internal functions used by the operating system */
/* Do not include this header in application code */
#include "os_thread.h"
/* Variables */
extern u64 osClockRate;
/*
* CPU counter increments at 3/4 of bus clock rate:
/**************************************************************************
*
* Bus Clock Proc Clock Counter (1/2 Proc Clock)
* --------- ---------- ------------------------
* 62.5 Mhz 93.75 Mhz 46.875 Mhz
*/
extern u64 osClockRate;
* $Revision: 1.18 $
* $Date: 1997/02/11 08:26:14 $
* $Source: /disk6/Master/cvsmdev2/PR/include/os_internal.h,v $
*
**************************************************************************/
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL))
#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL))
#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL))
#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL))
/* Functions */
u32 __osProbeTLB(void *);
u32 __osDisableInt(void);
void __osRestoreInt(u32);
OSThread *__osGetCurrFaultedThread(void);
#ifndef _OS_INTERNAL_H_
#define _OS_INTERNAL_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#include <PR/os_exception.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Routines to get/fetch coprocessor 0 registers */
extern u32 __osGetCause(void);
extern void __osSetCause(u32);
extern u32 __osGetCompare(void);
extern void __osSetCompare(u32);
extern u32 __osGetConfig(void);
extern void __osSetConfig(u32);
extern void __osSetCount(u32);
extern u32 __osGetSR(void);
extern void __osSetSR(u32);
extern u32 __osDisableInt(void);
extern void __osRestoreInt(u32);
/* Routines to get/set floating-point control and status register */
extern u32 __osSetFpcCsr(u32);
extern u32 __osGetFpcCsr(void);
/* Routine for HW interrupt "handler" */
extern void __osSetHWIntrRoutine(OSHWIntr, s32 (*handler)(void));
/* Routine for global interrupt mask */
extern void __osSetGlobalIntMask(OSHWIntr);
extern void __osResetGlobalIntMask(OSHWIntr);
/* Routine for global interrupt mask */
extern s32 __osLeoInterrupt(void);
/* Routines for fetch TLB info */
extern u32 __osGetTLBASID(void);
extern u32 __osGetTLBPageMask(s32);
extern u32 __osGetTLBHi(s32);
extern u32 __osGetTLBLo0(s32);
extern u32 __osGetTLBLo1(s32);
/* Serial interface (Si) */
extern u32 __osSiGetStatus(void);
extern s32 __osSiRawWriteIo(u32, u32);
extern s32 __osSiRawReadIo(u32, u32 *);
extern s32 __osSiRawStartDma(s32, void *);
/* Signal processor interface (Sp) */
extern u32 __osSpGetStatus(void);
extern void __osSpSetStatus(u32);
extern s32 __osSpSetPc(u32);
extern s32 __osSpRawWriteIo(u32, u32);
extern s32 __osSpRawReadIo(u32, u32 *);
extern s32 __osSpRawStartDma(s32, u32, void *, u32);
/* Error handling */
extern void __osError(s16, s16, ...);
extern OSThread * __osGetCurrFaultedThread(void);
extern OSThread * __osGetNextFaultedThread(OSThread *);
/* Development board functions */
extern void __osGIOInit(s32);
extern void __osGIOInterrupt(s32);
extern void __osGIORawInterrupt(s32);
/* For debugger use */
extern OSThread * __osGetActiveQueue(void);
/* Debug port */
extern void __osSyncPutChars(int, int, const char *);
extern int __osSyncGetChars(char *);
extern void __osAsyncPutChars(int, int, const char *);
extern int __osAsyncGetChars(char *);
extern int __osAtomicInc(unsigned int *p);
extern int __osAtomicDec(unsigned int *p);
/* routine for rdb port */
extern u32 __osRdbSend(u8 *buf, u32 size, u32 type);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_H */
+1
View File
@@ -32,5 +32,6 @@
#include <PR/libultra.h>
#include <PR/pfs.h>
#include <PR/rcp.h>
#include <PR/os.h>
#endif
@@ -1,3 +1,12 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D2560 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel __osDisableInt
/* 0D3160 800D2560 40086000 */ mfc0 $t0, $12
/* 0D3164 800D2564 2401FFFE */ li $at, -2
@@ -7,4 +16,3 @@ glabel __osDisableInt
/* 0D3174 800D2574 00000000 */ nop
/* 0D3178 800D2578 03E00008 */ jr $ra
/* 0D317C 800D257C 00000000 */ nop
@@ -1,3 +1,12 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D2580 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel __osRestoreInt
/* 0D3180 800D2580 40086000 */ mfc0 $t0, $12
/* 0D3184 800D2584 01044025 */ or $t0, $t0, $a0
@@ -7,4 +16,4 @@ glabel __osRestoreInt
/* 0D3194 800D2594 03E00008 */ jr $ra
/* 0D3198 800D2598 00000000 */ nop
/* 0D319C 800D259C 00000000 */ nop
/* 0D319C 800D259C 00000000 */ nop
+15
View File
@@ -0,0 +1,15 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D7460 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel __osSetCompare
/* 0D8060 800D7460 40845800 */ mtc0 $a0, $11
/* 0D8064 800D7464 03E00008 */ jr $ra
/* 0D8068 800D7468 00000000 */ nop
/* 0D806C 800D746C 00000000 */ nop
@@ -1,3 +1,12 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D04E0 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel bzero
/* 0D10E0 800D04E0 28A1000C */ slti $at, $a1, 0xc
/* 0D10E4 800D04E4 1420001D */ bnez $at, .L800D055C
@@ -1,7 +0,0 @@
glabel osGetCount
/* 0C84D0 800C78D0 40024800 */ mfc0 $v0, $9
/* 0C84D4 800C78D4 03E00008 */ jr $ra
/* 0C84D8 800C78D8 00000000 */ nop
/* 0C84DC 800C78DC 00000000 */ nop
@@ -1,6 +0,0 @@
glabel __osSetCompare
/* 0D8060 800D7460 40845800 */ mtc0 $a0, $11
/* 0D8064 800D7464 03E00008 */ jr $ra
/* 0D8068 800D7468 00000000 */ nop
/* 0D806C 800D746C 00000000 */ nop
+16
View File
@@ -0,0 +1,16 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800C78D0 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel osGetCount
/* 0C84D0 800C78D0 40024800 */ mfc0 $v0, $9
/* 0C84D4 800C78D4 03E00008 */ jr $ra
/* 0C84D8 800C78D8 00000000 */ nop
/* 0C84DC 800C78DC 00000000 */ nop
@@ -1,3 +1,12 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D17F0 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel osInvalDCache
/* 0D23F0 800D17F0 18A0001F */ blez $a1, .L800D1870
/* 0D23F4 800D17F4 00000000 */ nop
@@ -1,3 +1,12 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800C9A30 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel osSetIntMask
/* 0CA630 800C9A30 400C6000 */ mfc0 $t4, $12
/* 0CA634 800C9A34 3182FF01 */ andi $v0, $t4, 0xff01
@@ -1,3 +1,12 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D18A0 */
.include "macros.inc"
.set noat # allow manual use of $at
.set noreorder # dont insert nops after branches
.set gp=64 # 64-bit instructions are used
glabel osWritebackDCacheAll
/* 0D24A0 800D18A0 3C088000 */ lui $t0, 0x8000
/* 0D24A4 800D18A4 240A2000 */ li $t2, 8192
-1
View File
@@ -5,7 +5,6 @@
#include "macros.h"
#include "libultra_internal.h"
#include "audio_internal.h"
#include "../../os/osVirtualToPhysical.h"
/************ .data ************/
-8
View File
@@ -1,8 +0,0 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D7460 */
#include "macros.h"
//Unlikely to ever be able to be decompiled
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSetCompare.s")
-8
View File
@@ -1,8 +0,0 @@
#ifndef _OSSPSETSTATUS_H_
#define _OSSPSETSTATUS_H_
#include "types.h"
void __osSpSetStatus(u32 status);
#endif
-8
View File
@@ -1,8 +0,0 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D04E0 */
#include "types.h"
#include "macros.h"
//Likely hand written and not intended to decomp
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D10E0/bzero.s")
+1 -3
View File
@@ -2,9 +2,7 @@
/* RAM_POS: 0x800C8D70 */
#include "types.h"
#include <PR/os_internal.h>
#include <PR/rcp.h>
#include "osVirtualToPhysical.h"
#include "libultra_internal.h"
u8 hdwrBugFlag = 0;
-1
View File
@@ -2,7 +2,6 @@
/* RAM_POS: 0x800D18E0 */
#include "libultra_internal.h"
#include "osVirtualToPhysical.h"
s32 __osDpDeviceBusy(void);
s32 osDpSetNextBuffer(void *bufPtr, u64 size) {
-1
View File
@@ -3,7 +3,6 @@
#include "libultra_internal.h"
#include "PR/rcp.h"
#include "osVirtualToPhysical.h"
s32 osEPiRawStartDma(OSPiHandle *pihandle, s32 dir, u32 cart_addr, void *dram_addr, u32 size) {
register int status;

Some files were not shown because too many files have changed in this diff Show More