Replace sun3_etheraddr with sun3_getidprom (used by idprom.c)

This commit is contained in:
gwr 1999-03-04 07:56:41 +00:00
parent 0c38ab98fa
commit 78eab1b1b9
2 changed files with 17 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: libsa.h,v 1.4 1998/06/29 20:03:14 gwr Exp $ */ /* $NetBSD: libsa.h,v 1.5 1999/03/04 07:56:41 gwr Exp $ */
/* /*
* This file defines the API for libsa.a * This file defines the API for libsa.a
@ -39,7 +39,7 @@ extern char *prom_bootfile;
extern int prom_boothow; extern int prom_boothow;
/* sun3.c */ /* sun3.c */
void sun3_etheraddr __P((u_char *ea)); void sun3_getidprom __P((u_char *ea));
/* version.c */ /* version.c */
extern char version[]; extern char version[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: sun3.c,v 1.2 1998/02/05 04:57:16 gwr Exp $ */ /* $NetBSD: sun3.c,v 1.3 1999/03/04 07:56:41 gwr Exp $ */
/*- /*-
* Copyright (c) 1998 The NetBSD Foundation, Inc. * Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -49,6 +49,7 @@
#define set_segmap sun3_set_segmap #define set_segmap sun3_set_segmap
#include <sys/param.h> #include <sys/param.h>
#include <machine/idprom.h>
#include <machine/mon.h> #include <machine/mon.h>
#include <machine/pte.h> #include <machine/pte.h>
@ -258,13 +259,22 @@ set_segmap(va, sme)
set_control_byte(va, sme); set_control_byte(va, sme);
} }
/*
* Copy the IDPROM contents into the passed buffer.
* The caller (idprom.c) will do the checksum.
*/
void void
sun3_etheraddr(u_char *ea) sun3_getidprom(u_char *dst)
{ {
vm_offset_t ca; /* control space address */ vm_offset_t src; /* control space address */
int len, x;
for (ca = 2; ca < 8; ca++) src = IDPROM_BASE;
*ea++ = get_control_byte(ca); len = sizeof(struct idprom);
do {
x = get_control_byte(src++);
*dst++ = x;
} while (--len > 0);
} }
/***************************************************************** /*****************************************************************