zephyr: replace zephyr integer types with C99 types

git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-05-27 11:26:57 -05:00 committed by Kumar Gala
commit a1b77fd589
2364 changed files with 32505 additions and 32505 deletions

View file

@ -29,12 +29,12 @@
BUILD_ASSERT(MIN_DELAY < CYC_PER_TICK);
static struct k_spinlock lock;
static u64_t last_count;
static uint64_t last_count;
static volatile struct soc_dsp_shim_regs *shim_regs =
(volatile struct soc_dsp_shim_regs *)SOC_DSP_SHIM_REG_BASE;
static void set_compare(u64_t time)
static void set_compare(uint64_t time)
{
#if (TIMER == 0)
/* Set compare register */
@ -50,12 +50,12 @@ static void set_compare(u64_t time)
shim_regs->dspwctcs |= DSP_WCT_CS_TA(TIMER);
}
static u64_t count(void)
static uint64_t count(void)
{
return shim_regs->walclk;
}
static u32_t count32(void)
static uint32_t count32(void)
{
return shim_regs->walclk32_lo;
}
@ -63,8 +63,8 @@ static u32_t count32(void)
static void compare_isr(void *arg)
{
ARG_UNUSED(arg);
u64_t curr;
u32_t dticks;
uint64_t curr;
uint32_t dticks;
k_spinlock_key_t key = k_spin_lock(&lock);
@ -77,13 +77,13 @@ static void compare_isr(void *arg)
* Since it has already been processed and
* ticks announced, skip it.
*/
if ((count32() - (u32_t)last_count) < MIN_DELAY) {
if ((count32() - (uint32_t)last_count) < MIN_DELAY) {
k_spin_unlock(&lock, key);
return;
}
#endif
dticks = (u32_t)((curr - last_count) / CYC_PER_TICK);
dticks = (uint32_t)((curr - last_count) / CYC_PER_TICK);
/* Clear the triggered bit */
shim_regs->dspwctcs |= DSP_WCT_CS_TT(TIMER);
@ -91,9 +91,9 @@ static void compare_isr(void *arg)
last_count += dticks * CYC_PER_TICK;
#ifndef CONFIG_TICKLESS_KERNEL
u64_t next = last_count + CYC_PER_TICK;
uint64_t next = last_count + CYC_PER_TICK;
if ((s64_t)(next - curr) < MIN_DELAY) {
if ((int64_t)(next - curr) < MIN_DELAY) {
next += CYC_PER_TICK;
}
set_compare(next);
@ -106,7 +106,7 @@ static void compare_isr(void *arg)
int z_clock_driver_init(struct device *device)
{
u64_t curr = count();
uint64_t curr = count();
IRQ_CONNECT(TIMER_IRQ, 0, compare_isr, 0, 0);
set_compare(curr + CYC_PER_TICK);
@ -115,21 +115,21 @@ int z_clock_driver_init(struct device *device)
return 0;
}
void z_clock_set_timeout(s32_t ticks, bool idle)
void z_clock_set_timeout(int32_t ticks, bool idle)
{
ARG_UNUSED(idle);
#ifdef CONFIG_TICKLESS_KERNEL
ticks = ticks == K_TICKS_FOREVER ? MAX_TICKS : ticks;
ticks = MAX(MIN(ticks - 1, (s32_t)MAX_TICKS), 0);
ticks = MAX(MIN(ticks - 1, (int32_t)MAX_TICKS), 0);
k_spinlock_key_t key = k_spin_lock(&lock);
u64_t curr = count();
u64_t next;
u32_t adj, cyc = ticks * CYC_PER_TICK;
uint64_t curr = count();
uint64_t next;
uint32_t adj, cyc = ticks * CYC_PER_TICK;
/* Round up to next tick boundary */
adj = (u32_t)(curr - last_count) + (CYC_PER_TICK - 1);
adj = (uint32_t)(curr - last_count) + (CYC_PER_TICK - 1);
if (cyc <= MAX_CYC - adj) {
cyc += adj;
} else {
@ -138,7 +138,7 @@ void z_clock_set_timeout(s32_t ticks, bool idle)
cyc = (cyc / CYC_PER_TICK) * CYC_PER_TICK;
next = last_count + cyc;
if (((u32_t)next - (u32_t)curr) < MIN_DELAY) {
if (((uint32_t)next - (uint32_t)curr) < MIN_DELAY) {
next += CYC_PER_TICK;
}
@ -147,19 +147,19 @@ void z_clock_set_timeout(s32_t ticks, bool idle)
#endif
}
u32_t z_clock_elapsed(void)
uint32_t z_clock_elapsed(void)
{
if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) {
return 0;
}
k_spinlock_key_t key = k_spin_lock(&lock);
u32_t ret = (count32() - (u32_t)last_count) / CYC_PER_TICK;
uint32_t ret = (count32() - (uint32_t)last_count) / CYC_PER_TICK;
k_spin_unlock(&lock, key);
return ret;
}
u32_t z_timer_cycle_get_32(void)
uint32_t z_timer_cycle_get_32(void)
{
return count32();
}