Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/emips/stand/common make this compile



details:   https://anonhg.NetBSD.org/src/rev/5156c38cc81c
branches:  trunk
changeset: 326984:5156c38cc81c
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 24 22:31:56 2014 +0000

description:
make this compile

diffstat:

 sys/arch/emips/stand/common/clock.c      |   7 ++++---
 sys/arch/emips/stand/common/common.h     |   8 ++++----
 sys/arch/emips/stand/common/enic.c       |  26 +++++++++++++++++---------
 sys/arch/emips/stand/common/prom_iface.c |  16 +++++++++-------
 sys/arch/emips/stand/common/putchar.c    |   4 +---
 5 files changed, 35 insertions(+), 26 deletions(-)

diffs (204 lines):

diff -r 83ad4e8adbbe -r 5156c38cc81c sys/arch/emips/stand/common/clock.c
--- a/sys/arch/emips/stand/common/clock.c       Mon Feb 24 21:14:13 2014 +0000
+++ b/sys/arch/emips/stand/common/clock.c       Mon Feb 24 22:31:56 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: clock.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */
+/*      $NetBSD: clock.c,v 1.2 2014/02/24 22:31:56 christos Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -33,11 +33,12 @@
 
 #include <sys/types.h>
 #include <machine/emipsreg.h>
+#include <lib/libsa/net.h>
 
 #include <stand/common/common.h>
 
-long
-getsecs()
+satime_t
+getsecs(void)
 {
     struct _Tc *Tc = (struct _Tc *)TIMER_DEFAULT_ADDRESS;
        uint64_t now;
diff -r 83ad4e8adbbe -r 5156c38cc81c sys/arch/emips/stand/common/common.h
--- a/sys/arch/emips/stand/common/common.h      Mon Feb 24 21:14:13 2014 +0000
+++ b/sys/arch/emips/stand/common/common.h      Mon Feb 24 22:31:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.h,v 1.2 2014/02/06 18:43:41 christos Exp $      */
+/*     $NetBSD: common.h,v 1.3 2014/02/24 22:31:56 christos Exp $      */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -43,9 +43,6 @@
 /* startprog.S */
 extern void startprog (int, int, int, char **, int, const void *, int, int);
 
-/* clock.c */
-extern long getsecs (void);
-
 /* init_board.c */
 #define BOARD_HAS_DISK0   0x01
 #define BOARD_HAS_DISK1   0x02
@@ -69,5 +66,8 @@
 /* print.c */
 extern void xputchar(int);
 
+/* putchar.c */
+extern void putchar(int);
+
 /* vers.c (generated by newvers.sh) */
 extern const char bootprog_rev[];
diff -r 83ad4e8adbbe -r 5156c38cc81c sys/arch/emips/stand/common/enic.c
--- a/sys/arch/emips/stand/common/enic.c        Mon Feb 24 21:14:13 2014 +0000
+++ b/sys/arch/emips/stand/common/enic.c        Mon Feb 24 22:31:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: enic.c,v 1.2 2014/02/24 08:00:52 martin Exp $  */
+/*     $NetBSD: enic.c,v 1.3 2014/02/24 22:31:56 christos Exp $        */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -69,6 +69,10 @@
 #include "start.h"
 
 #include <machine/emipsreg.h>
+
+#include "start.h"
+#include "common.h"
+
 #define the_enic ((struct _Enic *)ETHERNET_DEFAULT_ADDRESS)
 
 /* forward declarations */
@@ -100,7 +104,8 @@
 
 /* Send a packet
  */
-static int enic_putpkt(struct _Enic *regs, void *buf, int bytes)
+static int
+enic_putpkt(struct _Enic *regs, void *buf, int bytes)
 {
     paddr_t phys = kvtophys(buf);
 
@@ -113,7 +118,8 @@
 
 /* Get a packet
  */
-int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo)
+static int
+enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo)
 {
     paddr_t phys;
     unsigned int isr, saf, hi, lo, fl;
@@ -143,8 +149,9 @@
 
             /* beware, order matters */
             saf = regs->SizeAndFlags;
-            hi  = regs->BufferAddressHi32; /* BUGBUG 64bit */
-            lo  = regs->BufferAddressLo32; /* this pops the fifo */
+            hi = regs->BufferAddressHi32; /* BUGBUG 64bit */
+            lo = regs->BufferAddressLo32; /* this pops the fifo */
+           __USE(hi);
 
             fl = saf & (ES_F_MASK &~ ES_F_DONE);
 
@@ -182,7 +189,7 @@
 
     regs->Control = EC_RESET;
     Delay(1);
-       regs->Control = regs->Control & (~EC_RXDIS);
+    regs->Control = regs->Control & (~EC_RXDIS);
 
     buffer[0] = ENIC_CMD_GET_ADDRESS;
 
@@ -208,10 +215,11 @@
 
 /* Exported interface
  */
-int enic_present(int unit)
+int
+enic_present(int unit)
 {
-       if ((unit != 0) || (the_enic->Tag != PMTTAG_ETHERNET))
-        return 0;
+    if ((unit != 0) || (the_enic->Tag != PMTTAG_ETHERNET))
+       return 0;
 
     return 1;
 }
diff -r 83ad4e8adbbe -r 5156c38cc81c sys/arch/emips/stand/common/prom_iface.c
--- a/sys/arch/emips/stand/common/prom_iface.c  Mon Feb 24 21:14:13 2014 +0000
+++ b/sys/arch/emips/stand/common/prom_iface.c  Mon Feb 24 22:31:56 2014 +0000
@@ -62,10 +62,11 @@
 void real_halt(void*);
 void halt(int *unused, int howto);
 
-void *nope(void) {return NULL;}
+static void *nope(void) {return NULL;}
 int getchar(void){return GetChar();}
 
-void real_halt(void *arg)
+static void
+real_halt(void *arg)
 {
     int howto = (int)arg;
     u_int ps = GetPsr();
@@ -101,7 +102,8 @@
     }
 }
 
-void halt(int *unused, int howto)
+static void
+halt(int *unused, int howto)
 {
     /* We must switch to a safe stack! TLB will go down 
      */
@@ -119,10 +121,10 @@
     nope,
     nope,
     nope,
-       getchar,
+    getchar,
     nope,
     nope,
-       printf,
+    printf,
     nope,
     nope,
     nope,
@@ -149,7 +151,7 @@
     nope,
     nope,
     nope,
-       halt
+    halt
 };
 
 typedef char *string_t;
@@ -249,7 +251,7 @@
     /* Make sure we know */
  DoneFirst:
     if ((First == NULL) || (Ours == NULL)) {
-        printf("Bad memory layout (%p,%p), wont work.\n", First, Ours);
+        printf("Bad memory layout (%p, %p), wont work.\n", First, Ours);
         return 0;
     }
 
diff -r 83ad4e8adbbe -r 5156c38cc81c sys/arch/emips/stand/common/putchar.c
--- a/sys/arch/emips/stand/common/putchar.c     Mon Feb 24 21:14:13 2014 +0000
+++ b/sys/arch/emips/stand/common/putchar.c     Mon Feb 24 22:31:56 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: putchar.c,v 1.2 2014/02/24 07:41:15 martin Exp $      */
+/*      $NetBSD: putchar.c,v 1.3 2014/02/24 22:31:56 christos Exp $    */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -34,8 +34,6 @@
 #include "start.h"
 #include "common.h"
 
-void   putchar(int);
-
 /* Write a character to the USART
  */
 void



Home | Main Index | Thread Index | Old Index