From owner-p4-projects Thu Oct 17 14:34: 2 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A16DD37B404; Thu, 17 Oct 2002 14:33:59 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F73037B401 for ; Thu, 17 Oct 2002 14:33:59 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4BE843E7B for ; Thu, 17 Oct 2002 14:33:58 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9HLXnmV088137 for ; Thu, 17 Oct 2002 14:33:49 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9HLXmq4088134 for perforce@freebsd.org; Thu, 17 Oct 2002 14:33:48 -0700 (PDT) Date: Thu, 17 Oct 2002 14:33:48 -0700 (PDT) Message-Id: <200210172133.g9HLXmq4088134@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett Subject: PERFORCE change 19495 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=19495 Change 19495 by jmallett@jmallett_luna on 2002/10/17 14:33:33 Add endian control at config(8) time, and add and implement its use in , to allow a platform (i.e. sgimips) to set the endianness without us having to duplicate stuff and have upward-inheritence of includes. Affected files ... .. //depot/projects/mips/sys/conf/options.mips#2 edit .. //depot/projects/mips/sys/mips/conf/GENERIC#3 edit .. //depot/projects/mips/sys/mips/include/endian.h#2 edit .. //depot/projects/mips/sys/mips/sgimips/endian.h#1 add Differences ... ==== //depot/projects/mips/sys/conf/options.mips#2 (text+ko) ==== @@ -4,3 +4,5 @@ R4400 opt_global.h SGI opt_platform.h + +_BYTE_ORDER opt_endian.h ==== //depot/projects/mips/sys/mips/conf/GENERIC#3 (text+ko) ==== @@ -16,3 +16,13 @@ # Hardware support device arcbios #ARCBIOS + +# Other options + +# One can configure MIPS to run as either endian... By default, +# the platform is expected to define which endian, however it can +# be overridden here. +# To tell the kernel the system is big endian: +#options _BYTE_ORDER=4321 +# Or that it's little endian: +#options _BYTE_ORDER=1234 ==== //depot/projects/mips/sys/mips/include/endian.h#2 (text+ko) ==== @@ -41,6 +41,10 @@ #include #include +#ifdef _KERNEL +#include "opt_endian.h" +#endif + /* * Define the order of 32-bit words in 64-bit words. */ @@ -55,7 +59,21 @@ #define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ #define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ -#define _BYTE_ORDER _BIG_ENDIAN +/* + * Pull in the platform-specific endian description. The byte order may have + * been specified in opt_endian.h, and the platform will respect that. We + * still include it as it could (for all we know) define other endian-related + * functionality, plus we may not be in the kernel. + */ +#include + +/* + * It must define _BYTE_ORDER. + */ +#ifndef _BYTE_ORDER +#error Your MIPS platform needs to define _BYTE_ORDER in +#endif + /* * Deprecated variants that don't have enough underscores to be useful in more To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message