From 5432dacfcbf502d3689a4ce7a7c5bfdb505d7e24 Mon Sep 17 00:00:00 2001 From: thorpej Date: Fri, 4 Jul 2003 00:33:20 +0000 Subject: [PATCH] Provide a hook for board-specific code to register a device_register() function. --- sys/arch/evbarm/evbarm/autoconf.c | 7 ++++++- sys/arch/evbarm/include/autoconf.h | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/arch/evbarm/evbarm/autoconf.c b/sys/arch/evbarm/evbarm/autoconf.c index 6a82fac8baa1..709470b9d942 100644 --- a/sys/arch/evbarm/evbarm/autoconf.c +++ b/sys/arch/evbarm/evbarm/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.4 2003/06/30 15:17:11 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.5 2003/07/04 00:33:20 thorpej Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -53,6 +53,8 @@ struct device *booted_device; int booted_partition; +void (*evbarm_device_register)(struct device *, void *); + /* * Set up the root device from the boot args */ @@ -94,4 +96,7 @@ cpu_configure(void) void device_register(struct device *dev, void *aux) { + + if (evbarm_device_register != NULL) + (*evbarm_device_register)(dev, aux); } diff --git a/sys/arch/evbarm/include/autoconf.h b/sys/arch/evbarm/include/autoconf.h index ed4e07867bb2..a02278245a29 100644 --- a/sys/arch/evbarm/include/autoconf.h +++ b/sys/arch/evbarm/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.2 2001/11/07 00:33:23 thorpej Exp $ */ +/* $NetBSD: autoconf.h,v 1.3 2003/07/04 00:33:21 thorpej Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,4 +43,7 @@ struct mainbus_attach_args { const char *ma_name; }; +struct device; +extern void (*evbarm_device_register)(struct device *, void *); + #endif /* _EVBARM_AUTOCONF_H_ */