Subject: XEN2_DOM0 doesn't build on i386-current
To: None <current-users@netbsd.org>
From: Hisashi T Fujinaka <htodd@twofifty.com>
List: current-users
Date: 03/04/2007 17:23:37
I hope this diff is correct:


Index: bios32.c
===================================================================
RCS file: /home/cvs/netbsd/src/sys/arch/xen/i386/bios32.c,v
retrieving revision 1.2
diff -u -r1.2 bios32.c
--- bios32.c	4 Mar 2007 06:01:09 -0000	1.2
+++ bios32.c	5 Mar 2007 01:22:25 -0000
@@ -125,12 +125,12 @@
  bios32_init()
  {
  	paddr_t entry = 0;
-	void *p;
+	char *p;
  	unsigned char cksum;
  	int i;

-	for (p = (void *)ISA_HOLE_VADDR(BIOS32_START);
-	     p < (void *)ISA_HOLE_VADDR(BIOS32_END);
+	for (p = (char *)ISA_HOLE_VADDR(BIOS32_START);
+	     p < (char *)ISA_HOLE_VADDR(BIOS32_END);
  	     p += 16) {
  		if (*(int *)p != BIOS32_MAKESIG('_', '3', '2', '_'))
  			continue;
@@ -165,7 +165,7 @@
  #if NIPMI > 0
  	/* see if we have SMBIOS extentions */
  	for (p = ISA_HOLE_VADDR(SMBIOS_START);
-	    p < (void *)ISA_HOLE_VADDR(SMBIOS_END); p+= 16) {
+	    p < (char *)ISA_HOLE_VADDR(SMBIOS_END); p+= 16) {
  		struct smbhdr * sh = (struct smbhdr *)p;
  		u_int8_t chksum;
  		vaddr_t eva;
Index: machdep.c
===================================================================
RCS file: /home/cvs/netbsd/src/sys/arch/xen/i386/machdep.c,v
retrieving revision 1.36
diff -u -r1.36 machdep.c
--- machdep.c	4 Mar 2007 06:01:10 -0000	1.36
+++ machdep.c	5 Mar 2007 01:22:25 -0000
@@ -376,7 +376,7 @@
  	cpu_info_primary.ci_curpcb = pcb = &lwp0.l_addr->u_pcb;

  	pcb->pcb_tss.tss_ioopt =
-	    ((void *)pcb->pcb_iomap - (void *)&pcb->pcb_tss) << 16
+	    ((char *)pcb->pcb_iomap - (char *)&pcb->pcb_tss) << 16
  		| SEL_KPL;		/* i/o pl */

  	for (x = 0; x < sizeof(pcb->pcb_iomap) / 4; x++)
@@ -412,7 +412,7 @@
  	struct pcb *pcb = ci->ci_idle_pcb;

  	pcb->pcb_tss.tss_ioopt =
-	    ((void *)pcb->pcb_iomap - (void *)&pcb->pcb_tss) << 16
+	    ((char *)pcb->pcb_iomap - (char *)&pcb->pcb_tss) << 16
  		| SEL_KPL;		/* i/o pl */
  	for (x = 0; x < sizeof(pcb->pcb_iomap) / 4; x++)
  		pcb->pcb_iomap[x] = 0xffffffff;
Index: pmap.c
===================================================================
RCS file: /home/cvs/netbsd/src/sys/arch/xen/i386/pmap.c,v
retrieving revision 1.25
diff -u -r1.25 pmap.c
--- pmap.c	4 Mar 2007 06:01:10 -0000	1.25
+++ pmap.c	5 Mar 2007 01:22:25 -0000
@@ -449,7 +449,7 @@

  #ifdef MULTIPROCESSOR
  #define PTESLEW(pte, id) ((pte)+(id)*NPTECL)
-#define VASLEW(va,id) ((va)+(id)*NPTECL*PAGE_SIZE)
+#define VASLEW(va,id) ((char *)(va)+(id)*NPTECL*PAGE_SIZE)
  #else
  #define PTESLEW(pte, id) (pte)
  #define VASLEW(va,id) (va)
@@ -459,7 +459,7 @@
   * special VAs and the PTEs that map them
   */
  static pt_entry_t *csrc_pte, *cdst_pte, *zero_pte, *ptp_pte;
-static void *csrcp, cdstp, zerop, ptpp;
+static void *csrcp, *cdstp, *zerop, *ptpp;

  /*
   * pool and cache that PDPs are allocated from
@@ -1182,13 +1182,13 @@
  	 * as well; we could waste less space if we knew the largest
  	 * CPU ID beforehand.
  	 */
-	csrcp = (void *) virtual_avail;  csrc_pte = pte;
+	csrcp = (char *) virtual_avail;  csrc_pte = pte;

-	cdstp = (void *) virtual_avail+PAGE_SIZE;  cdst_pte = pte+1;
+	cdstp = (char *) virtual_avail+PAGE_SIZE;  cdst_pte = pte+1;

-	zerop = (void *) virtual_avail+PAGE_SIZE*2;  zero_pte = pte+2;
+	zerop = (char *) virtual_avail+PAGE_SIZE*2;  zero_pte = pte+2;

-	ptpp = (void *) virtual_avail+PAGE_SIZE*3;  ptp_pte = pte+3;
+	ptpp = (char *) virtual_avail+PAGE_SIZE*3;  ptp_pte = pte+3;

  	virtual_avail += PAGE_SIZE * X86_MAXPROCS * NPTECL;
  	pte += X86_MAXPROCS * NPTECL;

-- 
Hisashi T Fujinaka - htodd@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte