port: make it link and load

nothing happens after loading though
This commit is contained in:
fgsfds committed 2023-07-29 23:21:35 +02:00
1 parent c55f9c805c
commit da94644c38
68 files changed
+8291 -163

No files matched your search

+20
View File
@@ -60,6 +60,8 @@
#else /* _LANGUAGE_C */
#ifdef PLATFORM_N64
#define K0_TO_K1(x) ((u32)(x)|0xA0000000) /* kseg0 to kseg1 */
#define K1_TO_K0(x) ((u32)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */
#define K0_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg0 to physical */
@@ -68,6 +70,24 @@
#define PHYS_TO_K0(x) ((u32)(x)|0x80000000) /* physical to kseg0 */
#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */
#else /* PLATFORM_N64 */
#ifdef PLATFORM_64BIT
typedef u64 k_ptr_t;
#else
typedef u32 k_ptr_t;
#endif
#define K0_TO_K1(x) ((k_ptr_t)(x)) /* kseg0 to kseg1 */
#define K1_TO_K0(x) ((k_ptr_t)(x)) /* kseg1 to kseg0 */
#define K0_TO_PHYS(x) ((k_ptr_t)(x)) /* kseg0 to physical */
#define K1_TO_PHYS(x) ((k_ptr_t)(x)) /* kseg1 to physical */
#define KDM_TO_PHYS(x) ((k_ptr_t)(x)) /* direct mapped to physical */
#define PHYS_TO_K0(x) ((k_ptr_t)(x)) /* physical to kseg0 */
#define PHYS_TO_K1(x) ((k_ptr_t)(x)) /* physical to kseg1 */
#endif /* PLATFORM_N64 */
#endif /* _LANGUAGE_ASSEMBLY */
/*
+7 -2
View File
@@ -70,12 +70,17 @@ extern "C" {
#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))
#ifdef PLATFORM_N64
#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000))
#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000))
#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000))
#define OS_PHYSICAL_TO_K1(x) (void *)(((u32)(x)+0xa0000000))
#else
#define OS_K0_TO_PHYSICAL(x) (uintptr_t)(x)
#define OS_K1_TO_PHYSICAL(x) (uintptr_t)(x)
#define OS_PHYSICAL_TO_K0(x) (void *)(x)
#define OS_PHYSICAL_TO_K1(x) (void *)(x)
#endif
/**************************************************************************
*