Subject: pkg/7362: emulators/pcemu doesn't run on m68k
To: None <gnats-bugs@gnats.netbsd.org>
From: Thomas Gerner <thomas@murmel.camelot.de>
List: netbsd-bugs
Date: 04/11/1999 23:08:54
>Number:         7362
>Category:       pkg
>Synopsis:       emulators/pcemu doesn't run on m68k
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 11 14:35:00 1999
>Last-Modified:
>Originator:     Thomas Gerner
>Organization:
	
>Release:        pcemu-1.01a
>Environment:
	
System: NetBSD wiesel.intern 1.3K NetBSD 1.3K (WIESEL) #1: Sat Mar 13 22:29:45 CET 1999 thomas@wiesel.intern:/usr/src/sys/arch/atari/compile/WIESEL atari


>Description:
	
	pcemu-1.01a is on m68k compiled for little endian because
	/usr/include/m68k/endian.h defines LITTLE_ENDIAN, which
	is used at pcemu1.01alpha/cpu.h.
>How-To-Repeat:
	
	Build pcemu on m68k and try to run DOS.
>Fix:
	
*** cpu.h~	Sun Apr 11 22:45:18 1999
--- cpu.h	Sun Apr 11 22:46:50 1999
***************
*** 113,125 ****
      format and back again. Obviously there is nothing to do for little-endian
      machines... */
  
! #if defined(LITTLE_ENDIAN)
  #   define ChangeE(x) (WORD)(x)
  #else
  #   define ChangeE(x) (WORD)(((x) << 8) | ((BYTE)((x) >> 8)))
  #endif
  
! #if defined(LITTLE_ENDIAN) && !defined(ALIGNED_ACCESS)
  #   define ReadWord(x) (*(x))
  #   define WriteWord(x,y) (*(x) = (y))
  #   define CopyWord(x,y) (*x = *y)
--- 113,125 ----
      format and back again. Obviously there is nothing to do for little-endian
      machines... */
  
! #if BYTE_ORDER == LITTLE_ENDIAN
  #   define ChangeE(x) (WORD)(x)
  #else
  #   define ChangeE(x) (WORD)(((x) << 8) | ((BYTE)((x) >> 8)))
  #endif
  
! #if BYTE_ORDER == LITTLE_ENDIAN && !defined(ALIGNED_ACCESS)
  #   define ReadWord(x) (*(x))
  #   define WriteWord(x,y) (*(x) = (y))
  #   define CopyWord(x,y) (*x = *y)
>Audit-Trail:
>Unformatted: