Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/eeprom Use explicitly defined macros in Makefile to...



details:   https://anonhg.NetBSD.org/src/rev/1e3930cd9458
branches:  trunk
changeset: 785479:1e3930cd9458
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Fri Mar 15 20:22:44 2013 +0000

description:
Use explicitly defined macros in Makefile to determine to use
eeprom and/or openprom handlers, instead of predefined compiler
macros (__sun__, __sparc__ ...).

diffstat:

 usr.sbin/eeprom/Makefile     |   4 +++-
 usr.sbin/eeprom/defs.h       |   8 +++-----
 usr.sbin/eeprom/eehandlers.c |   5 +----
 usr.sbin/eeprom/main.c       |  11 +++++------
 usr.sbin/eeprom/ophandlers.c |   4 +---
 5 files changed, 13 insertions(+), 19 deletions(-)

diffs (146 lines):

diff -r 16773e043856 -r 1e3930cd9458 usr.sbin/eeprom/Makefile
--- a/usr.sbin/eeprom/Makefile  Fri Mar 15 19:32:30 2013 +0000
+++ b/usr.sbin/eeprom/Makefile  Fri Mar 15 20:22:44 2013 +0000
@@ -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 @@
 
 .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"
diff -r 16773e043856 -r 1e3930cd9458 usr.sbin/eeprom/defs.h
--- a/usr.sbin/eeprom/defs.h    Fri Mar 15 19:32:30 2013 +0000
+++ b/usr.sbin/eeprom/defs.h    Fri Mar 15 20:22:44 2013 +0000
@@ -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 @@
        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 opiocdesc *, char *);
                                        /* handler function for this entry */
 };
-#endif /* __sparc__ */
+#endif
 
 #ifdef USE_OPENFIRM
 struct extabent {
@@ -129,13 +129,11 @@
 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 *);
diff -r 16773e043856 -r 1e3930cd9458 usr.sbin/eeprom/eehandlers.c
--- a/usr.sbin/eeprom/eehandlers.c      Fri Mar 15 19:32:30 2013 +0000
+++ b/usr.sbin/eeprom/eehandlers.c      Fri Mar 15 20:22:44 2013 +0000
@@ -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"
 
diff -r 16773e043856 -r 1e3930cd9458 usr.sbin/eeprom/main.c
--- a/usr.sbin/eeprom/main.c    Fri Mar 15 19:32:30 2013 +0000
+++ b/usr.sbin/eeprom/main.c    Fri Mar 15 20:22:44 2013 +0000
@@ -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 @@
 #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
diff -r 16773e043856 -r 1e3930cd9458 usr.sbin/eeprom/ophandlers.c
--- a/usr.sbin/eeprom/ophandlers.c      Fri Mar 15 19:32:30 2013 +0000
+++ b/usr.sbin/eeprom/ophandlers.c      Fri Mar 15 20:22:44 2013 +0000
@@ -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 @@
        return;
 }
 
-#if defined(__sparc__) && !defined(__arch64__)
 int
 check_for_openprom()
 {
@@ -95,7 +94,6 @@
 
        return (rv == 0);
 }
-#endif
 
 char *
 op_handler(keyword, arg)



Home | Main Index | Thread Index | Old Index