Add consinit() and md_consinit funcptr to ibm4xx/machdep.c.

Rename consinit() to obs405_consinit() at evbppc/obs405/consinit.c.

Set md_consinit to obs405_consinit() at initppc().
Consinit fuction calls a function stored at md_consinit pointer.
This commit is contained in:
shige 2005-01-21 19:24:11 +00:00
parent 102f557a3b
commit 9704ef243d
5 changed files with 32 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: obs405.h,v 1.2 2005/01/18 17:55:16 shige Exp $ */ /* $NetBSD: obs405.h,v 1.3 2005/01/21 19:24:11 shige Exp $ */
/* /*
* Copyright 2004 Shigeyuki Fukushima. * Copyright 2004 Shigeyuki Fukushima.
@ -70,6 +70,7 @@
/* /*
* extern variables and functions * extern variables and functions
*/ */
extern void obs405_consinit(void);
extern void obs405_cpu_startup(void); extern void obs405_cpu_startup(void);
extern void obs405_device_register(struct device *dev, void *aux); extern void obs405_device_register(struct device *dev, void *aux);

View File

@ -1,4 +1,4 @@
/* $NetBSD: consinit.c,v 1.2 2005/01/13 17:07:24 shige Exp $ */ /* $NetBSD: consinit.c,v 1.3 2005/01/21 19:24:11 shige Exp $ */
/* /*
* Copyright (c) 2004 Shigeyuki Fukushima. * Copyright (c) 2004 Shigeyuki Fukushima.
@ -31,9 +31,8 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.2 2005/01/13 17:07:24 shige Exp $"); __KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2005/01/21 19:24:11 shige Exp $");
#include <sys/systm.h>
#include <machine/obs405.h> #include <machine/obs405.h>
#include <powerpc/ibm4xx/dev/comopbvar.h> #include <powerpc/ibm4xx/dev/comopbvar.h>
@ -42,7 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.2 2005/01/13 17:07:24 shige Exp $");
* Initialize the system console. * Initialize the system console.
*/ */
void void
consinit(void) obs405_consinit(void)
{ {
#if (NCOM > 0) #if (NCOM > 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: md_machdep.c,v 1.1 2005/01/18 17:55:16 shige Exp $ */ /* $NetBSD: md_machdep.c,v 1.2 2005/01/21 19:24:11 shige Exp $ */
/* Original: machdep.c,v 1.3 2005/01/17 17:24:09 shige Exp $ */ /* Original: machdep.c,v 1.3 2005/01/17 17:24:09 shige Exp $ */
/* /*
@ -68,7 +68,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: md_machdep.c,v 1.1 2005/01/18 17:55:16 shige Exp $"); __KERNEL_RCSID(0, "$NetBSD: md_machdep.c,v 1.2 2005/01/21 19:24:11 shige Exp $");
#include "opt_compat_netbsd.h" #include "opt_compat_netbsd.h"
#include "opt_ddb.h" #include "opt_ddb.h"
@ -122,6 +122,7 @@ initppc(u_int startkernel, u_int endkernel, char *args, void *info_block)
memsize = openbios_board_memsize_get(); memsize = openbios_board_memsize_get();
/* Setup machine-dependent functions */ /* Setup machine-dependent functions */
md_consinit = obs405_consinit;
md_cpu_startup = obs405_cpu_startup; md_cpu_startup = obs405_cpu_startup;
md_device_register = obs405_device_register; md_device_register = obs405_device_register;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.1 2005/01/18 16:56:24 shige Exp $ */ /* $NetBSD: machdep.c,v 1.2 2005/01/21 19:24:11 shige Exp $ */
/* /*
* Copyright (c) 2004 Shigeyuki Fukushima. * Copyright (c) 2004 Shigeyuki Fukushima.
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.1 2005/01/18 16:56:24 shige Exp $"); __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.2 2005/01/21 19:24:11 shige Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -64,8 +64,25 @@ char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */
/* /*
* machine-dependent function pointers * machine-dependent function pointers
*/ */
void (*md_consinit) __P((void)) = NULL;
void (*md_cpu_startup) __P((void)) = NULL; void (*md_cpu_startup) __P((void)) = NULL;
/*
* consinit:
* console initialize.
*/
void
consinit(void)
{
/* 4xx common procedure is here. */
;
/* machine-dependent procedure is here. */
if (md_consinit != NULL)
md_consinit();
}
/* /*
* cpu_startup: * cpu_startup:
* machine startup code. * machine startup code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.9 2005/01/18 17:11:25 shige Exp $ */ /* $NetBSD: cpu.h,v 1.10 2005/01/21 19:24:11 shige Exp $ */
/* /*
* Copyright 2002 Wasabi Systems, Inc. * Copyright 2002 Wasabi Systems, Inc.
@ -67,6 +67,7 @@ extern char bootpath[];
extern void (*md_device_register) __P((struct device *dev, void *aux)); extern void (*md_device_register) __P((struct device *dev, void *aux));
/* export from ibm4xx/machdep.c */ /* export from ibm4xx/machdep.c */
extern void (*md_consinit) __P((void));
extern void (*md_cpu_startup) __P((void)); extern void (*md_cpu_startup) __P((void));
/* export from ibm4xx/ibm40x_machdep.c */ /* export from ibm4xx/ibm40x_machdep.c */
@ -81,7 +82,10 @@ extern void ibm4xx_install_extint(void (*)(void));
/* export from ibm4xx/ibm4xx_autoconf.c */ /* export from ibm4xx/ibm4xx_autoconf.c */
extern void ibm4xx_device_register(struct device *dev, void *aux); extern void ibm4xx_device_register(struct device *dev, void *aux);
/* export from ibm4xx/clock.c */
extern void calc_delayconst(void); extern void calc_delayconst(void);
/* export from ibm4xx/4xx_locore.S */
extern void ppc4xx_reset(void) __attribute__((__noreturn__)); extern void ppc4xx_reset(void) __attribute__((__noreturn__));
#endif /* _KERNEL */ #endif /* _KERNEL */