Improve consistency between <sys/bswap.h> and what's actually

defined by the C library for the various m68k ports by borrowing
some #ifs from the i386 port.

Also, align sun2 with the other m68k ports as to whether they
define __bswap{16,32} or bswap{16,32} in their C library (all
now define the __ variants).

This should make the m68k ports build sys/rump again, except
for sun2 which hits another problem later on.
This commit is contained in:
he 2007-09-19 20:31:34 +00:00
parent 6a20fc2b13
commit 2a0ce8a57f
3 changed files with 14 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bswap16.S,v 1.1 2005/12/20 19:28:49 christos Exp $ */
/* $NetBSD: bswap16.S,v 1.2 2007/09/19 20:31:34 he Exp $ */
/*
* Copyright (C) 1996 Scott Reynolds. All rights reserved.
@ -28,7 +28,11 @@
#include <machine/asm.h>
ENTRY(bswap16)
#if defined(_KERNEL) || defined(_STANDALONE)
_ENTRY(_C_LABEL(bswap16))
#else /* defined(_KERNEL) || defined(_STANDALONE) */
_ENTRY(_C_LABEL(__bswap16))
#endif /* defined(_KERNEL) || defined(_STANDALONE) */
movl %sp@(4),%d0
rolw #8,%d0
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: bswap32.S,v 1.1 2005/12/20 19:28:49 christos Exp $ */
/* $NetBSD: bswap32.S,v 1.2 2007/09/19 20:31:34 he Exp $ */
/*
* Copyright (C) 1996 Scott Reynolds. All rights reserved.
@ -28,7 +28,11 @@
#include <machine/asm.h>
ENTRY(bswap32)
#if defined(_KERNEL) || defined(_STANDALONE)
_ENTRY(_C_LABEL(bswap32))
#else /* defined(_KERNEL) || defined(_STANDALONE) */
_ENTRY(_C_LABEL(__bswap32))
#endif /* defined(_KERNEL) || defined(_STANDALONE) */
movl %sp@(4),%d0
rolw #8,%d0
swap %d0

View File

@ -1,8 +1,9 @@
/* $NetBSD: bswap.h,v 1.1 2001/04/06 13:13:02 fredette Exp $ */
/* $NetBSD: bswap.h,v 1.2 2007/09/19 20:31:34 he Exp $ */
#ifndef _MACHINE_BSWAP_H_
#define _MACHINE_BSWAP_H_
#define __BSWAP_RENAME
#include <sys/bswap.h>
#endif /* !_MACHINE_BSWAP_H_ */