make this compile

This commit is contained in:
christos 2014-02-24 22:31:56 +00:00
parent fe94801223
commit 60d0010e25
5 changed files with 35 additions and 26 deletions

View File

@ -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;

View File

@ -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 @@ extern int debug; /* only used for network debugging for now */
/* 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 @@ extern int enic_present(int);
/* print.c */
extern void xputchar(int);
/* putchar.c */
extern void putchar(int);
/* vers.c (generated by newvers.sh) */
extern const char bootprog_rev[];

View File

@ -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 @@ static void dump_packet(void *, int);
/* 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 @@ static int enic_putpkt(struct _Enic *regs, void *buf, int bytes)
/* 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 @@ int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo)
/* 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 @@ static int enic_getmac(struct _Enic *regs, uint8_t *mac)
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 @@ static int enic_getmac(struct _Enic *regs, uint8_t *mac)
/* 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;
}

View File

@ -62,10 +62,11 @@ void *nope(void);
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 real_halt(void *arg)
}
}
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 @@ struct callback cb = {
nope,
nope,
nope,
getchar,
getchar,
nope,
nope,
printf,
printf,
nope,
nope,
nope,
@ -149,7 +151,7 @@ struct callback cb = {
nope,
nope,
nope,
halt
halt
};
typedef char *string_t;
@ -249,7 +251,7 @@ int init_memory(void)
/* 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;
}

View File

@ -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