Use simple fixed name strings for these timecounters and eventimers which
are tied to fixed pieces of hardware; dynamic string formatting isn't needed.
This commit is contained in:
parent
13b2a10416
commit
8a7e63e880
@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define BCM2835_NUM_TIMERS 4
|
||||
|
||||
#define DEFAULT_TIMER 3
|
||||
#define DEFAULT_TIMER_NAME "BCM2835-3"
|
||||
#define DEFAULT_FREQUENCY 1000000
|
||||
#define MIN_PERIOD 5LLU
|
||||
|
||||
@ -101,7 +102,7 @@ static struct bcm_systimer_softc *bcm_systimer_sc = NULL;
|
||||
static unsigned bcm_systimer_tc_get_timecount(struct timecounter *);
|
||||
|
||||
static struct timecounter bcm_systimer_tc = {
|
||||
.tc_name = "BCM2835 Timecounter",
|
||||
.tc_name = DEFAULT_TIMER_NAME,
|
||||
.tc_get_timecount = bcm_systimer_tc_get_timecount,
|
||||
.tc_poll_pps = NULL,
|
||||
.tc_counter_mask = ~0u,
|
||||
@ -238,8 +239,7 @@ bcm_systimer_attach(device_t dev)
|
||||
|
||||
sc->st[DEFAULT_TIMER].index = DEFAULT_TIMER;
|
||||
sc->st[DEFAULT_TIMER].enabled = 0;
|
||||
sc->st[DEFAULT_TIMER].et.et_name = malloc(64, M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
sprintf(sc->st[DEFAULT_TIMER].et.et_name, "BCM2835 Event Timer %d", DEFAULT_TIMER);
|
||||
sc->st[DEFAULT_TIMER].et.et_name = DEFAULT_TIMER_NAME;
|
||||
sc->st[DEFAULT_TIMER].et.et_flags = ET_FLAGS_ONESHOT;
|
||||
sc->st[DEFAULT_TIMER].et.et_quality = 1000;
|
||||
sc->st[DEFAULT_TIMER].et.et_frequency = sc->sysclk_freq;
|
||||
|
@ -244,7 +244,7 @@ sp804_timer_attach(device_t dev)
|
||||
* Timer 1, timecounter
|
||||
*/
|
||||
sc->tc.tc_frequency = sc->sysclk_freq;
|
||||
sc->tc.tc_name = "SP804 Time Counter";
|
||||
sc->tc.tc_name = "SP804-1";
|
||||
sc->tc.tc_get_timecount = sp804_timer_tc_get_timecount;
|
||||
sc->tc.tc_poll_pps = NULL;
|
||||
sc->tc.tc_counter_mask = ~0u;
|
||||
@ -263,9 +263,7 @@ sp804_timer_attach(device_t dev)
|
||||
* Timer 2, event timer
|
||||
*/
|
||||
sc->et_enabled = 0;
|
||||
sc->et.et_name = malloc(64, M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
sprintf(sc->et.et_name, "SP804 Event Timer %d",
|
||||
device_get_unit(dev));
|
||||
sc->et.et_name = "SP804-2";
|
||||
sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT;
|
||||
sc->et.et_quality = 1000;
|
||||
sc->et.et_frequency = sc->sysclk_freq / DEFAULT_DIVISOR;
|
||||
|
Loading…
Reference in New Issue
Block a user