summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-09-17 20:29:48 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-09-17 20:29:48 +0000
commit364d7bd6e0ac846fda137d4831f7ae5471929635 (patch)
tree9110b46f5da77408fdf3e5a41f77d2d916a58ae7 /sys
parent7df6ae7a138cef7efa64b0a7c3a633e3c5e83ce3 (diff)
Un-staticize if option DDB.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/cardbus/cardbus.c40
-rw-r--r--sys/dev/cardbus/cardbus_map.c18
-rw-r--r--sys/dev/cardbus/cardslot.c24
-rw-r--r--sys/dev/cardbus/rbus.c13
4 files changed, 55 insertions, 40 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index 6872db34054..9325b1423a1 100644
--- a/sys/dev/cardbus/cardbus.c
+++ b/sys/dev/cardbus/cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cardbus.c,v 1.34 2006/10/12 16:35:51 grange Exp $ */
+/* $OpenBSD: cardbus.c,v 1.35 2007/09/17 20:29:47 miod Exp $ */
/* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */
/*
@@ -53,11 +53,15 @@
#include <dev/pcmcia/pcmciareg.h>
-#if defined CARDBUS_DEBUG
+#ifdef CARDBUS_DEBUG
#define STATIC
#define DPRINTF(a) printf a
#else
+#ifdef DDB
#define STATIC static
+#else
+#define STATIC
+#endif
#define DPRINTF(a)
#endif
@@ -65,21 +69,21 @@ STATIC void cardbusattach(struct device *, struct device *, void *);
/* STATIC int cardbusprint(void *, const char *); */
STATIC int cardbusmatch(struct device *, void *, void *);
-static int cardbussubmatch(struct device *, void *, void *);
-static int cardbusprint(void *, const char *);
+STATIC int cardbussubmatch(struct device *, void *, void *);
+STATIC int cardbusprint(void *, const char *);
typedef void (*tuple_decode_func)(u_int8_t *, int, void *);
-static int decode_tuples(u_int8_t *, int, tuple_decode_func, void *);
+STATIC int decode_tuples(u_int8_t *, int, tuple_decode_func, void *);
#ifdef CARDBUS_DEBUG
-static void print_tuple(u_int8_t *, int, void *);
+STATIC void print_tuple(u_int8_t *, int, void *);
#endif
-static int cardbus_read_tuples(struct cardbus_attach_args *,
+STATIC int cardbus_read_tuples(struct cardbus_attach_args *,
cardbusreg_t, u_int8_t *, size_t);
-static void enable_function(struct cardbus_softc *, int, int);
-static void disable_function(struct cardbus_softc *, int);
+STATIC void enable_function(struct cardbus_softc *, int, int);
+STATIC void disable_function(struct cardbus_softc *, int);
struct cfattach cardbus_ca = {
@@ -135,7 +139,7 @@ cardbusattach(struct device *parent, struct device *self, void *aux)
cdstatus = 0;
}
-static int
+STATIC int
cardbus_read_tuples(struct cardbus_attach_args *ca, cardbusreg_t cis_ptr,
u_int8_t *tuples, size_t len)
{
@@ -276,7 +280,7 @@ cardbus_read_tuples(struct cardbus_attach_args *ca, cardbusreg_t cis_ptr,
return (!found);
}
-static void
+STATIC void
parse_tuple(u_int8_t *tuple, int len, void *data)
{
struct cardbus_cis_info *cis = data;
@@ -554,7 +558,7 @@ cardbus_attach_card(struct cardbus_softc *sc)
return (no_work_funcs);
}
-static int
+STATIC int
cardbussubmatch(struct device *parent, void *match, void *aux)
{
struct cfdata *cf = match;
@@ -572,7 +576,7 @@ cardbussubmatch(struct device *parent, void *match, void *aux)
return ((*cf->cf_attach->ca_match)(parent, cf, aux));
}
-static int
+STATIC int
cardbusprint(void *aux, const char *pnp)
{
struct cardbus_attach_args *ca = aux;
@@ -684,7 +688,7 @@ cardbus_intr_disestablish(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf,
/* XXX this should be merged with cardbus_function_{enable,disable},
but we don't have a ct when these functions are called */
-static void
+STATIC void
enable_function(struct cardbus_softc *sc, int cdstatus, int function)
{
if (sc->sc_poweron_func == 0) {
@@ -700,7 +704,7 @@ enable_function(struct cardbus_softc *sc, int cdstatus, int function)
sc->sc_poweron_func |= (1 << function);
}
-static void
+STATIC void
disable_function(struct cardbus_softc *sc, int function)
{
sc->sc_poweron_func &= ~(1 << function);
@@ -822,10 +826,10 @@ cardbus_matchbyid(struct cardbus_attach_args *ca,
* They should go out from this file.
*/
-static u_int8_t *
+STATIC u_int8_t *
decode_tuple(u_int8_t *, u_int8_t *, tuple_decode_func, void *);
-static int
+STATIC int
decode_tuples(u_int8_t *tuple, int buflen, tuple_decode_func func, void *data)
{
u_int8_t *tp = tuple;
@@ -841,7 +845,7 @@ decode_tuples(u_int8_t *tuple, int buflen, tuple_decode_func func, void *data)
return (1);
}
-static u_int8_t *
+STATIC u_int8_t *
decode_tuple(u_int8_t *tuple, u_int8_t *end, tuple_decode_func func,
void *data)
{
diff --git a/sys/dev/cardbus/cardbus_map.c b/sys/dev/cardbus/cardbus_map.c
index 0ed9544a834..7db2e4bb632 100644
--- a/sys/dev/cardbus/cardbus_map.c
+++ b/sys/dev/cardbus/cardbus_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cardbus_map.c,v 1.7 2006/07/31 11:06:27 mickey Exp $ */
+/* $OpenBSD: cardbus_map.c,v 1.8 2007/09/17 20:29:47 miod Exp $ */
/* $NetBSD: cardbus_map.c,v 1.10 2000/03/07 00:31:46 mycroft Exp $ */
/*
@@ -52,15 +52,19 @@
#define STATIC
#define DPRINTF(a) printf a
#else
+#ifdef DDB
+#define STATIC
+#else
#define STATIC static
+#endif
#define DPRINTF(a)
#endif
-static int cardbus_io_find(cardbus_chipset_tag_t, cardbus_function_tag_t,
+STATIC int cardbus_io_find(cardbus_chipset_tag_t, cardbus_function_tag_t,
cardbustag_t, int, cardbusreg_t, bus_addr_t *, bus_size_t *,
int *);
-static int cardbus_mem_find(cardbus_chipset_tag_t, cardbus_function_tag_t,
+STATIC int cardbus_mem_find(cardbus_chipset_tag_t, cardbus_function_tag_t,
cardbustag_t, int, cardbusreg_t, bus_addr_t *, bus_size_t *,
int *);
@@ -87,13 +91,13 @@ cardbus_mapreg_probe(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf,
}
/*
- * static int cardbus_io_find(cardbus_chipset_tag_t cc,
+ * STATIC int cardbus_io_find(cardbus_chipset_tag_t cc,
* cardbus_function_tag_t cf, cardbustag_t tag,
* int reg, cardbusreg_t type, bus_addr_t *basep,
* bus_size_t *sizep, int *flagsp)
* This code is stolen from sys/dev/pci_map.c.
*/
-static int
+STATIC int
cardbus_io_find(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf,
cardbustag_t tag, int reg, cardbusreg_t type, bus_addr_t *basep,
bus_size_t *sizep, int *flagsp)
@@ -147,13 +151,13 @@ cardbus_io_find(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf,
}
/*
- * static int cardbus_mem_find(cardbus_chipset_tag_t cc,
+ * STATIC int cardbus_mem_find(cardbus_chipset_tag_t cc,
* cardbus_function_tag_t cf, cardbustag_t tag,
* int reg, cardbusreg_t type, bus_addr_t *basep,
* bus_size_t *sizep, int *flagsp)
* This code is stolen from sys/dev/pci_map.c.
*/
-static int
+STATIC int
cardbus_mem_find(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf,
cardbustag_t tag, int reg, cardbusreg_t type, bus_addr_t *basep,
bus_size_t *sizep, int *flagsp)
diff --git a/sys/dev/cardbus/cardslot.c b/sys/dev/cardbus/cardslot.c
index 1d7b6f00c9c..f0f1df86fcc 100644
--- a/sys/dev/cardbus/cardslot.c
+++ b/sys/dev/cardbus/cardslot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cardslot.c,v 1.7 2005/09/19 19:05:39 fgsch Exp $ */
+/* $OpenBSD: cardslot.c,v 1.8 2007/09/17 20:29:47 miod Exp $ */
/* $NetBSD: cardslot.c,v 1.9 2000/03/22 09:35:06 haya Exp $ */
/*
@@ -53,19 +53,23 @@
#define STATIC
#define DPRINTF(a) printf a
#else
+#ifdef DDB
+#define STATIC
+#else
#define STATIC static
+#endif
#define DPRINTF(a)
#endif
STATIC void cardslotattach(struct device *, struct device *, void *);
STATIC int cardslotmatch(struct device *, void *, void *);
-static void create_slot_manager(void *);
-static void cardslot_event_thread(void *arg);
+STATIC void create_slot_manager(void *);
+STATIC void cardslot_event_thread(void *arg);
STATIC int cardslot_cb_print(void *aux, const char *pcic);
-static int cardslot_16_print(void *, const char *);
-static int cardslot_16_submatch(struct device *, void *,void *);
+STATIC int cardslot_16_print(void *, const char *);
+STATIC int cardslot_16_submatch(struct device *, void *,void *);
struct cfattach cardslot_ca = {
sizeof(struct cardslot_softc), cardslotmatch, cardslotattach
@@ -160,7 +164,7 @@ cardslot_cb_print(void *aux, const char *pnp)
return (UNCONF);
}
-static int
+STATIC int
cardslot_16_submatch(struct device *parent, void *match, void *aux)
{
struct cfdata *cf = match;
@@ -174,7 +178,7 @@ cardslot_16_submatch(struct device *parent, void *match, void *aux)
return (0);
}
-static int
+STATIC int
cardslot_16_print(void *arg, const char *pnp)
{
if (pnp)
@@ -183,7 +187,7 @@ cardslot_16_print(void *arg, const char *pnp)
return (UNCONF);
}
-static void
+STATIC void
create_slot_manager(void *arg)
{
struct cardslot_softc *sc = (struct cardslot_softc *)arg;
@@ -232,13 +236,13 @@ cardslot_event_throw(struct cardslot_softc *sc, int ev)
}
/*
- * static void cardslot_event_thread(void *arg)
+ * STATIC void cardslot_event_thread(void *arg)
*
* This function is the main routine handing cardslot events such as
* insertions and removals.
*
*/
-static void
+STATIC void
cardslot_event_thread(void *arg)
{
struct cardslot_softc *sc = arg;
diff --git a/sys/dev/cardbus/rbus.c b/sys/dev/cardbus/rbus.c
index 43be6229c05..0a11c01d563 100644
--- a/sys/dev/cardbus/rbus.c
+++ b/sys/dev/cardbus/rbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rbus.c,v 1.10 2005/09/13 18:53:01 fgsch Exp $ */
+/* $OpenBSD: rbus.c,v 1.11 2007/09/17 20:29:47 miod Exp $ */
/* $NetBSD: rbus.c,v 1.3 1999/11/06 06:20:53 soren Exp $ */
/*
* Copyright (c) 1999
@@ -45,14 +45,17 @@
#if defined RBUS_DEBUG
#define STATIC
#define DPRINTF(a) printf a
-#define DDELAY(x) delay((x)*1000*1000)
+#else
+#ifdef DDB
+#define STATIC
#else
#define STATIC static
+#endif
#define DPRINTF(a)
#endif
-static rbus_tag_t rbus_new_body(bus_space_tag_t, rbus_tag_t, struct extent *,
+STATIC rbus_tag_t rbus_new_body(bus_space_tag_t, rbus_tag_t, struct extent *,
bus_addr_t, bus_addr_t, bus_addr_t, int);
int
@@ -186,13 +189,13 @@ rbus_space_free(rbus_tag_t rbt, bus_space_handle_t bsh, bus_size_t size,
}
/*
- * static rbus_tag_t
+ * STATIC rbus_tag_t
* rbus_new_body(bus_space_tag_t bt, rbus_tag_t parent,
* struct extent *ex, bus_addr_t start, bus_size_t end,
* bus_addr_t offset, int flags)
*
*/
-static rbus_tag_t
+STATIC rbus_tag_t
rbus_new_body(bus_space_tag_t bt, rbus_tag_t parent, struct extent *ex,
bus_addr_t start, bus_addr_t end, bus_addr_t offset, int flags)
{