Make the M68K_MMU_* defines real kernel options, available in opt_m68k_arch.h.

For 68030, 68040, and 68060, infer M68K_MMU_MOTOROLA.  For 68010 and 68020, it
must be an explicit option (set in std.${MACHINE} or, in the case of hp300,
inferred from the specific model option).
This commit is contained in:
thorpej 2024-01-18 14:39:05 +00:00
parent 0b3a6287e5
commit 120d6a48ae
20 changed files with 67 additions and 97 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: std.amiga,v 1.22 2010/09/19 02:09:27 tsutsui Exp $
# $NetBSD: std.amiga,v 1.23 2024/01/18 14:39:05 thorpej Exp $
# standard amiga information
@ -6,6 +6,15 @@ machine amiga m68k
include "conf/std" # MI standard options
include "arch/m68k/conf/std.m68k" # m68k standard options
# All Amigas that NetBSD runs on have a Motorola MMU. For 68030, 68040,
# and 68060, this is inferred from the CPU. But if the kernel only includes
# support for 68020, we have to be explicit about it.
#
# XXX config(1) needs something like this:
#
# ifoption M68020: M68K_MMU_68851
options M68K_MMU_MOTOROLA
mainbus0 at root
clock0 at mainbus0

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.84 2024/01/09 04:16:23 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.85 2024/01/18 14:39:05 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -51,11 +51,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
/*
* Exported definitions unique to amiga/68k cpu support.
*/
#define M68K_MMU_MOTOROLA
extern volatile unsigned int interrupt_depth;
/*
* Arguments to hardclock and gatherstats encapsulate the previous

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.75 2024/01/09 04:16:23 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.76 2024/01/18 14:39:05 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -51,11 +51,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
/*
* Exported definitions unique to atari/68k cpu support.
*/
#define M68K_MMU_MOTOROLA
void cpu_proc_fork(struct proc *, struct proc *);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.35 2024/01/15 03:07:14 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.36 2024/01/18 14:39:05 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -43,7 +43,6 @@
#if defined(_KERNEL_OPT)
#include "opt_lockdebug.h"
#include "opt_m68k_arch.h"
#endif
/*
@ -102,14 +101,6 @@ struct clockframe {
extern int astpending; /* need to trap before returning to user mode */
#define aston() (astpending++)
#ifndef M68040
#define M68040
#endif /* ! M68040 */
#ifndef M68K_MMU_MOTOROLA
#define M68K_MMU_MOTOROLA
#endif /* ! M68K_MMU_MOTOROLA */
/* locore.s functions */
void doboot(void)
__attribute__((__noreturn__));

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.6 2024/01/09 04:08:33 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.7 2024/01/18 14:39:06 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -43,7 +43,6 @@
#if defined(_KERNEL_OPT)
#include "opt_lockdebug.h"
#include "opt_m68k_arch.h"
#endif
/*

View File

@ -1,4 +1,4 @@
# $NetBSD: files.hp300,v 1.96 2024/01/18 03:40:48 thorpej Exp $
# $NetBSD: files.hp300,v 1.97 2024/01/18 14:39:06 thorpej Exp $
#
# hp300-specific configuration info
@ -8,9 +8,9 @@ maxpartitions 8
maxusers 2 8 64
# SPU configuration options.
defflag opt_spuconf.h HP320: M68020
defflag opt_spuconf.h HP330: M68020
defflag opt_spuconf.h HP350: M68020
defflag opt_spuconf.h HP320: M68020, M68K_MMU_HP
defflag opt_spuconf.h HP330: M68020, M68K_MMU_68851
defflag opt_spuconf.h HP350: M68020, M68K_MMU_HP
defflag opt_spuconf.h HP340: M68030
defflag opt_spuconf.h HP345: M68030

View File

@ -1,4 +1,4 @@
/* $NetBSD: hp300spu.h,v 1.15 2024/01/18 03:40:48 thorpej Exp $ */
/* $NetBSD: hp300spu.h,v 1.16 2024/01/18 14:39:06 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -89,17 +89,6 @@ extern int mmuid; /* MMU id */
#include "opt_m68k_arch.h"
#endif
/*
* MMU configuration.
*/
#if defined(HP320) || defined(HP350)
#define M68K_MMU_HP
#endif
#if defined(HP330) || defined(M68030) || defined(M68040)
#define M68K_MMU_MOTOROLA
#endif
/*
* Cache configuration.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.40 2024/01/15 02:16:52 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.41 2024/01/18 14:39:06 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -51,9 +51,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
#define M68K_MMU_MOTOROLA
/*
* Arguments to hardclock and gatherstats encapsulate the previous
* machine state in an opaque clockframe. On the luna68k, we use

View File

@ -1,14 +1,25 @@
# $NetBSD: files.m68k,v 1.56 2024/01/18 05:42:29 thorpej Exp $
# $NetBSD: files.m68k,v 1.57 2024/01/18 14:39:06 thorpej Exp $
#
version 20240118 # mkflagvar
defflag opt_fpsp.h FPSP
defflag opt_m68k_arch.h M68K_MMU_HP
defflag opt_m68k_arch.h M68K_MMU_SUN
defflag opt_m68k_arch.h M68K_MMU_SUN2: M68K_MMU_SUN
defflag opt_m68k_arch.h M68K_MMU_SUN3: M68K_MMU_SUN
defflag opt_m68k_arch.h M68K_MMU_MOTOROLA
defflag opt_m68k_arch.h M68K_MMU_68851: M68K_MMU_MOTOROLA
defflag opt_m68k_arch.h M68K_MMU_68030: M68K_MMU_MOTOROLA
defflag opt_m68k_arch.h M68K_MMU_68040: M68K_MMU_MOTOROLA
defflag opt_m68k_arch.h M68K_MMU_68060: M68K_MMU_MOTOROLA
defflag opt_m68k_arch.h M68010
defflag opt_m68k_arch.h M68020
defflag opt_m68k_arch.h M68030
defflag opt_m68k_arch.h M68040
defflag opt_m68k_arch.h M68060
defflag opt_m68k_arch.h M68030: M68K_MMU_68030
defflag opt_m68k_arch.h M68040: M68K_MMU_68040
defflag opt_m68k_arch.h M68060: M68K_MMU_68060
# Emit Makefile vars for these kernel options so that compiler flags
# can be tuned for CPU support.

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.19 2024/01/03 12:46:12 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.20 2024/01/18 14:39:06 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -41,6 +41,10 @@
#ifndef _M68K_CPU_H_
#define _M68K_CPU_H_
#if defined(_KERNEL_OPT)
#include "opt_m68k_arch.h" /* XXX Should not do this here. */
#endif
/*
* Exported definitions common to Motorola m68k-based ports.
*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_motorola.c,v 1.87 2024/01/09 07:28:26 thorpej Exp $ */
/* $NetBSD: pmap_motorola.c,v 1.88 2024/01/18 14:39:06 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -120,7 +120,7 @@
#include "opt_m68k_arch.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.87 2024/01/09 07:28:26 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.88 2024/01/18 14:39:06 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -137,6 +137,10 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.87 2024/01/09 07:28:26 thorpej E
#include <m68k/cacheops.h>
#if !defined(M68K_MMU_MOTOROLA) && !defined(M68K_MMU_HP)
#error Hit the road, Jack...
#endif
#ifdef DEBUG
#define PDB_FOLLOW 0x0001
#define PDB_INIT 0x0002

View File

@ -1,4 +1,4 @@
# $NetBSD: std.mac68k,v 1.30 2010/09/19 02:09:28 tsutsui Exp $
# $NetBSD: std.mac68k,v 1.31 2024/01/18 14:39:06 thorpej Exp $
#
# "options" common to all mac68k kernel configs
@ -6,4 +6,13 @@ machine mac68k m68k
include "conf/std" # MI standard options
include "arch/m68k/conf/std.m68k" # m68k standard options
# All 68k Macs that NetBSD runs on have a Motorola MMU. For 68030 and 68040,
# this is inferred from the CPU. But if the kernel only includes support for
# 68020, we have to be explicit about it.
#
# XXX config(1) needs something like this:
#
# ifoption M68020: M68K_MMU_68851
options M68K_MMU_MOTOROLA
options HZ=60 # mac clock runs at 60hz

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.103 2024/01/09 04:16:25 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.104 2024/01/18 14:39:07 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -70,11 +70,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
/*
* Exported definitions unique to mac68k/68k cpu support.
*/
#define M68K_MMU_MOTOROLA
/*
* Get interrupt glue.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.54 2024/01/18 05:12:30 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.55 2024/01/18 14:39:07 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -43,8 +43,6 @@
#if defined(_KERNEL_OPT)
#include "opt_lockdebug.h"
#include "opt_m68k_arch.h"
#include "opt_mvmeconf.h"
#endif
/*
@ -53,11 +51,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
/*
* Exported definitions unique to mvme68k/68k cpu support.
*/
#define M68K_MMU_MOTOROLA
/*
* Arguments to hardclock and gatherstats encapsulate the previous
* machine state in an opaque clockframe. On the mvme68k, we use

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.52 2024/01/18 04:07:37 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.53 2024/01/18 14:39:07 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -43,7 +43,6 @@
#if defined(_KERNEL_OPT)
#include "opt_lockdebug.h"
#include "opt_m68k_arch.h"
#include "opt_newsconf.h"
#endif
@ -130,10 +129,6 @@ extern volatile u_char *ctrl_ast;
#define aston() \
do { astpending++; *ctrl_ast = 0xff; } while (/* CONSTCOND */0)
#if defined(news1700) || defined(news1200)
#define M68K_MMU_MOTOROLA
#endif
#if defined(news1700)
#define CACHE_HAVE_PAC
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.55 2024/01/18 13:46:14 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.56 2024/01/18 14:39:07 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -43,7 +43,6 @@
#if defined(_KERNEL_OPT)
#include "opt_lockdebug.h"
#include "opt_m68k_arch.h"
#endif
/*
@ -52,11 +51,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
/*
* Exported definitions unique to next68k/68k cpu support.
*/
#define M68K_MMU_MOTOROLA
/*
* Get interrupt glue.
*/

