Date: Tue, 29 Aug 2006 13:38:08 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 105263 for review Message-ID: <200608291338.k7TDc8pZ003000@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105263 Change 105263 by gonzo@gonzo_hq on 2006/08/29 13:37:25 o Clean out Makefile.inc o Check endianess using build-in __MIPSEB__ macros instead of BYTE_ORDER. Affected files ... .. //depot/projects/mips2/src/lib/libc/mips/net/Makefile.inc#2 edit .. //depot/projects/mips2/src/lib/libc/mips/net/htonl.S#2 edit .. //depot/projects/mips2/src/lib/libc/mips/net/htons.S#2 edit .. //depot/projects/mips2/src/lib/libc/mips/net/ntohl.S#2 edit .. //depot/projects/mips2/src/lib/libc/mips/net/ntohs.S#2 edit Differences ... ==== //depot/projects/mips2/src/lib/libc/mips/net/Makefile.inc#2 (text+ko) ==== @@ -1,10 +1,4 @@ # $NetBSD: Makefile.inc,v 1.3 2003/08/01 17:03:51 lukem Exp $ +# $FreeBSD$ -# objects built from assembler sources (need lint stubs) -# hton* and nto* functions provided by ../gen/byte_swap_*.S -SRCS+= - -SRCS.mips.net= Lint_htonl.c Lint_htons.c Lint_ntohl.c Lint_ntohs.c -LSRCS+= ${SRCS.mips.net} -DPSRCS+= ${SRCS.mips.net} -CLEANFILES+= ${SRCS.mips.net} +SRCS+= htonl.S ntohl.S htons.S ntohs.S ==== //depot/projects/mips2/src/lib/libc/mips/net/htonl.S#2 (text+ko) ==== @@ -37,12 +37,13 @@ */ #include <machine/asm.h> -#include <machine/endian.h> __FBSDID("$FreeBSD: src/lib/libc/arm/net/htonl.S,v 1.1 2004/05/14 12:04:30 cognet Exp $"); LEAF(htonl) # a0 = 0x11223344, return 0x44332211 -#if BYTE_ORDER == LITTLE_ENDIAN +#ifdef __MIPSEB__ + move v0, a0 +#else srl v1, a0, 24 # v1 = 0x00000011 sll v0, a0, 24 # v0 = 0x44000000 or v0, v0, v1 @@ -52,8 +53,6 @@ srl v1, a0, 8 and v1, v1, 0xff00 # v1 = 0x00002200 or v0, v0, v1 -#else - move v0, a0 #endif j ra END(htonl) ==== //depot/projects/mips2/src/lib/libc/mips/net/htons.S#2 (text+ko) ==== @@ -37,19 +37,18 @@ */ #include <machine/asm.h> -#include <machine/endian.h> __FBSDID("$FreeBSD: src/lib/libc/arm/net/htons.S,v 1.1 2004/05/14 12:04:30 cognet Exp $"); LEAF(htons) -#if BYTE_ORDER == LITTLE_ENDIAN +#ifdef __MIPSEB__ + move v0, a0 +#else srl v0, a0, 8 and v0, v0, 0xff sll v1, a0, 8 and v1, v1, 0xff00 or v0, v0, v1 -#else - move v0, a0 #endif j ra END(htons) ==== //depot/projects/mips2/src/lib/libc/mips/net/ntohl.S#2 (text+ko) ==== @@ -37,12 +37,13 @@ */ #include <machine/asm.h> -#include <machine/endian.h> __FBSDID("$FreeBSD: src/lib/libc/arm/net/ntohl.S,v 1.1 2004/05/14 12:04:30 cognet Exp $"); LEAF(ntohl) # a0 = 0x11223344, return 0x44332211 -#if BYTE_ORDER == LITTLE_ENDIAN +#ifdef __MIPSEB__ + move v0, a0 +#else srl v1, a0, 24 # v1 = 0x00000011 sll v0, a0, 24 # v0 = 0x44000000 or v0, v0, v1 @@ -52,8 +53,6 @@ srl v1, a0, 8 and v1, v1, 0xff00 # v1 = 0x00002200 or v0, v0, v1 -#else - move v0, a0 #endif j ra END(ntohl) ==== //depot/projects/mips2/src/lib/libc/mips/net/ntohs.S#2 (text+ko) ==== @@ -37,19 +37,18 @@ */ #include <machine/asm.h> -#include <machine/endian.h> __FBSDID("$FreeBSD: src/lib/libc/arm/net/ntohs.S,v 1.1 2004/05/14 12:04:30 cognet Exp $"); LEAF(ntohs) -#if BYTE_ORDER == LITTLE_ENDIAN +#ifdef __MIPSEB__ + move v0, a0 +#else srl v0, a0, 8 and v0, v0, 0xff sll v1, a0, 8 and v1, v1, 0xff00 or v0, v0, v1 -#else - move v0, a0 #endif j ra END(ntohs)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608291338.k7TDc8pZ003000>