diff options
author | marius <marius@FreeBSD.org> | 2008-05-07 21:22:15 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2008-05-07 21:22:15 +0000 |
commit | 57e87ccecba1cf8105d49f6403df79e7ec9960ed (patch) | |
tree | 8c981a4b54e567c6ee9de5615f4b1f1df4b2d718 /sys/sparc64/sparc64/counter.c | |
parent | 1960aee8832e4bb01564e1c0a25fba64d5a74d68 (diff) | |
download | FreeBSD-src-57e87ccecba1cf8105d49f6403df79e7ec9960ed.zip FreeBSD-src-57e87ccecba1cf8105d49f6403df79e7ec9960ed.tar.gz |
- Use the name returned by device_get_nameunit(9) for the name of the
counter-timer timecounter so the associated SYSCTL nodes don't clash on
machines having multiple U2P and U2S bridges as well as establishing a
clear mapping between these bridges and their timecounter device.
- Don't bother setting up a "nice" name for the IOMMU, just use the name
returned by device_get_nameunit(9), too.
- Fix some minor style(9) bugs.
- Use __FBSDID in counter.c
MFC after: 1 week
Diffstat (limited to 'sys/sparc64/sparc64/counter.c')
-rw-r--r-- | sys/sparc64/sparc64/counter.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/sparc64/sparc64/counter.c b/sys/sparc64/sparc64/counter.c index 3e93465..cb9241a 100644 --- a/sys/sparc64/sparc64/counter.c +++ b/sys/sparc64/sparc64/counter.c @@ -21,10 +21,11 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/bus.h> #include <sys/malloc.h> @@ -53,7 +54,7 @@ #define CTR_LIMIT 0x08 -static unsigned int counter_get_timecount(struct timecounter *tc); +static timecounter_get_t counter_get_timecount; struct ct_softc { bus_space_tag_t sc_tag; @@ -63,21 +64,22 @@ struct ct_softc { /* - * This is called from the psycho and sbus drivers. It does not directly attach - * to the nexus because it shares register space with the bridge in question. + * This is called from the psycho and sbus drivers. It does not directly + * attach to the nexus because it shares register space with the bridge in + * question. */ void -sparc64_counter_init(bus_space_tag_t tag, bus_space_handle_t handle, - bus_addr_t offset) +sparc64_counter_init(const char *name, bus_space_tag_t tag, + bus_space_handle_t handle, bus_addr_t offset) { struct timecounter *tc; struct ct_softc *sc; printf("initializing counter-timer\n"); /* - * Turn off interrupts from both counters. Set the limit to the maximum - * value (although that should not change anything with CTLR_INTEN and - * CTLR_PERIODIC off). + * Turn off interrupts from both counters. Set the limit to the + * maximum value (although that should not change anything with + * CTLR_INTEN and CTLR_PERIODIC off). */ bus_space_write_8(tag, handle, offset + CTR_CT0 + CTR_LIMIT, COUNTER_MASK); @@ -93,7 +95,7 @@ sparc64_counter_init(bus_space_tag_t tag, bus_space_handle_t handle, tc->tc_poll_pps = NULL; tc->tc_counter_mask = COUNTER_MASK; tc->tc_frequency = COUNTER_FREQ; - tc->tc_name = "counter-timer"; + tc->tc_name = strdup(name, M_DEVBUF); tc->tc_priv = sc; tc->tc_quality = COUNTER_QUALITY; tc_init(tc); |