View File

@ -1,12 +1,13 @@
# $NetBSD: std.sun2,v 1.8 2024/01/18 05:13:48 thorpej Exp $
# $NetBSD: std.sun2,v 1.9 2024/01/18 14:39:07 thorpej Exp $
# Standard information for Sun2 machines.
machine sun2 m68k sun68k
include "conf/std" # MI standard options
include "arch/m68k/conf/std.m68k" # m68k standard options
# All sun2 systems have a 68010.
# All sun2 systems have a 68010 with Sun2 MMU
options M68010
options M68K_MMU_SUN2
# XXX temporary option until sun3 port migrates to all sun68k stuff
options _SUN2_

View File

@ -1,4 +1,4 @@
# $NetBSD: std.sun3,v 1.34 2010/09/19 02:09:29 tsutsui Exp $
# $NetBSD: std.sun3,v 1.35 2024/01/18 14:39:07 thorpej Exp $
# Standard information for Sun3 machines.
machine sun3 m68k sun68k
@ -11,6 +11,7 @@ include "arch/m68k/conf/std.m68k" # m68k standard options
makeoptions MACHTYPE=sun3
options _SUN3_
options M68020
options M68K_MMU_SUN3
# The root node (required)
mainbus0 at root

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.4 2024/01/09 04:16:27 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.5 2024/01/18 14:39:07 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -43,7 +43,6 @@
#if defined(_KERNEL_OPT)
#include "opt_lockdebug.h"
#include "opt_m68k_arch.h"
#endif
/*
@ -52,11 +51,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
/*
* Exported definitions unique to virt68k/68k cpu support.
*/
#define M68K_MMU_MOTOROLA
/*
* Arguments to hardclock and gatherstats encapsulate the previous
* machine state in an opaque clockframe. On the virt68k, we use

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.64 2024/01/09 04:16:27 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.65 2024/01/18 14:39:07 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -42,7 +42,6 @@
#define _X68K_CPU_H_
#if defined(_KERNEL_OPT)
#include "opt_m68k_arch.h"
#include "opt_lockdebug.h"
#endif
@ -52,11 +51,6 @@
#include <m68k/cpu.h>
#if defined(_KERNEL)
/*
* Exported definitions unique to x68k/68k cpu support.
*/
#define M68K_MMU_MOTOROLA
/*
* Get interrupt glue.
*/