diff options
author | 2007-12-06 22:49:39 +0000 | |
---|---|---|
committer | 2007-12-06 22:49:39 +0000 | |
commit | 70456743a159cff5b68cdf6f79f141f9f73f00ce (patch) | |
tree | 882db32693282b0c978514ad7c6eae6df86fc00b /sys | |
parent | solve the biggest problem with concurrent buflist access; makes mfs on (diff) | |
download | wireguard-openbsd-70456743a159cff5b68cdf6f79f141f9f73f00ce.tar.xz wireguard-openbsd-70456743a159cff5b68cdf6f79f141f9f73f00ce.zip |
Destatic functions in the agp subsystem.
KNF coming shortly.
ok marco, jsg and mbalmer
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/agp.c | 36 | ||||
-rw-r--r-- | sys/dev/pci/agp_amd.c | 29 | ||||
-rw-r--r-- | sys/dev/pci/agp_i810.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/agp_intel.c | 27 | ||||
-rw-r--r-- | sys/dev/pci/agp_sis.c | 24 | ||||
-rw-r--r-- | sys/dev/pci/agp_via.c | 24 | ||||
-rw-r--r-- | sys/dev/pci/agpvar.h | 3 |
7 files changed, 75 insertions, 72 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c index 7a073bc3771..2d8a4015ab5 100644 --- a/sys/dev/pci/agp.c +++ b/sys/dev/pci/agp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp.c,v 1.11 2007/11/28 16:25:58 chl Exp $ */ +/* $OpenBSD: agp.c,v 1.12 2007/12/06 22:49:39 oga Exp $ */ /*- * Copyright (c) 2000 Doug Rabson * All rights reserved. @@ -58,14 +58,14 @@ struct agp_memory *agp_find_memory(struct agp_softc *sc, int id); const struct agp_product *agp_lookup(struct pci_attach_args *pa); /* userland ioctl functions */ -static int agp_info_user(void *, agp_info *); -static int agp_setup_user(void *, agp_setup *); -static int agp_allocate_user(void *, agp_allocate *); -static int agp_deallocate_user(void *, int); -static int agp_bind_user(void *, agp_bind *); -static int agp_unbind_user(void *, agp_unbind *); -static int agp_acquire_helper(void *dev, enum agp_acquire_state state); -static int agp_release_helper(void *dev, enum agp_acquire_state state); +int agp_info_user(void *, agp_info *); +int agp_setup_user(void *, agp_setup *); +int agp_allocate_user(void *, agp_allocate *); +int agp_deallocate_user(void *, int); +int agp_bind_user(void *, agp_bind *); +int agp_unbind_user(void *, agp_unbind *); +int agp_acquire_helper(void *dev, enum agp_acquire_state state); +int agp_release_helper(void *dev, enum agp_acquire_state state); const struct agp_product agp_products[] = { #if NAGP_ALI > 0 @@ -111,7 +111,7 @@ const struct agp_product agp_products[] = { }; -static int +int agp_probe(struct device *parent, void *match, void *aux) { struct agpbus_attach_args *aaa = aux; @@ -726,7 +726,7 @@ agp_free_dmamem(bus_dma_tag_t tag, size_t size, bus_dmamap_t map, /* Helper functions used in both user and kernel APIs */ -static int +int agp_acquire_helper(void *dev, enum agp_acquire_state state) { struct agp_softc *sc = (struct agp_softc *)dev; @@ -738,7 +738,7 @@ agp_acquire_helper(void *dev, enum agp_acquire_state state) return (0); } -static int +int agp_release_helper(void *dev, enum agp_acquire_state state) { struct agp_softc *sc = (struct agp_softc *)dev; @@ -767,7 +767,7 @@ agp_release_helper(void *dev, enum agp_acquire_state state) /* Implementation of the userland ioctl API */ -static int +int agp_info_user(void *dev, agp_info *info) { struct agp_softc *sc = (struct agp_softc *) dev; @@ -791,14 +791,14 @@ agp_info_user(void *dev, agp_info *info) return (0); } -static int +int agp_setup_user(void *dev, agp_setup *setup) { struct agp_softc *sc = (struct agp_softc *) dev; return (AGP_ENABLE(sc, setup->agp_mode)); } -static int +int agp_allocate_user(void *dev, agp_allocate *alloc) { struct agp_softc *sc = (struct agp_softc *) dev; @@ -817,7 +817,7 @@ agp_allocate_user(void *dev, agp_allocate *alloc) return (ENOMEM); } -static int +int agp_deallocate_user(void *dev, int id) { struct agp_softc *sc = (struct agp_softc *) dev; @@ -829,7 +829,7 @@ agp_deallocate_user(void *dev, int id) return (ENOENT); } -static int +int agp_bind_user(void *dev, agp_bind *bind) { struct agp_softc *sc = (struct agp_softc *) dev; @@ -842,7 +842,7 @@ agp_bind_user(void *dev, agp_bind *bind) } -static int +int agp_unbind_user(void *dev, agp_unbind *unbind) { struct agp_softc *sc = (struct agp_softc *) dev; diff --git a/sys/dev/pci/agp_amd.c b/sys/dev/pci/agp_amd.c index 361a1ad1cde..eaad4787dd9 100644 --- a/sys/dev/pci/agp_amd.c +++ b/sys/dev/pci/agp_amd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_amd.c,v 1.6 2007/11/26 15:35:15 deraadt Exp $ */ +/* $OpenBSD: agp_amd.c,v 1.7 2007/12/06 22:49:39 oga Exp $ */ /* $NetBSD: agp_amd.c,v 1.6 2001/10/06 02:48:50 thorpej Exp $ */ @@ -74,11 +74,12 @@ struct agp_amd_softc { bus_space_tag_t iot; }; -static u_int32_t agp_amd_get_aperture(struct agp_softc *); -static int agp_amd_set_aperture(struct agp_softc *, u_int32_t); -static int agp_amd_bind_page(struct agp_softc *, off_t, bus_addr_t); -static int agp_amd_unbind_page(struct agp_softc *, off_t); -static void agp_amd_flush_tlb(struct agp_softc *); +u_int32_t agp_amd_get_aperture(struct agp_softc *); +struct agp_amd_gatt * agp_amd_alloc_gatt(struct agp_softc *); +int agp_amd_set_aperture(struct agp_softc *, u_int32_t); +int agp_amd_bind_page(struct agp_softc *, off_t, bus_addr_t); +int agp_amd_unbind_page(struct agp_softc *, off_t); +void agp_amd_flush_tlb(struct agp_softc *); struct agp_methods agp_amd_methods = { @@ -95,7 +96,7 @@ struct agp_methods agp_amd_methods = { }; -static struct agp_amd_gatt * +struct agp_amd_gatt * agp_amd_alloc_gatt(struct agp_softc *sc) { u_int32_t apsize = AGP_GET_APERTURE(sc); @@ -144,7 +145,7 @@ agp_amd_alloc_gatt(struct agp_softc *sc) } #if 0 -static void +void agp_amd_free_gatt(struct agp_softc *sc, struct agp_amd_gatt *gatt) { agp_free_dmamem(sc->sc_dmat, gatt->ag_size, @@ -220,7 +221,7 @@ agp_amd_attach(struct agp_softc *sc, struct pci_attach_args *pa) } #if 0 -static int +int agp_amd_detach(struct agp_softc *sc) { pcireg_t reg; @@ -249,7 +250,7 @@ agp_amd_detach(struct agp_softc *sc) } #endif -static u_int32_t +u_int32_t agp_amd_get_aperture(struct agp_softc *sc) { int vas; @@ -263,7 +264,7 @@ agp_amd_get_aperture(struct agp_softc *sc) return ((32 * 1024 * 1024) << vas); } -static int +int agp_amd_set_aperture(struct agp_softc *sc, u_int32_t aperture) { int vas; @@ -287,7 +288,7 @@ agp_amd_set_aperture(struct agp_softc *sc, u_int32_t aperture) return (0); } -static int +int agp_amd_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) { struct agp_amd_softc *asc = sc->sc_chipc; @@ -299,7 +300,7 @@ agp_amd_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) return (0); } -static int +int agp_amd_unbind_page(struct agp_softc *sc, off_t offset) { struct agp_amd_softc *asc = sc->sc_chipc; @@ -311,7 +312,7 @@ agp_amd_unbind_page(struct agp_softc *sc, off_t offset) return (0); } -static void +void agp_amd_flush_tlb(struct agp_softc *sc) { struct agp_amd_softc *asc = sc->sc_chipc; diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c index e62529daff7..65297a9c9f1 100644 --- a/sys/dev/pci/agp_i810.c +++ b/sys/dev/pci/agp_i810.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_i810.c,v 1.24 2007/12/02 14:44:20 oga Exp $ */ +/* $OpenBSD: agp_i810.c,v 1.25 2007/12/06 22:49:39 oga Exp $ */ /* $NetBSD: agp_i810.c,v 1.15 2003/01/31 00:07:39 thorpej Exp $ */ /*- @@ -437,7 +437,7 @@ agp_i810_attach(struct agp_softc *sc, struct pci_attach_args *pa) } #if 0 -static int +int agp_i810_detach(struct agp_softc *sc) { int error; diff --git a/sys/dev/pci/agp_intel.c b/sys/dev/pci/agp_intel.c index 931f29c8bee..05374afffe1 100644 --- a/sys/dev/pci/agp_intel.c +++ b/sys/dev/pci/agp_intel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_intel.c,v 1.7 2007/11/26 15:35:15 deraadt Exp $ */ +/* $OpenBSD: agp_intel.c,v 1.8 2007/12/06 22:49:39 oga Exp $ */ /* $NetBSD: agp_intel.c,v 1.3 2001/09/15 00:25:00 thorpej Exp $ */ /*- @@ -64,11 +64,12 @@ struct agp_intel_softc { }; -static u_int32_t agp_intel_get_aperture(struct agp_softc *); -static int agp_intel_set_aperture(struct agp_softc *, u_int32_t); -static int agp_intel_bind_page(struct agp_softc *, off_t, bus_addr_t); -static int agp_intel_unbind_page(struct agp_softc *, off_t); -static void agp_intel_flush_tlb(struct agp_softc *); +int agp_intel_vgamatch(struct pci_attach_args *); +u_int32_t agp_intel_get_aperture(struct agp_softc *); +int agp_intel_set_aperture(struct agp_softc *, u_int32_t); +int agp_intel_bind_page(struct agp_softc *, off_t, bus_addr_t); +int agp_intel_unbind_page(struct agp_softc *, off_t); +void agp_intel_flush_tlb(struct agp_softc *); struct agp_methods agp_intel_methods = { agp_intel_get_aperture, @@ -83,7 +84,7 @@ struct agp_methods agp_intel_methods = { agp_generic_unbind_memory, }; -static int +int agp_intel_vgamatch(struct pci_attach_args *pa) { switch (PCI_PRODUCT(pa->pa_id)) { @@ -250,7 +251,7 @@ agp_intel_attach(struct agp_softc *sc, struct pci_attach_args *pa) } #if 0 -static int +int agp_intel_detach(struct agp_softc *sc) { int error; @@ -274,7 +275,7 @@ agp_intel_detach(struct agp_softc *sc) } #endif -static u_int32_t +u_int32_t agp_intel_get_aperture(struct agp_softc *sc) { struct agp_intel_softc *isc = sc->sc_chipc; @@ -293,7 +294,7 @@ agp_intel_get_aperture(struct agp_softc *sc) return ((((apsize ^ isc->aperture_mask) << 22) | ((1 << 22) - 1)) + 1); } -static int +int agp_intel_set_aperture(struct agp_softc *sc, u_int32_t aperture) { struct agp_intel_softc *isc = sc->sc_chipc; @@ -316,7 +317,7 @@ agp_intel_set_aperture(struct agp_softc *sc, u_int32_t aperture) return (0); } -static int +int agp_intel_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) { struct agp_intel_softc *isc = sc->sc_chipc; @@ -328,7 +329,7 @@ agp_intel_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) return (0); } -static int +int agp_intel_unbind_page(struct agp_softc *sc, off_t offset) { struct agp_intel_softc *isc = sc->sc_chipc; @@ -340,7 +341,7 @@ agp_intel_unbind_page(struct agp_softc *sc, off_t offset) return (0); } -static void +void agp_intel_flush_tlb(struct agp_softc *sc) { struct agp_intel_softc *isc = sc->sc_chipc; diff --git a/sys/dev/pci/agp_sis.c b/sys/dev/pci/agp_sis.c index 871dea45816..e0fa150f62f 100644 --- a/sys/dev/pci/agp_sis.c +++ b/sys/dev/pci/agp_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_sis.c,v 1.5 2007/11/26 15:35:15 deraadt Exp $ */ +/* $OpenBSD: agp_sis.c,v 1.6 2007/12/06 22:49:39 oga Exp $ */ /* $NetBSD: agp_sis.c,v 1.2 2001/09/15 00:25:00 thorpej Exp $ */ /*- @@ -53,11 +53,11 @@ struct agp_sis_softc { struct agp_gatt *gatt; }; -static u_int32_t agp_sis_get_aperture(struct agp_softc *); -static int agp_sis_set_aperture(struct agp_softc *, u_int32_t); -static int agp_sis_bind_page(struct agp_softc *, off_t, bus_addr_t); -static int agp_sis_unbind_page(struct agp_softc *, off_t); -static void agp_sis_flush_tlb(struct agp_softc *); +u_int32_t agp_sis_get_aperture(struct agp_softc *); +int agp_sis_set_aperture(struct agp_softc *, u_int32_t); +int agp_sis_bind_page(struct agp_softc *, off_t, bus_addr_t); +int agp_sis_unbind_page(struct agp_softc *, off_t); +void agp_sis_flush_tlb(struct agp_softc *); struct agp_methods agp_sis_methods = { agp_sis_get_aperture, @@ -126,7 +126,7 @@ agp_sis_attach(struct agp_softc *sc, struct pci_attach_args *pa) } #if 0 -static int +int agp_sis_detach(struct agp_softc *sc) { struct agp_sis_softc *ssc = sc->sc_chipc; @@ -150,7 +150,7 @@ agp_sis_detach(struct agp_softc *sc) } #endif -static u_int32_t +u_int32_t agp_sis_get_aperture(struct agp_softc *sc) { int gws; @@ -163,7 +163,7 @@ agp_sis_get_aperture(struct agp_softc *sc) return ((4 * 1024 * 1024) << gws); } -static int +int agp_sis_set_aperture(struct agp_softc *sc, u_int32_t aperture) { int gws; @@ -188,7 +188,7 @@ agp_sis_set_aperture(struct agp_softc *sc, u_int32_t aperture) return (0); } -static int +int agp_sis_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) { struct agp_sis_softc *ssc = sc->sc_chipc; @@ -200,7 +200,7 @@ agp_sis_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) return (0); } -static int +int agp_sis_unbind_page(struct agp_softc *sc, off_t offset) { struct agp_sis_softc *ssc = sc->sc_chipc; @@ -212,7 +212,7 @@ agp_sis_unbind_page(struct agp_softc *sc, off_t offset) return (0); } -static void +void agp_sis_flush_tlb(struct agp_softc *sc) { pcireg_t reg; diff --git a/sys/dev/pci/agp_via.c b/sys/dev/pci/agp_via.c index feb0c32e889..374b8c94e81 100644 --- a/sys/dev/pci/agp_via.c +++ b/sys/dev/pci/agp_via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_via.c,v 1.6 2007/11/26 15:35:15 deraadt Exp $ */ +/* $OpenBSD: agp_via.c,v 1.7 2007/12/06 22:49:39 oga Exp $ */ /* $NetBSD: agp_via.c,v 1.2 2001/09/15 00:25:00 thorpej Exp $ */ /*- @@ -48,11 +48,11 @@ #include <machine/bus.h> -static u_int32_t agp_via_get_aperture(struct agp_softc *); -static int agp_via_set_aperture(struct agp_softc *, u_int32_t); -static int agp_via_bind_page(struct agp_softc *, off_t, bus_addr_t); -static int agp_via_unbind_page(struct agp_softc *, off_t); -static void agp_via_flush_tlb(struct agp_softc *); +u_int32_t agp_via_get_aperture(struct agp_softc *); +int agp_via_set_aperture(struct agp_softc *, u_int32_t); +int agp_via_bind_page(struct agp_softc *, off_t, bus_addr_t); +int agp_via_unbind_page(struct agp_softc *, off_t); +void agp_via_flush_tlb(struct agp_softc *); struct agp_methods agp_via_methods = { agp_via_get_aperture, @@ -161,7 +161,7 @@ agp_via_attach(struct agp_softc *sc, struct pci_attach_args *pa) } #if 0 -static int +int agp_via_detach(struct agp_softc *sc) { struct agp_via_softc *asc = sc->sc_chipc; @@ -180,7 +180,7 @@ agp_via_detach(struct agp_softc *sc) } #endif -static u_int32_t +u_int32_t agp_via_get_aperture(struct agp_softc *sc) { struct agp_via_softc *asc = sc->sc_chipc; @@ -199,7 +199,7 @@ agp_via_get_aperture(struct agp_softc *sc) return ((((apsize ^ 0xff) << 20) | ((1 << 20) - 1)) + 1); } -static int +int agp_via_set_aperture(struct agp_softc *sc, u_int32_t aperture) { struct agp_via_softc *asc = sc->sc_chipc; @@ -225,7 +225,7 @@ agp_via_set_aperture(struct agp_softc *sc, u_int32_t aperture) return (0); } -static int +int agp_via_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) { struct agp_via_softc *asc = sc->sc_chipc; @@ -237,7 +237,7 @@ agp_via_bind_page(struct agp_softc *sc, off_t offset, bus_addr_t physical) return (0); } -static int +int agp_via_unbind_page(struct agp_softc *sc, off_t offset) { struct agp_via_softc *asc = sc->sc_chipc; @@ -249,7 +249,7 @@ agp_via_unbind_page(struct agp_softc *sc, off_t offset) return (0); } -static void +void agp_via_flush_tlb(struct agp_softc *sc) { struct agp_via_softc *asc = sc->sc_chipc; diff --git a/sys/dev/pci/agpvar.h b/sys/dev/pci/agpvar.h index ee16085b077..9a6cff21007 100644 --- a/sys/dev/pci/agpvar.h +++ b/sys/dev/pci/agpvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: agpvar.h,v 1.7 2007/11/25 17:11:12 oga Exp $ */ +/* $OpenBSD: agpvar.h,v 1.8 2007/12/06 22:49:39 oga Exp $ */ /* $NetBSD: agpvar.h,v 1.4 2001/10/01 21:54:48 fvdl Exp $ */ /*- @@ -169,6 +169,7 @@ struct agp_product { extern const struct agp_product agp_products[]; void agp_attach(struct device *, struct device *, void *); +int agp_probe(struct device *, void *, void *); paddr_t agpmmap(void *, off_t, int); int agpioctl(dev_t, u_long, caddr_t, int, struct proc *); int agpopen(dev_t, int, int, struct proc *); |