diff options
author | ian <ian@FreeBSD.org> | 2014-05-06 13:38:34 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-05-06 13:38:34 +0000 |
commit | 937f4c401720deae4260c3dfaa04dc286f6d41d2 (patch) | |
tree | 656814f7d903ee8f7f04359c295028e43f0bf3fd | |
parent | a1bd83e68918ec33640cd5226157b5ad6e57226b (diff) | |
download | FreeBSD-src-937f4c401720deae4260c3dfaa04dc286f6d41d2.zip FreeBSD-src-937f4c401720deae4260c3dfaa04dc286f6d41d2.tar.gz |
Move the pl310.enabled tunable to hw.pl310.enabled. Clean up a few minor
style(9) nits. Use DEVMETHOD_END.
-rw-r--r-- | sys/arm/arm/pl310.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arm/arm/pl310.c b/sys/arm/arm/pl310.c index b087365..86cf5e5 100644 --- a/sys/arm/arm/pl310.c +++ b/sys/arm/arm/pl310.c @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); } while(0); static int pl310_enabled = 1; -TUNABLE_INT("pl310.enabled", &pl310_enabled); +TUNABLE_INT("hw.pl310.enabled", &pl310_enabled); static uint32_t g_l2cache_way_mask; @@ -149,7 +149,8 @@ static __inline void pl310_wait_background_op(uint32_t off, uint32_t mask) { - while (pl310_read4(pl310_softc, off) & mask); + while (pl310_read4(pl310_softc, off) & mask) + continue; } @@ -167,6 +168,7 @@ pl310_wait_background_op(uint32_t off, uint32_t mask) static __inline void pl310_cache_sync(void) { + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) return; @@ -335,12 +337,13 @@ static int pl310_attach(device_t dev) { struct pl310_softc *sc = device_get_softc(dev); - int rid = 0; + int rid; uint32_t aux_value; uint32_t ctrl_value; uint32_t cache_id; sc->sc_dev = dev; + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) @@ -446,7 +449,7 @@ pl310_attach(device_t dev) static device_method_t pl310_methods[] = { DEVMETHOD(device_probe, pl310_probe), DEVMETHOD(device_attach, pl310_attach), - {0, 0}, + DEVMETHOD_END }; static driver_t pl310_driver = { |