Subject: building NetBSD/pc532 -current
To: None <port-pc532@netbsd.org>
From: Phil Budne <phil@ultimate.com>
List: port-pc532
Date: 12/21/1998 16:11:42
I was feeling a little chilly, so I powered up my pc532 (after
attaching a Pentium CPU fan to the CPU tp keep it cool clocking it up
to 30MHz). I decided to try to make the world based on a sup done last
friday.  I've never had much luck in this department, but I'm happy to
report only two problems so far;

named defines T_SLAVE for a parser token, but the inclusion of
sys/param.h brings in the pc532 trap.h which also has a T_SLAVE
define.  I just added an #undef T_SLAVE after the param.h include to
get the make going again.

The other was that the pc532 ld.aout_so md.c generated warnings that
killed the compilation.  Enclosed are diffs for the necessary changes.

What's the current word on using egcs to build stuff (esp. the
kernel)?  I've been using the gcc version 2.7.2.2+myc1 that came with
the 1.3 binaries.


*** md.c.0	Fri Dec 18 07:15:25 1998
--- md.c	Sun Dec 20 11:17:41 1998
***************
*** 44,49 ****
--- 44,50 ----
  #include <a.out.h>
  #include <stab.h>
  #include <string.h>
+ #include <err.h>
  
  #include "ld.h"
  #ifndef RTLD
***************
*** 55,64 ****
   * Put little endian VAL of size N at ADDR
   */
  static void
! put_num(addr, val, n)
! 	unsigned char	*addr;
! 	long		val;
! 	char		n;
  {
  	while (n--) {
  		*addr++ = val;
--- 56,62 ----
   * Put little endian VAL of size N at ADDR
   */
  static void
! put_num(unsigned char *addr, long val, char n)
  {
  	while (n--) {
  		*addr++ = val;
***************
*** 70,78 ****
   * Get little endian of size N at ADDR
   */
  static unsigned long
! get_num(addr, n)
! 	unsigned char	*addr;
! 	int		n;
  {
  	int val = 0;
  
--- 68,74 ----
   * Get little endian of size N at ADDR
   */
  static unsigned long
! get_num(unsigned char *addr, int n)
  {
  	int val = 0;
  
***************
*** 87,96 ****
   * Put big endian VAL of size N at ADDR
   */
  static void
! put_imm(addr, val, n)
! 	unsigned char	*addr;
! 	unsigned long	val;
! 	char    	n;
  {
  	addr += (n - 1);
  	while (n--) {
--- 83,89 ----
   * Put big endian VAL of size N at ADDR
   */
  static void
! put_imm(unsigned char *addr, unsigned long val, char n)
  {
  	addr += (n - 1);
  	while (n--) {
***************
*** 103,111 ****
   * Get big endian of size N at ADDR
   */
  static unsigned long
! get_imm(addr, n)
! 	unsigned char	*addr;
! 	int 		n;
  {
  	int val = 0;
  
--- 96,102 ----
   * Get big endian of size N at ADDR
   */
  static unsigned long
! get_imm(unsigned char *addr, int n)
  {
  	int val = 0;
  
***************
*** 127,134 ****
   * Signextend VAL from bit N
   */
  static long
! sign_extend(val, n)
! 	int	val, n;
  {
  	val = val & ((1 << n) - 1);
  	return (val & (1 << (n - 1))?
--- 118,124 ----
   * Signextend VAL from bit N
   */
  static long
! sign_extend(int val, int n)
  {
  	val = val & ((1 << n) - 1);
  	return (val & (1 << (n - 1))?
***************
*** 142,162 ****
   * Put ns32k displacement VAL of size N at ADDR
   */
  static void
! put_disp(addr, val, n)
! 	unsigned char	*addr;
! 	long		val;
! 	char		n;
  {
  	switch (n) {
  	case 1:
  		if (val < -64 || val > 63)
! 			warnx("Byte displacement %d, out of range.", val);
  		val &= 0x7f;
  		*addr++ = val;
  		break;
  	case 2:
  		if (val < -8192 || val > 8191)
! 			warnx("Word displacement %d, out of range.", val);
  		val &= 0x3fff;
  		val |= 0x8000;
  		*addr++ = (val >> 8);
--- 132,149 ----
   * Put ns32k displacement VAL of size N at ADDR
   */
  static void
! put_disp( unsigned char *addr, long val, char n)
  {
  	switch (n) {
  	case 1:
  		if (val < -64 || val > 63)
! 			warnx("Byte displacement %ld, out of range.", val);
  		val &= 0x7f;
  		*addr++ = val;
  		break;
  	case 2:
  		if (val < -8192 || val > 8191)
! 			warnx("Word displacement %ld, out of range.", val);
  		val &= 0x3fff;
  		val |= 0x8000;
  		*addr++ = (val >> 8);
***************
*** 168,174 ****
  #else
  		if (val < -0x20000000 || val >= 0x20000000)
  #endif
! 			warnx("Double word displacement %d, out of range", val);
  		val |= 0xc0000000;
  		*addr++ = (val >> 24);
  		*addr++ = (val >> 16);
--- 155,161 ----
  #else
  		if (val < -0x20000000 || val >= 0x20000000)
  #endif
! 			warnx("Double word displacement %ld, out of range", val);
  		val |= 0xc0000000;
  		*addr++ = (val >> 24);
  		*addr++ = (val >> 16);
***************
*** 184,192 ****
   * Get ns32k displacement size N at ADDR
   */
  static unsigned long
! get_disp(addr, n)
! 	unsigned char	*addr;
! 	int		n;
  {
  	unsigned long Ivalue;
  
--- 171,177 ----
   * Get ns32k displacement size N at ADDR
   */
  static unsigned long
! get_disp( unsigned char	*addr, int n)
  {
  	unsigned long Ivalue;
  
***************
*** 240,245 ****
--- 225,231 ----
  	case 2:
  		return get_num(addr, bytes);
  	}
+ 	return 0;			/* XXX ??? plb */
  }
  
  /*