Use explicitly defined macros in Makefile to determine to use

eeprom and/or openprom handlers, instead of predefined compiler
macros (__sun__, __sparc__ ...).
This commit is contained in:
nakayama 2013-03-15 20:22:44 +00:00
parent 39d8199988
commit 61db04d3c6
5 changed files with 13 additions and 19 deletions

View File

@ -1,5 +1,5 @@
# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
# $NetBSD: Makefile,v 1.17 2011/12/15 07:51:29 macallan Exp $
# $NetBSD: Makefile,v 1.18 2013/03/15 20:22:44 nakayama Exp $
.if ${MACHINE} == "sun3" || ${MACHINE} == "sun3x" \
|| ${MACHINE} == "sparc" || ${MACHINE} == "sparc64" \
@ -13,10 +13,12 @@ DPADD+=${LIBUTIL}
.if ${MACHINE} == "sparc" || ${MACHINE} == "sparc64"
SRCS+= ophandlers.c
CPPFLAGS+= -DUSE_OPENPROM
.endif
.if ${MACHINE} == "sun3" || ${MACHINE} == "sun3x" || ${MACHINE} == "sparc"
SRCS+= eehandlers.c
CPPFLAGS+= -DUSE_EEPROM
.endif
.if ${MACHINE} == "macppc" || ${MACHINE} == "shark"

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.13 2009/04/29 09:13:58 nakayama Exp $ */
/* $NetBSD: defs.h,v 1.14 2013/03/15 20:22:44 nakayama Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@ struct strvaltabent {
u_char sv_val; /* ... and the value */
};
#ifdef __sparc__
#ifdef USE_OPENPROM
struct opiocdesc;
/*
* This is an entry in a table which describes a set of `exceptions'.
@ -88,7 +88,7 @@ struct extabent {
struct opiocdesc *, char *);
/* handler function for this entry */
};
#endif /* __sparc__ */
#endif
#ifdef USE_OPENFIRM
struct extabent {
@ -129,13 +129,11 @@ u_char ee_checksum (u_char *, size_t);
void ee_updatechecksums (void);
void ee_verifychecksums (void);
#ifdef __sparc__
/* Sparc Openprom handlers. */
char *op_handler (char *, char *);
void op_action (char *, char *);
void op_dump (void);
int check_for_openprom (void);
#endif /* __sparc__ */
/* OpenFirmware handlers. */
char *of_handler (char *, char *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: eehandlers.c,v 1.16 2013/02/03 15:30:04 christos Exp $ */
/* $NetBSD: eehandlers.c,v 1.17 2013/03/15 20:22:44 nakayama Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -43,9 +43,6 @@
#include <sys/inttypes.h>
#include <machine/eeprom.h>
#ifdef __sparc__
#include <machine/openpromio.h>
#endif /* __sparc__ */
#include "defs.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.21 2009/04/29 09:13:58 nakayama Exp $ */
/* $NetBSD: main.c,v 1.22 2013/03/15 20:22:44 nakayama Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -33,7 +33,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1996\
The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: main.c,v 1.21 2009/04/29 09:13:58 nakayama Exp $");
__RCSID("$NetBSD: main.c,v 1.22 2013/03/15 20:22:44 nakayama Exp $");
#endif
#include <sys/param.h>
@ -43,16 +43,15 @@ __RCSID("$NetBSD: main.c,v 1.21 2009/04/29 09:13:58 nakayama Exp $");
#include <stdlib.h>
#include <unistd.h>
#ifdef __sun__
#if defined(USE_EEPROM) || defined(USE_OPENPROM)
#include <machine/eeprom.h>
#endif
#include "defs.h"
#include "pathnames.h"
#if defined(__sparc__)
# define USE_OPENPROM
# if defined(__arch64__)
#ifdef USE_OPENPROM
# ifndef USE_EEPROM
# define ee_action(a,b)
# define ee_dump()
# define ee_updatechecksums() (void)0

View File

@ -1,4 +1,4 @@
/* $NetBSD: ophandlers.c,v 1.11 2011/01/04 09:25:21 wiz Exp $ */
/* $NetBSD: ophandlers.c,v 1.12 2013/03/15 20:22:44 nakayama Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -79,7 +79,6 @@ op_action(keyword, arg)
return;
}
#if defined(__sparc__) && !defined(__arch64__)
int
check_for_openprom()
{
@ -95,7 +94,6 @@ check_for_openprom()
return (rv == 0);
}
#endif
char *
op_handler(keyword, arg)