Index: sys/arch/playstation2/ee/sif.c =================================================================== RCS file: /cvsroot/src/sys/arch/playstation2/ee/sif.c,v retrieving revision 1.12 diff -u -p -r1.12 sif.c --- sys/arch/playstation2/ee/sif.c 16 Apr 2022 17:35:57 -0000 1.12 +++ sys/arch/playstation2/ee/sif.c 5 Nov 2023 19:50:30 -0000 @@ -34,6 +34,7 @@ __KERNEL_RCSID(0, "$NetBSD: sif.c,v 1.12 #include "debug_playstation2.h" +#include #include #include #include Index: sys/arch/playstation2/ee/timer.c =================================================================== RCS file: /cvsroot/src/sys/arch/playstation2/ee/timer.c,v retrieving revision 1.9 diff -u -p -r1.9 timer.c --- sys/arch/playstation2/ee/timer.c 5 Jun 2021 21:38:37 -0000 1.9 +++ sys/arch/playstation2/ee/timer.c 5 Nov 2023 19:50:30 -0000 @@ -34,6 +34,7 @@ __KERNEL_RCSID(0, "$NetBSD: timer.c,v 1. #include "debug_playstation2.h" +#include #include #include Index: sys/arch/playstation2/playstation2/bus_dma.c =================================================================== RCS file: /cvsroot/src/sys/arch/playstation2/playstation2/bus_dma.c,v retrieving revision 1.26 diff -u -p -r1.26 bus_dma.c --- sys/arch/playstation2/playstation2/bus_dma.c 26 Jul 2022 20:08:56 -0000 1.26 +++ sys/arch/playstation2/playstation2/bus_dma.c 8 Nov 2023 10:01:57 -0000 @@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v #include #include #include +#include #include @@ -483,12 +484,10 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_s bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags) { - extern paddr_t avail_start, avail_end; - return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary, segs, nsegs, rsegs, flags, - avail_start /*low*/, - avail_end - 1 /*high*/)); + pmap_limits.avail_start /*low*/, + pmap_limits.avail_end - 1 /*high*/)); } /* Index: sys/arch/playstation2/playstation2/interrupt.c =================================================================== RCS file: /cvsroot/src/sys/arch/playstation2/playstation2/interrupt.c,v retrieving revision 1.18 diff -u -p -r1.18 interrupt.c --- sys/arch/playstation2/playstation2/interrupt.c 6 Oct 2021 20:36:58 -0000 1.18 +++ sys/arch/playstation2/playstation2/interrupt.c 5 Nov 2023 19:50:30 -0000 @@ -150,6 +150,7 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s (void)splhigh(); } } +#if 0 void setsoft(int ipl) { @@ -165,6 +166,7 @@ setsoft(int ipl) /* kick one shot timer */ timer_one_shot(timer_map[ipl]); } +#endif /* * SPL support @@ -199,6 +201,7 @@ splraise(int npl) return (opl); } +#if 0 void splset(int npl) { @@ -217,6 +220,7 @@ spl0(void) splset(0); _spllower(0); } +#endif /* * SIF BIOS call of interrupt utility. Index: sys/arch/playstation2/playstation2/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/playstation2/playstation2/machdep.c,v retrieving revision 1.34 diff -u -p -r1.34 machdep.c --- sys/arch/playstation2/playstation2/machdep.c 16 Nov 2021 05:16:47 -0000 1.34 +++ sys/arch/playstation2/playstation2/machdep.c 5 Nov 2023 19:50:30 -0000 @@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #include +#include #include #ifdef DDB @@ -54,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include /* cntab access (cpu_reboot) */ #include +#include #include #include /* hardintr_init */ #include @@ -84,7 +86,7 @@ void mach_init(void) { extern char kernel_text[], edata[], end[]; - void *kernend; + char *kernend; struct pcb *pcb0; vaddr_t v; paddr_t start; @@ -118,7 +120,7 @@ mach_init(void) * Initialize locore-function vector. * Clear out the I and D caches. */ - mips_vector_init(); + mips_vector_init(NULL, false); /* * Load the rest of the available pages into the VM system. @@ -134,12 +136,10 @@ mach_init(void) mem_clusters[1].start = start; mem_clusters[1].size = size; /* load */ - printf("load memory %#lx, %#x\n", start, size); + printf("load memory %#x, %#lx\n", start, size); uvm_page_physload(atop(start), atop(start + size), atop(start), atop(start + size), VM_FREELIST_DEFAULT); - strcpy(cpu_model, "SONY PlayStation 2"); - /* * Initialize error message buffer (at end of core). */ @@ -153,12 +153,12 @@ mach_init(void) v = uvm_pageboot_alloc(USPACE); pcb0 = lwp_getpcb(&lwp0); - pcb0->pcb_context[11] = PSL_LOWIPL; /* SR */ + pcb0->pcb_context.val[_L_SR] = PSL_LOWIPL; /* SR */ #ifdef IPL_ICU_MASK pcb0->pcb_ppl = 0; #endif - lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1 + lwp0.l_md.md_utf = (struct trapframe *)(v + USPACE) - 1; } /* Index: sys/arch/playstation2/playstation2/locore_machdep.S =================================================================== RCS file: /cvsroot/src/sys/arch/playstation2/playstation2/locore_machdep.S,v retrieving revision 1.13 diff -u -p -r1.13 locore_machdep.S --- sys/arch/playstation2/playstation2/locore_machdep.S 3 Apr 2016 09:06:28 -0000 1.13 +++ sys/arch/playstation2/playstation2/locore_machdep.S 7 Nov 2023 21:19:58 -0000 @@ -32,6 +32,7 @@ #include #include +#define MIPS_KSEG0_START 0x80000000 #define D_STAT_REG 0xb000e010 #define I_MASK_REG 0xb000f010 @@ -127,19 +128,19 @@ LEAF_NOPROFILE(kloader_playstation2_boot /* * 1. load kernel image. */ - move t6, a1 # p -1: beqz t6, 3f - move t7, t6 - lw t6, 0(t7) # p = next - lw t0, 4(t7) # src - lw ta0, 8(t7) # dst - lw t2, 12(t7) # sz - addu t5, ta0, t2 # dst + sz + move ta2, a1 # p +1: beqz ta2, 3f + move ta3, ta2 + lw ta2, 0(ta3) # p = next + lw t0, 4(ta3) # src + lw ta0, 8(ta3) # dst + lw t2, 12(ta3) # sz + addu ta1, ta0, t2 # dst + sz 2: lw t3, 0(t0) # copy sw t3, 0(ta0) addiu ta0, ta0, 4 addiu t0, t0, 4 - bltu ta0, t5, 2b + bltu ta0, ta1, 2b nop b 1b nop