Module Name: src
Committed By: andvar
Date: Thu Nov 23 20:40:08 UTC 2023
Modified Files:
src/sys/arch/playstation2/ee: timer.c
src/sys/arch/playstation2/playstation2: bus_dma.c machdep.c
Log Message:
Few more changes for playstation2 specific code to adapt to interface or method
declaration changes. Still long way before port code can be built though...
reviewed by martin.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/playstation2/ee/timer.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/playstation2/playstation2/bus_dma.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/playstation2/playstation2/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/playstation2/ee/timer.c
diff -u src/sys/arch/playstation2/ee/timer.c:1.9 src/sys/arch/playstation2/ee/timer.c:1.10
--- src/sys/arch/playstation2/ee/timer.c:1.9 Sat Jun 5 21:38:37 2021
+++ src/sys/arch/playstation2/ee/timer.c Thu Nov 23 20:40:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: timer.c,v 1.9 2021/06/05 21:38:37 christos Exp $ */
+/* $NetBSD: timer.c,v 1.10 2023/11/23 20:40:08 andvar Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,10 +30,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: timer.c,v 1.9 2021/06/05 21:38:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: timer.c,v 1.10 2023/11/23 20:40:08 andvar Exp $");
#include "debug_playstation2.h"
+#include <sys/intr.h>
#include <sys/param.h>
#include <sys/systm.h>
Index: src/sys/arch/playstation2/playstation2/bus_dma.c
diff -u src/sys/arch/playstation2/playstation2/bus_dma.c:1.26 src/sys/arch/playstation2/playstation2/bus_dma.c:1.27
--- src/sys/arch/playstation2/playstation2/bus_dma.c:1.26 Tue Jul 26 20:08:56 2022
+++ src/sys/arch/playstation2/playstation2/bus_dma.c Thu Nov 23 20:40:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.26 2022/07/26 20:08:56 andvar Exp $ */
+/* $NetBSD: bus_dma.c,v 1.27 2023/11/23 20:40:08 andvar Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,12 +31,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.26 2022/07/26 20:08:56 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.27 2023/11/23 20:40:08 andvar Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
+#include <sys/systm.h>
#include <mips/cache.h>
@@ -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: src/sys/arch/playstation2/playstation2/machdep.c
diff -u src/sys/arch/playstation2/playstation2/machdep.c:1.34 src/sys/arch/playstation2/playstation2/machdep.c:1.35
--- src/sys/arch/playstation2/playstation2/machdep.c:1.34 Tue Nov 16 05:16:47 2021
+++ src/sys/arch/playstation2/playstation2/machdep.c Thu Nov 23 20:40:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.34 2021/11/16 05:16:47 msaitoh Exp $ */
+/* $NetBSD: machdep.c,v 1.35 2023/11/23 20:40:08 andvar Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.34 2021/11/16 05:16:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2023/11/23 20:40:08 andvar Exp $");
#include "opt_ddb.h"
#include "opt_kloader.h"
@@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v
#include <sys/boot_flag.h>
#include <sys/device.h>
+#include <uvm/uvm.h>
#include <uvm/uvm_extern.h>
#ifdef DDB
@@ -54,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v
#include <dev/cons.h> /* cntab access (cpu_reboot) */
#include <machine/bootinfo.h>
+#include <machine/locore.h>
#include <machine/psl.h>
#include <machine/intr.h>/* hardintr_init */
#include <playstation2/playstation2/sifbios.h>
@@ -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;
}
/*