Module Name: src
Committed By: simonb
Date: Mon Aug 17 07:50:42 UTC 2020
Modified Files:
src/sys/arch/algor/algor: machdep.c
src/sys/arch/evbmips/alchemy: mtx-1.c omsal400.c
src/sys/arch/evbmips/atheros: machdep.c
src/sys/arch/evbmips/cavium: machdep.c
src/sys/arch/evbmips/gdium: machdep.c
src/sys/arch/evbmips/ingenic: machdep.c
src/sys/arch/evbmips/loongson: machdep.c
Log Message:
Add some compile time asserts for endianness on boards/systems that
only support a single endianness.
To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/algor/algor/machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/alchemy/mtx-1.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbmips/alchemy/omsal400.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbmips/atheros/machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/cavium/machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbmips/gdium/machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbmips/ingenic/machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbmips/loongson/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/algor/algor/machdep.c
diff -u src/sys/arch/algor/algor/machdep.c:1.56 src/sys/arch/algor/algor/machdep.c:1.57
--- src/sys/arch/algor/algor/machdep.c:1.56 Mon Aug 17 07:22:46 2020
+++ src/sys/arch/algor/algor/machdep.c Mon Aug 17 07:50:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.56 2020/08/17 07:22:46 mrg Exp $ */
+/* $NetBSD: machdep.c,v 1.57 2020/08/17 07:50:41 simonb Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.56 2020/08/17 07:22:46 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.57 2020/08/17 07:50:41 simonb Exp $");
#include "opt_algor_p4032.h"
#include "opt_algor_p5064.h"
@@ -164,6 +164,9 @@ void mach_init(int, char *[], char *[]);
int cpuspeed = 150; /* XXX XXX XXX */
+/* The ALGOR kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
void
mach_init(int argc, char *argv[], char *envp[])
{
Index: src/sys/arch/evbmips/alchemy/mtx-1.c
diff -u src/sys/arch/evbmips/alchemy/mtx-1.c:1.8 src/sys/arch/evbmips/alchemy/mtx-1.c:1.9
--- src/sys/arch/evbmips/alchemy/mtx-1.c:1.8 Tue Jun 9 22:49:55 2015
+++ src/sys/arch/evbmips/alchemy/mtx-1.c Mon Aug 17 07:50:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mtx-1.c,v 1.8 2015/06/09 22:49:55 matt Exp $ */
+/* $NetBSD: mtx-1.c,v 1.9 2020/08/17 07:50:41 simonb Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mtx-1.c,v 1.8 2015/06/09 22:49:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mtx-1.c,v 1.9 2020/08/17 07:50:41 simonb Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -72,6 +72,9 @@ static struct alchemy_board mtx1_info =
NULL, /* poweroff */
};
+/* The MTX-1 kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
const struct alchemy_board *
board_info(void)
{
Index: src/sys/arch/evbmips/alchemy/omsal400.c
diff -u src/sys/arch/evbmips/alchemy/omsal400.c:1.10 src/sys/arch/evbmips/alchemy/omsal400.c:1.11
--- src/sys/arch/evbmips/alchemy/omsal400.c:1.10 Tue Jun 9 22:49:55 2015
+++ src/sys/arch/evbmips/alchemy/omsal400.c Mon Aug 17 07:50:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: omsal400.c,v 1.10 2015/06/09 22:49:55 matt Exp $ */
+/* $NetBSD: omsal400.c,v 1.11 2020/08/17 07:50:41 simonb Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omsal400.c,v 1.10 2015/06/09 22:49:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omsal400.c,v 1.11 2020/08/17 07:50:41 simonb Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -93,6 +93,9 @@ static struct alchemy_board omsal400_inf
&omsal400_pcmcia,
};
+/* The OMS AL400 kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
const struct alchemy_board *
board_info(void)
{
Index: src/sys/arch/evbmips/atheros/machdep.c
diff -u src/sys/arch/evbmips/atheros/machdep.c:1.32 src/sys/arch/evbmips/atheros/machdep.c:1.33
--- src/sys/arch/evbmips/atheros/machdep.c:1.32 Wed Jul 22 01:24:39 2020
+++ src/sys/arch/evbmips/atheros/machdep.c Mon Aug 17 07:50:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.32 2020/07/22 01:24:39 msaitoh Exp $ */
+/* $NetBSD: machdep.c,v 1.33 2020/08/17 07:50:42 simonb Exp $ */
/*
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -110,7 +110,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.32 2020/07/22 01:24:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.33 2020/08/17 07:50:42 simonb Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -154,6 +154,9 @@ phys_ram_seg_t mem_clusters[VM_PHYSSEG_M
void mach_init(void); /* XXX */
+/* Currently the Atheros kernels only support big endian boards */
+CTASSERT(_BYTE_ORDER == _BIG_ENDIAN);
+
static void
cal_timer(void)
{
Index: src/sys/arch/evbmips/cavium/machdep.c
diff -u src/sys/arch/evbmips/cavium/machdep.c:1.22 src/sys/arch/evbmips/cavium/machdep.c:1.23
--- src/sys/arch/evbmips/cavium/machdep.c:1.22 Tue Jul 28 00:35:38 2020
+++ src/sys/arch/evbmips/cavium/machdep.c Mon Aug 17 07:50:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.22 2020/07/28 00:35:38 simonb Exp $ */
+/* $NetBSD: machdep.c,v 1.23 2020/08/17 07:50:42 simonb Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -114,7 +114,7 @@
#include "opt_multiprocessor.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.22 2020/07/28 00:35:38 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.23 2020/08/17 07:50:42 simonb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -188,6 +188,9 @@ struct octeon_btinfo octeon_btinfo;
char octeon_nmi_stack[PAGE_SIZE] __section(".data1") __aligned(PAGE_SIZE);
+/* Currently the OCTEON kernels only support big endian boards */
+CTASSERT(_BYTE_ORDER == _BIG_ENDIAN);
+
/*
* Do all the stuff that locore normally does before calling main().
*/
Index: src/sys/arch/evbmips/gdium/machdep.c
diff -u src/sys/arch/evbmips/gdium/machdep.c:1.20 src/sys/arch/evbmips/gdium/machdep.c:1.21
--- src/sys/arch/evbmips/gdium/machdep.c:1.20 Thu Dec 22 14:47:56 2016
+++ src/sys/arch/evbmips/gdium/machdep.c Mon Aug 17 07:50:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.20 2016/12/22 14:47:56 cherry Exp $ */
+/* $NetBSD: machdep.c,v 1.21 2020/08/17 07:50:42 simonb Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.20 2016/12/22 14:47:56 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.21 2020/08/17 07:50:42 simonb Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@@ -137,6 +137,9 @@ int mem_cluster_cnt;
void configure(void);
void mach_init(int, char **, char **, void *);
+/* The GDIUM kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
/*
* For some reason, PMON doesn't assign a real address to the Ralink's BAR.
* So we have to do it.
Index: src/sys/arch/evbmips/ingenic/machdep.c
diff -u src/sys/arch/evbmips/ingenic/machdep.c:1.15 src/sys/arch/evbmips/ingenic/machdep.c:1.16
--- src/sys/arch/evbmips/ingenic/machdep.c:1.15 Wed Jul 22 01:24:39 2020
+++ src/sys/arch/evbmips/ingenic/machdep.c Mon Aug 17 07:50:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.15 2020/07/22 01:24:39 msaitoh Exp $ */
+/* $NetBSD: machdep.c,v 1.16 2020/08/17 07:50:42 simonb Exp $ */
/*-
* Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.15 2020/07/22 01:24:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2020/08/17 07:50:42 simonb Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -86,6 +86,9 @@ void ingenic_com_cnattach(void);
kmutex_t ingenic_ipi_lock;
#endif
+/* Currently the Ingenic kernels (CI20) only support little endian boards */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
static void
cal_timer(void)
{
Index: src/sys/arch/evbmips/loongson/machdep.c
diff -u src/sys/arch/evbmips/loongson/machdep.c:1.7 src/sys/arch/evbmips/loongson/machdep.c:1.8
--- src/sys/arch/evbmips/loongson/machdep.c:1.7 Thu Dec 22 14:47:57 2016
+++ src/sys/arch/evbmips/loongson/machdep.c Mon Aug 17 07:50:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.7 2016/12/22 14:47:57 cherry Exp $ */
+/* $NetBSD: machdep.c,v 1.8 2020/08/17 07:50:42 simonb Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2016/12/22 14:47:57 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.8 2020/08/17 07:50:42 simonb Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@@ -242,6 +242,9 @@ struct consdev pmoncons = {
CN_DEAD
};
+/* The LOONGSON kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
/*
* Do all the stuff that locore normally does before calling main().
*/