Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2002 13:59:11 -0500 (EST)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        freebsd-ppc@freebsd.org
Subject:   compiler problems?
Message-ID:  <15441.43775.191953.219307@grasshopper.cs.duke.edu>

next in thread | raw e-mail | index | archive | help

I'm getting interested in powerpc, so I was trying to follow Mark's
instructions (from Oct 18th) to build a ppc kernel.  I ran into the
following problems:

- compile error:

../../../kern/kern_fork.c: In function `fork_exit':
../../../kern/kern_fork.c:771: invalid lvalue in assignment

% cat -n kern_fork.c:
<..>
   769          sched_lock.mtx_recurse = 0;
   770          td->td_critnest = 1;
   771          td->td_savecrit = CRITICAL_FORK;
<..>

td->td_savecrit is a register_t, which works out to be an int.
How is that an invalid lvalue?  Is this a problem with the cross
compiler?  Is Mark's cross compiler port out of date?

I was feeling lucky, so I commented out that line and linked a kernel
When doing so, I got the second problem:

- multiply defined symbols for ddb_regs & bootverbose.  Trivial to
fix, patch appended.  I'd have committed it, but I don't want to cause
any mergework for people who might be working on something..

The resulting kernel traps in cpu_switch.  It looks like its deref'ing
a null pointer at line 97..   I guess this is as far as we are?  

Cheers,

Drew

Index: include/db_machdep.h
===================================================================
RCS file: /home/ncvs/src/sys/powerpc/include/db_machdep.h,v
retrieving revision 1.1
diff -u -r1.1 db_machdep.h
--- include/db_machdep.h	10 Jun 2001 02:39:28 -0000	1.1
+++ include/db_machdep.h	25 Jan 2002 18:08:30 -0000
@@ -47,7 +47,7 @@
 	u_int32_t	msr;
 };
 typedef struct powerpc_saved_state db_regs_t;
-db_regs_t	ddb_regs;		/* register state */
+extern db_regs_t	ddb_regs;	/* register state */
 #define	DDB_REGS	(&ddb_regs)
 
 #define	PC_REGS(regs)	((db_addr_t)(regs)->iar)
Index: powerpc/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/powerpc/powerpc/machdep.c,v
retrieving revision 1.17
diff -u -r1.17 machdep.c
--- powerpc/machdep.c	11 Dec 2001 23:33:43 -0000	1.17
+++ powerpc/machdep.c	25 Jan 2002 18:10:11 -0000
@@ -158,7 +158,7 @@
 
 struct msgbuf	*msgbufp = 0;
 
-int		bootverbose = 0, Maxmem = 0;
+int		Maxmem = 0;
 long		dumplo;
 
 vm_offset_t	phys_avail[10];

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ppc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15441.43775.191953.219307>