Use PLATFORM_*

This commit is contained in:
nonaka 2002-05-02 14:58:36 +00:00
parent b9fc6ff617
commit 2ff13751ce
8 changed files with 53 additions and 26 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.49 2002/05/02 14:36:42 nonaka Exp $
# $NetBSD: GENERIC,v 1.50 2002/05/02 14:58:36 nonaka Exp $
#
# GENERIC machine description file
#
@ -22,10 +22,15 @@ include "arch/prep/conf/std.prep"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#ident "GENERIC-$Revision: 1.49 $"
#ident "GENERIC-$Revision: 1.50 $"
maxusers 32
# Platform support
options PLATFORM_IBM_6050 # IBM Personal Power Series 830
options PLATFORM_IBM_7248 # IBM RS/6000 7248-100/120/133
options PLATFORM_MOTOROLA_ULMB60XA # Motorola ULMB60xA (?)
# Standard system options
options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT

View File

@ -1,4 +1,4 @@
# $NetBSD: INSTALL,v 1.17 2002/04/25 15:06:36 atatat Exp $
# $NetBSD: INSTALL,v 1.18 2002/05/02 14:58:36 nonaka Exp $
#
# INSTALL -- Installation kernel
#
@ -16,6 +16,11 @@ options MEMORY_DISK_ROOT_SIZE=4096 # 2 Megabytes
maxusers 8
# Platform support
options PLATFORM_IBM_6050 # IBM Personal Power Series 830
options PLATFORM_IBM_7248 # IBM RS/6000 7248-100/120/133
options PLATFORM_MOTOROLA_ULMB60XA # Motorola ULMB60xA (?)
# Compatibility options
#options COMPAT_13 # NetBSD 1.3,
options COMPAT_14 # NetBSD 1.4,

View File

@ -1,4 +1,4 @@
# $NetBSD: NATSUMI,v 1.17 2002/04/25 15:06:36 atatat Exp $
# $NetBSD: NATSUMI,v 1.18 2002/05/02 14:58:36 nonaka Exp $
#
# for development
#
@ -7,9 +7,13 @@ include "arch/prep/conf/std.prep"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
makeoptions COPTS="-O2 -pipe"
maxusers 32
makeoptions COPTS="-O2 -pipe"
# Platform support
options PLATFORM_IBM_6050 # IBM Personal Power Series 830
options PLATFORM_IBM_7248 # IBM RS/6000 7248-100/120/133
# Standard system options

View File

@ -1,4 +1,4 @@
# $NetBSD: files.prep,v 1.32 2002/05/02 14:44:17 nonaka Exp $
# $NetBSD: files.prep,v 1.33 2002/05/02 14:58:36 nonaka Exp $
#
# prep-specific configuration info
#
@ -8,14 +8,18 @@ maxusers 2 8 64
defflag opt_residual.h RESIDUAL_DATA_DUMP
defflag opt_platform.h PLATFORM_IBM_6050
PLATFORM_IBM_7248
PLATFORM_MOTOROLA_ULMB60XA
# IBM
file arch/prep/prep/ibm_machdep.c
file arch/prep/prep/ibm_6050.c
file arch/prep/prep/ibm_7248.c
file arch/prep/prep/ibm_6050.c platform_ibm_6050
file arch/prep/prep/ibm_7248.c platform_ibm_7248
# Motorola
file arch/prep/prep/mot_machdep.c
file arch/prep/prep/mot_ulmb60xa.c
file arch/prep/prep/mot_ulmb60xa.c platform_motorola_ulmb60xa
file arch/prep/prep/platform.c

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibm_machdep.c,v 1.4 2002/05/02 14:48:27 nonaka Exp $ */
/* $NetBSD: ibm_machdep.c,v 1.5 2002/05/02 14:58:37 nonaka Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -36,6 +36,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -43,12 +45,17 @@
#include <machine/platform.h>
static struct platform *platform_ibm[] = {
#if defined(PLATFORM_IBM_6050)
&platform_ibm_6050,
#endif
#if defined(PLATFORM_IBM_7248)
&platform_ibm_7248,
#endif
NULL
};
struct plattab plattab_ibm = {
platform_ibm, sizeof(platform_ibm)/sizeof(platform_ibm[0])
platform_ibm, sizeof(platform_ibm)/sizeof(platform_ibm[0]) - 1
};
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: mot_machdep.c,v 1.1 2002/02/26 16:09:15 kleink Exp $ */
/* $NetBSD: mot_machdep.c,v 1.2 2002/05/02 14:58:37 nonaka Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -36,15 +36,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <machine/platform.h>
static struct platform *platform_mot[] = {
&platform_mot_ulmb60xa
#if defined(PLATFORM_MOTOROLA_ULMB60XA)
&platform_mot_ulmb60xa,
#endif
NULL
};
struct plattab plattab_mot = {
platform_mot, sizeof(platform_mot)/sizeof(platform_mot[0])
platform_mot, sizeof(platform_mot)/sizeof(platform_mot[0]) - 1
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: mot_ulmb60xa.c,v 1.2 2002/05/02 14:48:27 nonaka Exp $ */
/* $NetBSD: mot_ulmb60xa.c,v 1.3 2002/05/02 14:58:37 nonaka Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -87,7 +87,7 @@ mot_ulmb60xa_match(struct platform *p)
{
uint8_t cputype;
if (p->model == NULL)
if (p == NULL || p->model == NULL)
return 0;
if (strcmp(res->VitalProductData.PrintableModel, p->model) != 0)
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: platform.c,v 1.5 2002/05/02 14:48:27 nonaka Exp $ */
/* $NetBSD: platform.c,v 1.6 2002/05/02 14:58:37 nonaka Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
#include <machine/residual.h>
static struct platform platform_unknown = {
NULL, /* model */
"", /* model */
platform_generic_match, /* match */
prep_pci_get_chipset_tag_indirect, /* pci_setup */
pci_intr_nofixup, /* pci_intr_fixup */
@ -64,7 +64,7 @@ struct platform *platform = &platform_unknown;
int
ident_platform(void)
{
struct plattab *p;
struct plattab *p = &plattab_unknown;
int matched = -1, match = 0;
int i, rv;
@ -80,8 +80,6 @@ ident_platform(void)
else if (strncmp(res->VitalProductData.PrintableModel,
"BULL ESTRELLA (e0) (e0)", 31) == 0) /* XXX */
p = &plattab_mot;
else
p = &plattab_unknown;
for (i = 0; i < p->num; i++) {
rv = (*p->platform[i]->match)(p->platform[i]);
@ -99,14 +97,13 @@ int
platform_generic_match(struct platform *p)
{
if (p->model == NULL)
if (p == NULL || p->model == NULL)
return 0;
if (strcmp(res->VitalProductData.PrintableModel, p->model) == 0)
return 1;
return 0;
if (strcmp(res->VitalProductData.PrintableModel, p->model) != 0)
return 0;
return 1;
}
/* ARGUSED */
void
pci_intr_nofixup(int busno, int device, int *intr)