diff --git a/arch/arc/core/fault.c b/arch/arc/core/fault.c index e5d665871fd..82ccc5c3da2 100644 --- a/arch/arc/core/fault.c +++ b/arch/arc/core/fault.c @@ -53,7 +53,7 @@ void _FaultDump(const NANO_ESF *esf, int fault) u32_t exc_addr = _arc_v2_aux_reg_read(_ARC_V2_EFA); u32_t ecr = _arc_v2_aux_reg_read(_ARC_V2_ECR); - PR_EXC("Exception vector: 0x%x, cause code: 0x%x, parameter 0x%xn", + PR_EXC("Exception vector: 0x%x, cause code: 0x%x, parameter 0x%x\n", _ARC_V2_ECR_VECTOR(ecr), _ARC_V2_ECR_CODE(ecr), _ARC_V2_ECR_PARAMETER(ecr)); diff --git a/arch/arc/core/irq_manage.c b/arch/arc/core/irq_manage.c index 11f1e5bf870..7b4d851a2ef 100644 --- a/arch/arc/core/irq_manage.c +++ b/arch/arc/core/irq_manage.c @@ -74,7 +74,7 @@ void _arch_irq_disable(unsigned int irq) * @return N/A */ -void _irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) +void _irq_priority_set(unsigned int irq, unsigned int prio, u32_t flags) { ARG_UNUSED(flags); diff --git a/arch/arm/core/cortex_m/exc_manage.c b/arch/arm/core/cortex_m/exc_manage.c index d421957702c..09a0d4f2aea 100644 --- a/arch/arm/core/cortex_m/exc_manage.c +++ b/arch/arm/core/cortex_m/exc_manage.c @@ -15,24 +15,23 @@ #include void sys_exc_esf_dump(NANO_ESF *esf) { - printk("r0/a1: %" PRIx32 " ", esf->a1); - printk("r1/a2: %" PRIx32 " ", esf->a2); - printk("r2/a3: %" PRIx32 "\n", esf->a3); - printk("r3/a4: %" PRIx32 " ", esf->a4); - printk("r12/ip: %" PRIx32 " ", esf->ip); - printk("r14/lr: %" PRIx32 "\n", esf->lr); - printk("r15/pc: %" PRIx32 " ", esf->pc); - printk("xpsr: %" PRIx32 "\n", esf->xpsr); + printk("r0/a1: %x ", esf->a1); + printk("r1/a2: %x ", esf->a2); + printk("r2/a3: %x\n", esf->a3); + printk("r3/a4: %x ", esf->a4); + printk("r12/ip: %x ", esf->ip); + printk("r14/lr: %x\n", esf->lr); + printk("r15/pc: %x ", esf->pc); + printk("xpsr: %x\n", esf->xpsr); #ifdef CONFIG_FLOAT for (int i = 0; i < 16; i += 4) { - printk("s[%d]: %" PRIx32 " s[%d]: %" PRIx32 " s[%d]: %" - PRIx32 " s[%d]: %" PRIx32 "\n", - i, (uint32_t)esf->s[i], - i + 1, (uint32_t)esf->s[i + 1], - i + 2, (uint32_t)esf->s[i + 2], - i + 3, (uint32_t)esf->s[i + 3]); + printk("s[%d]: %x s[%d]: %x s[%d]: %x s[%d]: %x\n", + i, (u32_t)esf->s[i], + i + 1, (u32_t)esf->s[i + 1], + i + 2, (u32_t)esf->s[i + 2], + i + 3, (u32_t)esf->s[i + 3]); } - printk("fpscr: %" PRIx32 "\n", esf->fpscr); + printk("fpscr: %x\n", esf->fpscr); #endif } diff --git a/arch/arm/core/fatal.c b/arch/arm/core/fatal.c index d5a2308176e..ae3004e1d84 100644 --- a/arch/arm/core/fatal.c +++ b/arch/arm/core/fatal.c @@ -89,7 +89,7 @@ FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason, break; } PR_EXC("Current thread ID = %p\n" - "Faulting instruction address = 0x%" PRIx32 "\n", + "Faulting instruction address = 0x%x\n", k_current_get(), pEsf->pc); /* diff --git a/arch/arm/core/fault.c b/arch/arm/core/fault.c index 7cc7234c12f..6e363756ad2 100644 --- a/arch/arm/core/fault.c +++ b/arch/arm/core/fault.c @@ -54,7 +54,7 @@ */ void _FaultDump(const NANO_ESF *esf, int fault) { - PR_EXC("Fault! EXC #%d, Thread: %p, instr @ 0x%" PRIx32 "\n", + PR_EXC("Fault! EXC #%d, Thread: %p, instr @ 0x%x\n", fault, k_current_get(), esf->pc); @@ -70,18 +70,18 @@ void _FaultDump(const NANO_ESF *esf, int fault) : "Bus fault on vector table read\n"); } - PR_EXC("MMFSR: 0x%" PRIx32 ", BFSR: 0x%" PRIx32 ", UFSR: 0x%" - PRIx32 "\n", SCB_MMFSR, SCB_BFSR, SCB_MMFSR); + PR_EXC("MMFSR: 0x%x, BFSR: 0x%x, UFSR: 0x%x\n", + SCB_MMFSR, SCB_BFSR, SCB_MMFSR); if (SCB->CFSR & CFSR_MMARVALID_Msk) { - PR_EXC("MMFAR: 0x%" PRIx32 "\n", SCB->MMFAR); + PR_EXC("MMFAR: 0x%x\n", SCB->MMFAR); if (escalation) { /* clear MMAR[VALID] to reset */ SCB->CFSR &= ~CFSR_MMARVALID_Msk; } } if (SCB->CFSR & CFSR_BFARVALID_Msk) { - PR_EXC("BFAR: 0x%" PRIx32 "\n", SCB->BFAR); + PR_EXC("BFAR: 0x%x\n", SCB->BFAR); if (escalation) { /* clear CFSR_BFAR[VALID] to reset */ SCB->CFSR &= ~CFSR_BFARVALID_Msk; @@ -108,7 +108,7 @@ void _FaultDump(const NANO_ESF *esf, int fault) static void _FaultThreadShow(const NANO_ESF *esf) { PR_EXC(" Executing thread ID (thread): %p\n" - " Faulting instruction address: 0x%" PRIx32 "\n", + " Faulting instruction address: 0x%x\n", k_current_get(), esf->pc); } @@ -136,7 +136,7 @@ static void _MpuFault(const NANO_ESF *esf, int fromHardFault) } else if (SCB->CFSR & CFSR_DACCVIOL_Msk) { PR_EXC(" Data Access Violation\n"); if (SCB->CFSR & CFSR_MMARVALID_Msk) { - PR_EXC(" Address: 0x%" PRIx32 "\n", SCB->MMFAR); + PR_EXC(" Address: 0x%x\n", (u32_t)SCB->MMFAR); if (fromHardFault) { /* clear MMAR[VALID] to reset */ SCB->CFSR &= ~CFSR_MMARVALID_Msk; @@ -168,7 +168,7 @@ static void _BusFault(const NANO_ESF *esf, int fromHardFault) } else if (SCB->CFSR & CFSR_PRECISERR_Msk) { PR_EXC(" Precise data bus error\n"); if (SCB->CFSR & CFSR_BFARVALID_Msk) { - PR_EXC(" Address: 0x%" PRIx32 "\n", SCB->BFAR); + PR_EXC(" Address: 0x%x\n", (u32_t)SCB->BFAR); if (fromHardFault) { /* clear CFSR_BFAR[VALID] to reset */ SCB->CFSR &= ~CFSR_BFARVALID_Msk; diff --git a/arch/arm/core/irq_manage.c b/arch/arm/core/irq_manage.c index 02967458e9e..54440eed097 100644 --- a/arch/arm/core/irq_manage.c +++ b/arch/arm/core/irq_manage.c @@ -82,7 +82,7 @@ int _arch_irq_is_enabled(unsigned int irq) * * @return N/A */ -void _irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) +void _irq_priority_set(unsigned int irq, unsigned int prio, u32_t flags) { /* Hardware priority levels 0 and 1 reserved for Kernel use. * So we add 2 to the requested priority level. If we support diff --git a/arch/nios2/core/fatal.c b/arch/nios2/core/fatal.c index 676424d0efa..8ffa942dd46 100644 --- a/arch/nios2/core/fatal.c +++ b/arch/nios2/core/fatal.c @@ -78,16 +78,12 @@ FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason, * registers, at the expense of some stack space. */ printk("Current thread ID: %p\n" - "Faulting instruction: 0x%" PRIx32 "\n" - " r1: 0x%" PRIx32 " r2: 0x%" PRIx32 - " r3: 0x%" PRIx32 " r4: 0x%" PRIx32 "\n" - " r5: 0x%" PRIx32 " r6: 0x%" PRIx32 - " r7: 0x%" PRIx32 " r8: 0x%" PRIx32 "\n" - " r9: 0x%" PRIx32 " r10: 0x%" PRIx32 - " r11: 0x%" PRIx32 " r12: 0x%" PRIx32 "\n" - " r13: 0x%" PRIx32 " r14: 0x%" PRIx32 - " r15: 0x%" PRIx32 " ra: 0x%" PRIx32 "\n" - "estatus: %" PRIx32 "\n", k_current_get(), esf->instr - 4, + "Faulting instruction: 0x%x\n" + " r1: 0x%x r2: 0x%x r3: 0x%x r4: 0x%x\n" + " r5: 0x%x r6: 0x%x r7: 0x%x r8: 0x%x\n" + " r9: 0x%x r10: 0x%x r11: 0x%x r12: 0x%x\n" + " r13: 0x%x r14: 0x%x r15: 0x%x ra: 0x%x\n" + "estatus: %x\n", k_current_get(), esf->instr - 4, esf->r1, esf->r2, esf->r3, esf->r4, esf->r5, esf->r6, esf->r7, esf->r8, esf->r9, esf->r10, esf->r11, esf->r12, diff --git a/arch/riscv32/core/fatal.c b/arch/riscv32/core/fatal.c index 54f62c02d40..1af24cbe084 100644 --- a/arch/riscv32/core/fatal.c +++ b/arch/riscv32/core/fatal.c @@ -91,16 +91,12 @@ FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason, } PRINTK("Current thread ID = %p\n" - "Faulting instruction address = 0x%" PRIx32 "\n" - " ra: 0x%" PRIx32 " gp: 0x%" PRIx32 - " tp: 0x%" PRIx32 " t0: 0x%" PRIx32 "\n" - " t1: 0x%" PRIx32 " t2: 0x%" PRIx32 - " t3: 0x%" PRIx32 " t4: 0x%" PRIx32 "\n" - " t5: 0x%" PRIx32 " t6: 0x%" PRIx32 - " a0: 0x%" PRIx32 " a1: 0x%" PRIx32 "\n" - " a2: 0x%" PRIx32 " a3: 0x%" PRIx32 - " a4: 0x%" PRIx32 " a5: 0x%" PRIx32 "\n" - " a6: 0x%" PRIx32 " a7: 0x%" PRIx32 "\n", + "Faulting instruction address = 0x%x\n" + " ra: 0x%x gp: 0x%x tp: 0x%x t0: 0x%x\n" + " t1: 0x%x t2: 0x%x t3: 0x%x t4: 0x%x\n" + " t5: 0x%x t6: 0x%x a0: 0x%x a1: 0x%x\n" + " a2: 0x%x a3: 0x%x a4: 0x%x a5: 0x%x\n" + " a6: 0x%x a7: 0x%x\n", k_current_get(), (esf->mepc == 0xdeadbaad) ? 0xdeadbaad : esf->mepc - 4, esf->ra, esf->gp, esf->tp, esf->t0, diff --git a/arch/x86/core/fatal.c b/arch/x86/core/fatal.c index c5823e3ed2c..6f66745b5ac 100644 --- a/arch/x86/core/fatal.c +++ b/arch/x86/core/fatal.c @@ -192,7 +192,7 @@ FUNC_NORETURN void page_fault_handler(const NANO_ESF *pEsf) err = pEsf->errorCode; printk("***** CPU Page Fault (error code 0x%08x)\n", err); - printk("%s thread %s address 0x%08" PRIx32 "\n", + printk("%s thread %s address 0x%08x\n", err & US ? "User" : "Supervisor", err & ID ? "executed" : (err & WR ? "wrote" : "read"), cr2); diff --git a/drivers/grove/lcd_rgb.c b/drivers/grove/lcd_rgb.c index 65bfb9564e9..fadba4d1ff7 100644 --- a/drivers/grove/lcd_rgb.c +++ b/drivers/grove/lcd_rgb.c @@ -102,7 +102,7 @@ static inline void _sleep(u32_t sleep_in_ms) /******************************************** * PUBLIC FUNCTIONS *******************************************/ -void glcd_print(struct device *port, char *data, uint32_t size) +void glcd_print(struct device *port, char *data, u32_t size) { const struct glcd_driver * const rom = (struct glcd_driver *) port->config->config_info; diff --git a/drivers/i2c/i2c_atmel_sam3.c b/drivers/i2c/i2c_atmel_sam3.c index 9de11cf6695..69f066718b0 100644 --- a/drivers/i2c/i2c_atmel_sam3.c +++ b/drivers/i2c/i2c_atmel_sam3.c @@ -184,7 +184,7 @@ static u32_t clk_div_calc(struct device *dev) #endif /* CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 84000000 */ } -static int i2c_sam3_runtime_configure(struct device *dev, uint32_t config) +static int i2c_sam3_runtime_configure(struct device *dev, u32_t config) { const struct i2c_sam3_dev_config * const cfg = dev->config->config_info; struct i2c_sam3_dev_data * const dev_data = dev->driver_data; diff --git a/drivers/i2c/i2c_qmsi_ss.c b/drivers/i2c/i2c_qmsi_ss.c index 8f85a75b3af..5af29277e0b 100644 --- a/drivers/i2c/i2c_qmsi_ss.c +++ b/drivers/i2c/i2c_qmsi_ss.c @@ -219,7 +219,7 @@ static void i2c_qmsi_ss_config_irq_1(void) } #endif /* CONFIG_I2C_SS_1 */ -static int i2c_qmsi_ss_configure(struct device *dev, uint32_t config) +static int i2c_qmsi_ss_configure(struct device *dev, u32_t config) { qm_ss_i2c_t instance = GET_CONTROLLER_INSTANCE(dev); struct i2c_qmsi_ss_driver_data *driver_data = GET_DRIVER_DATA(dev); diff --git a/drivers/timer/altera_avalon_timer.c b/drivers/timer/altera_avalon_timer.c index 0624f3138de..d3cb31758f7 100644 --- a/drivers/timer/altera_avalon_timer.c +++ b/drivers/timer/altera_avalon_timer.c @@ -96,7 +96,7 @@ int _sys_clock_driver_init(struct device *device) } -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { /* XXX Per the Altera Embedded IP Peripherals guide, you cannot * use a timer instance for both the system clock and timestamps diff --git a/drivers/timer/arcv2_timer0.c b/drivers/timer/arcv2_timer0.c index 2139c3d8a36..f52fed0f841 100644 --- a/drivers/timer/arcv2_timer0.c +++ b/drivers/timer/arcv2_timer0.c @@ -413,7 +413,7 @@ int sys_clock_device_ctrl(struct device *port, u32_t ctrl_command, } #endif /* CONFIG_DEVICE_POWER_MANAGEMENT */ -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { u32_t acc, count; diff --git a/drivers/timer/cortex_m_systick.c b/drivers/timer/cortex_m_systick.c index c74b677cd2e..9d14e8d6269 100644 --- a/drivers/timer/cortex_m_systick.c +++ b/drivers/timer/cortex_m_systick.c @@ -557,7 +557,7 @@ int _sys_clock_driver_init(struct device *device) * systick counter is a 24-bit down counter which is reset to "reload" value * once it reaches 0. */ -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { u32_t cac, count; diff --git a/drivers/timer/hpet.c b/drivers/timer/hpet.c index 5e6fe2f310d..d792b1c5ef6 100644 --- a/drivers/timer/hpet.c +++ b/drivers/timer/hpet.c @@ -593,7 +593,7 @@ int _sys_clock_driver_init(struct device *device) * it will need to call _hpetMainCounterAtomic(). */ -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { return (u32_t) *_HPET_MAIN_COUNTER_VALUE; } diff --git a/drivers/timer/loapic_timer.c b/drivers/timer/loapic_timer.c index 72c7b537a22..ea00164576c 100644 --- a/drivers/timer/loapic_timer.c +++ b/drivers/timer/loapic_timer.c @@ -581,7 +581,7 @@ int sys_clock_device_ctrl(struct device *port, u32_t ctrl_command, * * @return up counter of elapsed clock cycles */ -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { #if CONFIG_TSC_CYCLES_PER_SEC != 0 u64_t tsc; diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index 38d9128b554..59c0f7a6b0d 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -305,7 +305,7 @@ int _sys_clock_driver_init(struct device *device) return 0; } -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { u32_t elapsed_cycles; diff --git a/drivers/timer/pulpino_timer.c b/drivers/timer/pulpino_timer.c index 74276449bca..d9dd6d6bbd8 100644 --- a/drivers/timer/pulpino_timer.c +++ b/drivers/timer/pulpino_timer.c @@ -68,7 +68,7 @@ int _sys_clock_driver_init(struct device *device) * * @return up counter of elapsed clock cycles */ -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { return accumulated_cycle_count + timer->val; } diff --git a/drivers/timer/riscv_machine_timer.c b/drivers/timer/riscv_machine_timer.c index e137ed8f0f6..05e6219b039 100644 --- a/drivers/timer/riscv_machine_timer.c +++ b/drivers/timer/riscv_machine_timer.c @@ -97,7 +97,7 @@ int _sys_clock_driver_init(struct device *device) * * @return up counter of elapsed clock cycles */ -uint32_t _timer_cycle_get_32(void) +u32_t _timer_cycle_get_32(void) { /* We just want a cycle count so just post what's in the low 32 * bits of the mtime real-time counter diff --git a/include/adc.h b/include/adc.h index 44aeeaeb2c0..bfb159ca527 100644 --- a/include/adc.h +++ b/include/adc.h @@ -34,18 +34,18 @@ extern "C" { */ struct adc_seq_entry { /** Clock ticks delay before sampling the ADC. */ - int32_t sampling_delay; + s32_t sampling_delay; /** Buffer pointer where the sample is written.*/ - uint8_t *buffer; + u8_t *buffer; /** Length of the sampling buffer.*/ - uint32_t buffer_length; + u32_t buffer_length; /** Channel ID that should be sampled from the ADC */ - uint8_t channel_id; + u8_t channel_id; - uint8_t stride[3]; + u8_t stride[3]; }; /** @@ -59,8 +59,8 @@ struct adc_seq_table { struct adc_seq_entry *entries; /* Number of entries in the sequence entry array. */ - uint8_t num_entries; - uint8_t stride[3]; + u8_t num_entries; + u8_t stride[3]; }; /** diff --git a/include/aio_comparator.h b/include/aio_comparator.h index 0202847b057..1484f729c32 100644 --- a/include/aio_comparator.h +++ b/include/aio_comparator.h @@ -23,12 +23,12 @@ enum aio_cmp_polarity { typedef void (*aio_cmp_cb)(void *); -typedef int (*aio_cmp_api_disable)(struct device *dev, uint8_t index); +typedef int (*aio_cmp_api_disable)(struct device *dev, u8_t index); -typedef int (*aio_cmp_api_configure)(struct device *dev, uint8_t index, +typedef int (*aio_cmp_api_configure)(struct device *dev, u8_t index, enum aio_cmp_polarity polarity, enum aio_cmp_ref refsel, aio_cmp_cb cb, void *param); -typedef uint32_t (*aio_cmp_api_get_pending_int)(struct device *dev); +typedef u32_t (*aio_cmp_api_get_pending_int)(struct device *dev); struct aio_cmp_driver_api { aio_cmp_api_disable disable; @@ -46,7 +46,7 @@ struct aio_cmp_driver_api { * * @return 0 if successful, otherwise failed. */ -static inline int aio_cmp_disable(struct device *dev, uint8_t index) +static inline int aio_cmp_disable(struct device *dev, u8_t index) { const struct aio_cmp_driver_api *api = dev->driver_api; @@ -68,7 +68,7 @@ static inline int aio_cmp_disable(struct device *dev, uint8_t index) * * @return 0 if successful, otherwise failed. */ -static inline int aio_cmp_configure(struct device *dev, uint8_t index, +static inline int aio_cmp_configure(struct device *dev, u8_t index, enum aio_cmp_polarity polarity, enum aio_cmp_ref refsel, aio_cmp_cb cb, void *param) diff --git a/include/arch/arc/v2/asm_inline_gcc.h b/include/arch/arc/v2/asm_inline_gcc.h index 4945b7ff992..94f760a33eb 100644 --- a/include/arch/arc/v2/asm_inline_gcc.h +++ b/include/arch/arc/v2/asm_inline_gcc.h @@ -24,43 +24,43 @@ extern "C" { /** * @brief read timestamp register (CPU frequency) */ -extern uint64_t _tsc_read(void); +extern u64_t _tsc_read(void); /* Implementation of sys_io.h's documented functions */ static ALWAYS_INLINE - void sys_out8(uint8_t data, io_port_t port) + void sys_out8(u8_t data, io_port_t port) { _arc_v2_aux_reg_write(port, data); } static ALWAYS_INLINE - uint8_t sys_in8(io_port_t port) + u8_t sys_in8(io_port_t port) { - return (uint8_t)(_arc_v2_aux_reg_read(port) & 0x000000ff); + return (u8_t)(_arc_v2_aux_reg_read(port) & 0x000000ff); } static ALWAYS_INLINE - void sys_out16(uint16_t data, io_port_t port) + void sys_out16(u16_t data, io_port_t port) { _arc_v2_aux_reg_write(port, data); } static ALWAYS_INLINE - uint16_t sys_in16(io_port_t port) + u16_t sys_in16(io_port_t port) { - return (uint16_t)(_arc_v2_aux_reg_read(port) & 0x0000ffff); + return (u16_t)(_arc_v2_aux_reg_read(port) & 0x0000ffff); } static ALWAYS_INLINE - void sys_out32(uint32_t data, io_port_t port) + void sys_out32(u32_t data, io_port_t port) { _arc_v2_aux_reg_write(port, data); } static ALWAYS_INLINE - uint32_t sys_in32(io_port_t port) + u32_t sys_in32(io_port_t port) { return _arc_v2_aux_reg_read(port); } @@ -68,7 +68,7 @@ static ALWAYS_INLINE static ALWAYS_INLINE void sys_io_set_bit(io_port_t port, unsigned int bit) { - uint32_t reg = 0; + u32_t reg = 0; __asm__ volatile("lr %1, [%0]\n" "bset %1, %1, %2\n" @@ -82,7 +82,7 @@ static ALWAYS_INLINE static ALWAYS_INLINE void sys_io_clear_bit(io_port_t port, unsigned int bit) { - uint32_t reg = 0; + u32_t reg = 0; __asm__ volatile("lr %1, [%0]\n" "bclr %1, %1, %2\n" @@ -96,9 +96,9 @@ static ALWAYS_INLINE static ALWAYS_INLINE int sys_io_test_bit(io_port_t port, unsigned int bit) { - uint32_t status = _ARC_V2_STATUS32; - uint32_t reg = 0; - uint32_t ret; + u32_t status = _ARC_V2_STATUS32; + u32_t reg = 0; + u32_t ret; __asm__ volatile("lr %2, [%1]\n" "btst %2, %3\n" @@ -134,66 +134,66 @@ static ALWAYS_INLINE } static ALWAYS_INLINE - void sys_write8(uint8_t data, mm_reg_t addr) + void sys_write8(u8_t data, mm_reg_t addr) { __asm__ volatile("stb%U1 %0, %1;\n\t" : - : "r" (data), "m" (*(volatile uint8_t *) addr) + : "r" (data), "m" (*(volatile u8_t *) addr) : "memory"); } static ALWAYS_INLINE - uint8_t sys_read8(mm_reg_t addr) + u8_t sys_read8(mm_reg_t addr) { - uint8_t ret; + u8_t ret; __asm__ volatile("ldb%U1 %0, %1;\n\t" : "=r" (ret) - : "m" (*(volatile uint8_t *) addr) + : "m" (*(volatile u8_t *) addr) : "memory"); return ret; } static ALWAYS_INLINE - void sys_write16(uint16_t data, mm_reg_t addr) + void sys_write16(u16_t data, mm_reg_t addr) { __asm__ volatile("sth%U1 %0, %1;\n\t" : - : "r" (data), "m" (*(volatile uint16_t *) addr) + : "r" (data), "m" (*(volatile u16_t *) addr) : "memory"); } static ALWAYS_INLINE - uint16_t sys_read16(mm_reg_t addr) + u16_t sys_read16(mm_reg_t addr) { - uint16_t ret; + u16_t ret; __asm__ volatile("ldh%U1 %0, %1;\n\t" : "=r" (ret) - : "m" (*(volatile uint16_t *) addr) + : "m" (*(volatile u16_t *) addr) : "memory"); return ret; } static ALWAYS_INLINE - void sys_write32(uint32_t data, mm_reg_t addr) + void sys_write32(u32_t data, mm_reg_t addr) { __asm__ volatile("st%U1 %0, %1;\n\t" : - : "r" (data), "m" (*(volatile uint32_t *) addr) + : "r" (data), "m" (*(volatile u32_t *) addr) : "memory"); } static ALWAYS_INLINE - uint32_t sys_read32(mm_reg_t addr) + u32_t sys_read32(mm_reg_t addr) { - uint32_t ret; + u32_t ret; __asm__ volatile("ld%U1 %0, %1;\n\t" : "=r" (ret) - : "m" (*(volatile uint32_t *) addr) + : "m" (*(volatile u32_t *) addr) : "memory"); return ret; @@ -202,12 +202,12 @@ static ALWAYS_INLINE static ALWAYS_INLINE void sys_set_bit(mem_addr_t addr, unsigned int bit) { - uint32_t reg = 0; + u32_t reg = 0; __asm__ volatile("ld %1, %0\n" "bset %1, %1, %2\n" "st %1, %0;\n\t" - : "+m" (*(volatile uint32_t *) addr) + : "+m" (*(volatile u32_t *) addr) : "r" (reg), "Mr" (bit) : "memory", "cc"); } @@ -215,12 +215,12 @@ static ALWAYS_INLINE static ALWAYS_INLINE void sys_clear_bit(mem_addr_t addr, unsigned int bit) { - uint32_t reg = 0; + u32_t reg = 0; __asm__ volatile("ld %1, %0\n" "bclr %1, %1, %2\n" "st %1, %0;\n\t" - : "+m" (*(volatile uint32_t *) addr) + : "+m" (*(volatile u32_t *) addr) : "r" (reg), "Mr" (bit) : "memory", "cc"); } @@ -228,15 +228,15 @@ static ALWAYS_INLINE static ALWAYS_INLINE int sys_test_bit(mem_addr_t addr, unsigned int bit) { - uint32_t status = _ARC_V2_STATUS32; - uint32_t reg = 0; - uint32_t ret; + u32_t status = _ARC_V2_STATUS32; + u32_t reg = 0; + u32_t ret; __asm__ volatile("ld %2, %1\n" "btst %2, %3\n" "lr %0, [%4];\n\t" : "=r" (ret) - : "m" (*(volatile uint32_t *) addr), + : "m" (*(volatile u32_t *) addr), "r" (reg), "Mr" (bit), "i" (status) : "memory", "cc"); diff --git a/include/arch/arc/v2/aux_regs.h b/include/arch/arc/v2/aux_regs.h index a2491103309..41ae4c5c620 100644 --- a/include/arch/arc/v2/aux_regs.h +++ b/include/arch/arc/v2/aux_regs.h @@ -113,8 +113,8 @@ extern "C" { #if defined(__GNUC__) #include -#define _arc_v2_aux_reg_read(reg) __builtin_arc_lr((volatile uint32_t)reg) -#define _arc_v2_aux_reg_write(reg, val) __builtin_arc_sr((unsigned int)val, (volatile uint32_t)reg) +#define _arc_v2_aux_reg_read(reg) __builtin_arc_lr((volatile u32_t)reg) +#define _arc_v2_aux_reg_write(reg, val) __builtin_arc_sr((unsigned int)val, (volatile u32_t)reg) #else /* ! __GNUC__ */ diff --git a/include/arch/arc/v2/ffs.h b/include/arch/arc/v2/ffs.h index 8f40eb29fbc..c57e77f6364 100644 --- a/include/arch/arc/v2/ffs.h +++ b/include/arch/arc/v2/ffs.h @@ -35,7 +35,7 @@ extern "C" { */ #if defined(__GNUC__) -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { unsigned int bit; @@ -64,7 +64,7 @@ static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) */ #if defined(__GNUC__) -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { unsigned int bit; diff --git a/include/arch/arc/v2/irq.h b/include/arch/arc/v2/irq.h index 850fe43261b..53249fe7fe5 100644 --- a/include/arch/arc/v2/irq.h +++ b/include/arch/arc/v2/irq.h @@ -35,7 +35,7 @@ extern void _arch_irq_disable(unsigned int irq); extern void _irq_exit(void); extern void _irq_priority_set(unsigned int irq, unsigned int prio, - uint32_t flags); + u32_t flags); extern void _isr_wrapper(void); extern void _irq_spurious(void *unused); diff --git a/include/arch/arc/v2/misc.h b/include/arch/arc/v2/misc.h index 14c711942bf..e5e1028d705 100644 --- a/include/arch/arc/v2/misc.h +++ b/include/arch/arc/v2/misc.h @@ -23,7 +23,7 @@ extern unsigned int k_cpu_sleep_mode; extern void k_cpu_idle(void); extern void k_cpu_atomic_idle(unsigned int key); -extern uint32_t _timer_cycle_get_32(void); +extern u32_t _timer_cycle_get_32(void); #define _arch_k_cycle_get_32() _timer_cycle_get_32() #endif diff --git a/include/arch/arm/arch.h b/include/arch/arm/arch.h index 14abcae1ff7..83ca7d063d6 100644 --- a/include/arch/arm/arch.h +++ b/include/arch/arm/arch.h @@ -24,7 +24,7 @@ extern "C" { #endif /* ARM GPRs are often designated by two different names */ -#define sys_define_gpr_with_alias(name1, name2) union { uint32_t name1, name2; } +#define sys_define_gpr_with_alias(name1, name2) union { u32_t name1, name2; } /* APIs need to support non-byte addressable architectures */ diff --git a/include/arch/arm/cortex_m/asm_inline_gcc.h b/include/arch/arm/cortex_m/asm_inline_gcc.h index 69ee8833c61..5b287eda3d2 100644 --- a/include/arch/arm/cortex_m/asm_inline_gcc.h +++ b/include/arch/arm/cortex_m/asm_inline_gcc.h @@ -45,7 +45,7 @@ extern "C" { * @return most significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { if (!op) { return 0; @@ -67,7 +67,7 @@ static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) * @return least significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { return __builtin_ffs(op); } diff --git a/include/arch/arm/cortex_m/cmsis.h b/include/arch/arm/cortex_m/cmsis.h index f18616db86a..f42b94c7e74 100644 --- a/include/arch/arm/cortex_m/cmsis.h +++ b/include/arch/arm/cortex_m/cmsis.h @@ -36,9 +36,9 @@ extern "C" { #define CPACR_CP11_RESERVED (2UL << CPACR_CP11_Pos) #define CPACR_CP11_FULL_ACCESS (3UL << CPACR_CP11_Pos) -#define SCB_UFSR (*((__IOM uint16_t *) &SCB->CFSR + 2)) -#define SCB_BFSR (*((__IOM uint8_t *) &SCB->CFSR + 1)) -#define SCB_MMFSR (*((__IOM uint8_t *) &SCB->CFSR)) +#define SCB_UFSR (*((__IOM u16_t *) &SCB->CFSR + 2)) +#define SCB_BFSR (*((__IOM u8_t *) &SCB->CFSR + 1)) +#define SCB_MMFSR (*((__IOM u8_t *) &SCB->CFSR)) /* CFSR[UFSR] */ #define CFSR_DIVBYZERO_Pos (25U) diff --git a/include/arch/arm/cortex_m/exc.h b/include/arch/arm/cortex_m/exc.h index 5dabb177740..cac96a81d4a 100644 --- a/include/arch/arm/cortex_m/exc.h +++ b/include/arch/arm/cortex_m/exc.h @@ -53,11 +53,11 @@ struct __esf { sys_define_gpr_with_alias(ip, r12); sys_define_gpr_with_alias(lr, r14); sys_define_gpr_with_alias(pc, r15); - uint32_t xpsr; + u32_t xpsr; #ifdef CONFIG_FLOAT float s[16]; - uint32_t fpscr; - uint32_t undefined; + u32_t fpscr; + u32_t undefined; #endif }; diff --git a/include/arch/arm/cortex_m/irq.h b/include/arch/arm/cortex_m/irq.h index da8a6b4b7b4..2696225116a 100644 --- a/include/arch/arm/cortex_m/irq.h +++ b/include/arch/arm/cortex_m/irq.h @@ -43,7 +43,7 @@ extern void _IntExit(void); /* internal routine documented in C file, needed by IRQ_CONNECT() macro */ extern void _irq_priority_set(unsigned int irq, unsigned int prio, - uint32_t flags); + u32_t flags); /* Flags for use with IRQ_CONNECT() */ diff --git a/include/arch/arm/cortex_m/misc.h b/include/arch/arm/cortex_m/misc.h index 86567e1ea64..9e7730ef61f 100644 --- a/include/arch/arm/cortex_m/misc.h +++ b/include/arch/arm/cortex_m/misc.h @@ -21,7 +21,7 @@ extern "C" { #ifndef _ASMLANGUAGE extern void k_cpu_idle(void); -extern uint32_t _timer_cycle_get_32(void); +extern u32_t _timer_cycle_get_32(void); #define _arch_k_cycle_get_32() _timer_cycle_get_32() #endif diff --git a/include/arch/arm/cortex_m/sys_io.h b/include/arch/arm/cortex_m/sys_io.h index bf18de27971..853b29d9b5a 100644 --- a/include/arch/arm/cortex_m/sys_io.h +++ b/include/arch/arm/cortex_m/sys_io.h @@ -17,15 +17,15 @@ /* Memory mapped registers I/O functions */ -static inline uint32_t sys_read32(mem_addr_t addr) +static inline u32_t sys_read32(mem_addr_t addr) { - return *(volatile uint32_t *)addr; + return *(volatile u32_t *)addr; } -static inline void sys_write32(uint32_t data, mem_addr_t addr) +static inline void sys_write32(u32_t data, mem_addr_t addr) { - *(volatile uint32_t *)addr = data; + *(volatile u32_t *)addr = data; } @@ -33,16 +33,16 @@ static inline void sys_write32(uint32_t data, mem_addr_t addr) static inline void sys_set_bit(mem_addr_t addr, unsigned int bit) { - uint32_t temp = *(volatile uint32_t *)addr; + u32_t temp = *(volatile u32_t *)addr; - *(volatile uint32_t *)addr = temp | (1 << bit); + *(volatile u32_t *)addr = temp | (1 << bit); } static inline void sys_clear_bit(mem_addr_t addr, unsigned int bit) { - uint32_t temp = *(volatile uint32_t *)addr; + u32_t temp = *(volatile u32_t *)addr; - *(volatile uint32_t *)addr = temp & ~(1 << bit); + *(volatile u32_t *)addr = temp & ~(1 << bit); } #endif /* !_ASMLANGUAGE */ diff --git a/include/arch/nios2/arch.h b/include/arch/nios2/arch.h index fd148a54b69..a616855895f 100644 --- a/include/arch/nios2/arch.h +++ b/include/arch/nios2/arch.h @@ -131,24 +131,24 @@ void _arch_irq_enable(unsigned int irq); void _arch_irq_disable(unsigned int irq); struct __esf { - uint32_t ra; /* return address r31 */ - uint32_t r1; /* at */ - uint32_t r2; /* return value */ - uint32_t r3; /* return value */ - uint32_t r4; /* register args */ - uint32_t r5; /* register args */ - uint32_t r6; /* register args */ - uint32_t r7; /* register args */ - uint32_t r8; /* Caller-saved general purpose */ - uint32_t r9; /* Caller-saved general purpose */ - uint32_t r10; /* Caller-saved general purpose */ - uint32_t r11; /* Caller-saved general purpose */ - uint32_t r12; /* Caller-saved general purpose */ - uint32_t r13; /* Caller-saved general purpose */ - uint32_t r14; /* Caller-saved general purpose */ - uint32_t r15; /* Caller-saved general purpose */ - uint32_t estatus; - uint32_t instr; /* Instruction being executed when exc occurred */ + u32_t ra; /* return address r31 */ + u32_t r1; /* at */ + u32_t r2; /* return value */ + u32_t r3; /* return value */ + u32_t r4; /* register args */ + u32_t r5; /* register args */ + u32_t r6; /* register args */ + u32_t r7; /* register args */ + u32_t r8; /* Caller-saved general purpose */ + u32_t r9; /* Caller-saved general purpose */ + u32_t r10; /* Caller-saved general purpose */ + u32_t r11; /* Caller-saved general purpose */ + u32_t r12; /* Caller-saved general purpose */ + u32_t r13; /* Caller-saved general purpose */ + u32_t r14; /* Caller-saved general purpose */ + u32_t r15; /* Caller-saved general purpose */ + u32_t estatus; + u32_t instr; /* Instruction being executed when exc occurred */ }; typedef struct __esf NANO_ESF; @@ -199,7 +199,7 @@ enum nios2_exception_cause { BIT(NIOS2_EXCEPTION_ECC_DATA_ERR)) -extern uint32_t _timer_cycle_get_32(void); +extern u32_t _timer_cycle_get_32(void); #define _arch_k_cycle_get_32() _timer_cycle_get_32() #endif /* _ASMLANGUAGE */ diff --git a/include/arch/nios2/asm_inline_gcc.h b/include/arch/nios2/asm_inline_gcc.h index 3d9b3ac8ec7..80c2e0f429c 100644 --- a/include/arch/nios2/asm_inline_gcc.h +++ b/include/arch/nios2/asm_inline_gcc.h @@ -32,7 +32,7 @@ extern "C" { * @return most significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { if (!op) return 0; @@ -51,7 +51,7 @@ static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) * @return least significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { return __builtin_ffs(op); } @@ -61,37 +61,37 @@ static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) */ static ALWAYS_INLINE - void sys_write32(uint32_t data, mm_reg_t addr) + void sys_write32(u32_t data, mm_reg_t addr) { __builtin_stwio((void *)addr, data); } static ALWAYS_INLINE - uint32_t sys_read32(mm_reg_t addr) + u32_t sys_read32(mm_reg_t addr) { return __builtin_ldwio((void *)addr); } static ALWAYS_INLINE - void sys_write8(uint8_t data, mm_reg_t addr) + void sys_write8(u8_t data, mm_reg_t addr) { sys_write32(data, addr); } static ALWAYS_INLINE - uint8_t sys_read8(mm_reg_t addr) + u8_t sys_read8(mm_reg_t addr) { return __builtin_ldbuio((void *)addr); } static ALWAYS_INLINE - void sys_write16(uint16_t data, mm_reg_t addr) + void sys_write16(u16_t data, mm_reg_t addr) { sys_write32(data, addr); } static ALWAYS_INLINE - uint16_t sys_read16(mm_reg_t addr) + u16_t sys_read16(mm_reg_t addr) { return __builtin_ldhuio((void *)addr); } diff --git a/include/arch/nios2/nios2.h b/include/arch/nios2/nios2.h index ae8f3208acc..e8ac18052d7 100644 --- a/include/arch/nios2/nios2.h +++ b/include/arch/nios2/nios2.h @@ -60,22 +60,22 @@ extern "C" */ /* ET (Exception Temporary) register */ -static inline uint32_t _nios2_read_et(void) +static inline u32_t _nios2_read_et(void) { - uint32_t et; + u32_t et; __asm__("mov %0, et" : "=r" (et)); return et; } -static inline void _nios2_write_et(uint32_t et) +static inline void _nios2_write_et(u32_t et) { __asm__ volatile("mov et, %z0" : : "rM" (et)); } -static inline uint32_t _nios2_read_sp(void) +static inline u32_t _nios2_read_sp(void) { - uint32_t sp; + u32_t sp; __asm__("mov %0, sp" : "=r" (sp)); return sp; @@ -102,12 +102,12 @@ static inline void _nios2_dcache_addr_flush(void *addr) __asm__ volatile ("flushda (%0)" :: "r" (addr)); } -static inline void _nios2_dcache_flush(uint32_t offset) +static inline void _nios2_dcache_flush(u32_t offset) { __asm__ volatile ("flushd (%0)" :: "r" (offset)); } -static inline void _nios2_icache_flush(uint32_t offset) +static inline void _nios2_icache_flush(u32_t offset) { __asm__ volatile ("flushi %0" :: "r" (offset)); } @@ -145,7 +145,7 @@ enum nios2_creg { * we get errors "Control register number must be in range 0-31 for * __builtin_rdctl" with the following code: * - * static inline uint32_t _nios2_creg_read(enum nios2_creg reg) + * static inline u32_t _nios2_creg_read(enum nios2_creg reg) * { * return __builtin_rdctl(reg); * } @@ -156,14 +156,14 @@ enum nios2_creg { #define _nios2_creg_write(reg, val) __builtin_wrctl(reg, val) #define _nios2_get_register_address(base, regnum) \ - ((void *)(((uint8_t *)base) + ((regnum) * (SYSTEM_BUS_WIDTH / 8)))) + ((void *)(((u8_t *)base) + ((regnum) * (SYSTEM_BUS_WIDTH / 8)))) -static inline void _nios2_reg_write(void *base, int regnum, uint32_t data) +static inline void _nios2_reg_write(void *base, int regnum, u32_t data) { sys_write32(data, (mm_reg_t)_nios2_get_register_address(base, regnum)); } -static inline uint32_t _nios2_reg_read(void *base, int regnum) +static inline u32_t _nios2_reg_read(void *base, int regnum) { return sys_read32((mm_reg_t)_nios2_get_register_address(base, regnum)); } diff --git a/include/arch/riscv32/arch.h b/include/arch/riscv32/arch.h index 4b2ef1d681e..dddae5c971d 100644 --- a/include/arch/riscv32/arch.h +++ b/include/arch/riscv32/arch.h @@ -51,7 +51,7 @@ extern "C" { * SOC-specific function to get the IRQ number generating the interrupt. * __soc_get_irq returns a bitfield of pending IRQs. */ -extern uint32_t __soc_get_irq(void); +extern u32_t __soc_get_irq(void); void _arch_irq_enable(unsigned int irq); void _arch_irq_disable(unsigned int irq); @@ -118,7 +118,7 @@ static ALWAYS_INLINE void _arch_irq_unlock(unsigned int key) : "memory"); } -extern uint32_t _timer_cycle_get_32(void); +extern u32_t _timer_cycle_get_32(void); #define _arch_k_cycle_get_32() _timer_cycle_get_32() #endif /*_ASMLANGUAGE */ diff --git a/include/arch/riscv32/exp.h b/include/arch/riscv32/exp.h index 649c2441f68..43248efef11 100644 --- a/include/arch/riscv32/exp.h +++ b/include/arch/riscv32/exp.h @@ -23,38 +23,38 @@ extern "C" { #include struct __esf { - uint32_t ra; /* return address */ - uint32_t gp; /* global pointer */ - uint32_t tp; /* thread pointer */ + u32_t ra; /* return address */ + u32_t gp; /* global pointer */ + u32_t tp; /* thread pointer */ - uint32_t t0; /* Caller-saved temporary register */ - uint32_t t1; /* Caller-saved temporary register */ - uint32_t t2; /* Caller-saved temporary register */ - uint32_t t3; /* Caller-saved temporary register */ - uint32_t t4; /* Caller-saved temporary register */ - uint32_t t5; /* Caller-saved temporary register */ - uint32_t t6; /* Caller-saved temporary register */ + u32_t t0; /* Caller-saved temporary register */ + u32_t t1; /* Caller-saved temporary register */ + u32_t t2; /* Caller-saved temporary register */ + u32_t t3; /* Caller-saved temporary register */ + u32_t t4; /* Caller-saved temporary register */ + u32_t t5; /* Caller-saved temporary register */ + u32_t t6; /* Caller-saved temporary register */ - uint32_t a0; /* function argument/return value */ - uint32_t a1; /* function argument */ - uint32_t a2; /* function argument */ - uint32_t a3; /* function argument */ - uint32_t a4; /* function argument */ - uint32_t a5; /* function argument */ - uint32_t a6; /* function argument */ - uint32_t a7; /* function argument */ + u32_t a0; /* function argument/return value */ + u32_t a1; /* function argument */ + u32_t a2; /* function argument */ + u32_t a3; /* function argument */ + u32_t a4; /* function argument */ + u32_t a5; /* function argument */ + u32_t a6; /* function argument */ + u32_t a7; /* function argument */ - uint32_t mepc; /* machine exception program counter */ - uint32_t mstatus; /* machine status register */ + u32_t mepc; /* machine exception program counter */ + u32_t mstatus; /* machine status register */ #if defined(CONFIG_SOC_RISCV32_PULPINO) /* pulpino hardware loop registers */ - uint32_t lpstart0; - uint32_t lpend0; - uint32_t lpcount0; - uint32_t lpstart1; - uint32_t lpend1; - uint32_t lpcount1; + u32_t lpstart0; + u32_t lpend0; + u32_t lpcount0; + u32_t lpstart1; + u32_t lpend1; + u32_t lpcount1; #endif }; diff --git a/include/arch/riscv32/fe310/asm_inline_gcc.h b/include/arch/riscv32/fe310/asm_inline_gcc.h index 53ac436e503..a20cfc020b6 100644 --- a/include/arch/riscv32/fe310/asm_inline_gcc.h +++ b/include/arch/riscv32/fe310/asm_inline_gcc.h @@ -32,7 +32,7 @@ extern "C" { * * @return least significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { return __builtin_ffs(op); } @@ -48,7 +48,7 @@ static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) * * @return most significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { if (!op) return 0; diff --git a/include/arch/riscv32/pulpino/asm_inline_gcc.h b/include/arch/riscv32/pulpino/asm_inline_gcc.h index 55b88bdbef3..2c9a18593c0 100644 --- a/include/arch/riscv32/pulpino/asm_inline_gcc.h +++ b/include/arch/riscv32/pulpino/asm_inline_gcc.h @@ -38,7 +38,7 @@ extern "C" { * * @return least significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { unsigned int ret; @@ -63,7 +63,7 @@ static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) * * @return most significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { unsigned int ret; @@ -84,12 +84,12 @@ static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) * __builtin_ffs and __builtin_clz to handle respectively * find_lsb_set and find_msb_set. */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { return __builtin_ffs(op); } -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { if (!op) return 0; diff --git a/include/arch/riscv32/riscv32-qemu/asm_inline_gcc.h b/include/arch/riscv32/riscv32-qemu/asm_inline_gcc.h index 2bede94c326..0149b1c3ad4 100644 --- a/include/arch/riscv32/riscv32-qemu/asm_inline_gcc.h +++ b/include/arch/riscv32/riscv32-qemu/asm_inline_gcc.h @@ -33,7 +33,7 @@ extern "C" { * * @return least significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { return __builtin_ffs(op); } @@ -49,7 +49,7 @@ static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) * * @return most significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { if (!op) return 0; diff --git a/include/arch/riscv32/sys_io.h b/include/arch/riscv32/sys_io.h index fc43dd000cf..91513ba6602 100644 --- a/include/arch/riscv32/sys_io.h +++ b/include/arch/riscv32/sys_io.h @@ -17,47 +17,47 @@ /* Memory mapped registers I/O functions */ -static inline uint32_t sys_read32(mem_addr_t addr) +static inline u32_t sys_read32(mem_addr_t addr) { - return *(volatile uint32_t *)addr; + return *(volatile u32_t *)addr; } -static inline void sys_write32(uint32_t data, mem_addr_t addr) +static inline void sys_write32(u32_t data, mem_addr_t addr) { - *(volatile uint32_t *)addr = data; + *(volatile u32_t *)addr = data; } -static inline uint8_t sys_read8(mem_addr_t addr) +static inline u8_t sys_read8(mem_addr_t addr) { - return *(volatile uint8_t *)addr; + return *(volatile u8_t *)addr; } -static inline void sys_write8(uint8_t data, mem_addr_t addr) +static inline void sys_write8(u8_t data, mem_addr_t addr) { - *(volatile uint8_t *)addr = data; + *(volatile u8_t *)addr = data; } /* Memory bit manipulation functions */ static inline void sys_set_bit(mem_addr_t addr, unsigned int bit) { - uint32_t temp = *(volatile uint32_t *)addr; + u32_t temp = *(volatile u32_t *)addr; - *(volatile uint32_t *)addr = temp | (1 << bit); + *(volatile u32_t *)addr = temp | (1 << bit); } static inline void sys_clear_bit(mem_addr_t addr, unsigned int bit) { - uint32_t temp = *(volatile uint32_t *)addr; + u32_t temp = *(volatile u32_t *)addr; - *(volatile uint32_t *)addr = temp & ~(1 << bit); + *(volatile u32_t *)addr = temp & ~(1 << bit); } static ALWAYS_INLINE int sys_test_bit(mem_addr_t addr, unsigned int bit) { - uint32_t temp = *(volatile uint32_t *)addr; + u32_t temp = *(volatile u32_t *)addr; return temp & (1 << bit); } diff --git a/include/arch/x86/arch.h b/include/arch/x86/arch.h index 946132d1f5b..e21529b8143 100644 --- a/include/arch/x86/arch.h +++ b/include/arch/x86/arch.h @@ -488,7 +488,7 @@ extern void k_float_disable(k_tid_t thread); extern void k_cpu_idle(void); -extern uint32_t _timer_cycle_get_32(void); +extern u32_t _timer_cycle_get_32(void); #define _arch_k_cycle_get_32() _timer_cycle_get_32() /** kernel provided routine to report any detected fatal error. */ diff --git a/include/arch/x86/asm_inline_gcc.h b/include/arch/x86/asm_inline_gcc.h index b170835ccf4..383a6c9142e 100644 --- a/include/arch/x86/asm_inline_gcc.h +++ b/include/arch/x86/asm_inline_gcc.h @@ -96,7 +96,7 @@ static ALWAYS_INLINE void _do_irq_unlock(void) * after the 'cmovzl', the correct results are yielded. */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { unsigned int bitpos; @@ -146,7 +146,7 @@ static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) * after the 'cmovzl', the correct results are yielded. */ -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { unsigned int bitpos; @@ -180,14 +180,14 @@ static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) * @brief read timestamp register ensuring serialization */ -static inline uint64_t _tsc_read(void) +static inline u64_t _tsc_read(void) { union { struct { - uint32_t lo; - uint32_t hi; + u32_t lo; + u32_t hi; }; - uint64_t value; + u64_t value; } rv; /* rdtsc & cpuid clobbers eax, ebx, ecx and edx registers */ @@ -217,9 +217,9 @@ static inline uint64_t _tsc_read(void) */ static ALWAYS_INLINE - uint32_t _do_read_cpu_timestamp32(void) + u32_t _do_read_cpu_timestamp32(void) { - uint32_t rv; + u32_t rv; __asm__ volatile("rdtsc" : "=a"(rv) : : "%edx"); @@ -230,7 +230,7 @@ static ALWAYS_INLINE /* Implementation of sys_io.h's documented functions */ static ALWAYS_INLINE -void sys_out8(uint8_t data, io_port_t port) +void sys_out8(u8_t data, io_port_t port) { __asm__ volatile("outb %b0, %w1;\n\t" : @@ -239,9 +239,9 @@ void sys_out8(uint8_t data, io_port_t port) static ALWAYS_INLINE - uint8_t sys_in8(io_port_t port) + u8_t sys_in8(io_port_t port) { - uint8_t ret; + u8_t ret; __asm__ volatile("inb %w1, %b0;\n\t" : "=a"(ret) @@ -251,7 +251,7 @@ static ALWAYS_INLINE static ALWAYS_INLINE - void sys_out16(uint16_t data, io_port_t port) + void sys_out16(u16_t data, io_port_t port) { __asm__ volatile("outw %w0, %w1;\n\t" : @@ -260,9 +260,9 @@ static ALWAYS_INLINE static ALWAYS_INLINE - uint16_t sys_in16(io_port_t port) + u16_t sys_in16(io_port_t port) { - uint16_t ret; + u16_t ret; __asm__ volatile("inw %w1, %w0;\n\t" : "=a"(ret) @@ -272,7 +272,7 @@ static ALWAYS_INLINE static ALWAYS_INLINE - void sys_out32(uint32_t data, io_port_t port) + void sys_out32(u32_t data, io_port_t port) { __asm__ volatile("outl %0, %w1;\n\t" : @@ -281,9 +281,9 @@ static ALWAYS_INLINE static ALWAYS_INLINE - uint32_t sys_in32(io_port_t port) + u32_t sys_in32(io_port_t port) { - uint32_t ret; + u32_t ret; __asm__ volatile("inl %w1, %0;\n\t" : "=a"(ret) @@ -295,7 +295,7 @@ static ALWAYS_INLINE static ALWAYS_INLINE void sys_io_set_bit(io_port_t port, unsigned int bit) { - uint32_t reg = 0; + u32_t reg = 0; __asm__ volatile("inl %w1, %0;\n\t" "btsl %2, %0;\n\t" @@ -307,7 +307,7 @@ static ALWAYS_INLINE static ALWAYS_INLINE void sys_io_clear_bit(io_port_t port, unsigned int bit) { - uint32_t reg = 0; + u32_t reg = 0; __asm__ volatile("inl %w1, %0;\n\t" "btrl %2, %0;\n\t" @@ -319,7 +319,7 @@ static ALWAYS_INLINE static ALWAYS_INLINE int sys_io_test_bit(io_port_t port, unsigned int bit) { - uint32_t ret; + u32_t ret; __asm__ volatile("inl %w1, %0\n\t" "btl %2, %0\n\t" @@ -352,66 +352,66 @@ static ALWAYS_INLINE } static ALWAYS_INLINE - void sys_write8(uint8_t data, mm_reg_t addr) + void sys_write8(u8_t data, mm_reg_t addr) { __asm__ volatile("movb %0, %1;\n\t" : - : "q"(data), "m" (*(volatile uint8_t *) addr) + : "q"(data), "m" (*(volatile u8_t *) addr) : "memory"); } static ALWAYS_INLINE - uint8_t sys_read8(mm_reg_t addr) + u8_t sys_read8(mm_reg_t addr) { - uint8_t ret; + u8_t ret; __asm__ volatile("movb %1, %0;\n\t" : "=q"(ret) - : "m" (*(volatile uint8_t *) addr) + : "m" (*(volatile u8_t *) addr) : "memory"); return ret; } static ALWAYS_INLINE - void sys_write16(uint16_t data, mm_reg_t addr) + void sys_write16(u16_t data, mm_reg_t addr) { __asm__ volatile("movw %0, %1;\n\t" : - : "r"(data), "m" (*(volatile uint16_t *) addr) + : "r"(data), "m" (*(volatile u16_t *) addr) : "memory"); } static ALWAYS_INLINE - uint16_t sys_read16(mm_reg_t addr) + u16_t sys_read16(mm_reg_t addr) { - uint16_t ret; + u16_t ret; __asm__ volatile("movw %1, %0;\n\t" : "=r"(ret) - : "m" (*(volatile uint16_t *) addr) + : "m" (*(volatile u16_t *) addr) : "memory"); return ret; } static ALWAYS_INLINE - void sys_write32(uint32_t data, mm_reg_t addr) + void sys_write32(u32_t data, mm_reg_t addr) { __asm__ volatile("movl %0, %1;\n\t" : - : "r"(data), "m" (*(volatile uint32_t *) addr) + : "r"(data), "m" (*(volatile u32_t *) addr) : "memory"); } static ALWAYS_INLINE - uint32_t sys_read32(mm_reg_t addr) + u32_t sys_read32(mm_reg_t addr) { - uint32_t ret; + u32_t ret; __asm__ volatile("movl %1, %0;\n\t" : "=r"(ret) - : "m" (*(volatile uint32_t *) addr) + : "m" (*(volatile u32_t *) addr) : "memory"); return ret; @@ -422,7 +422,7 @@ static ALWAYS_INLINE void sys_set_bit(mem_addr_t addr, unsigned int bit) { __asm__ volatile("btsl %1, %0;\n\t" - : "+m" (*(volatile uint32_t *) (addr)) + : "+m" (*(volatile u32_t *) (addr)) : "Ir" (bit) : "memory"); } @@ -431,7 +431,7 @@ static ALWAYS_INLINE void sys_clear_bit(mem_addr_t addr, unsigned int bit) { __asm__ volatile("btrl %1, %0;\n\t" - : "+m" (*(volatile uint32_t *) (addr)) + : "+m" (*(volatile u32_t *) (addr)) : "Ir" (bit)); } @@ -442,7 +442,7 @@ static ALWAYS_INLINE __asm__ volatile("btl %2, %1;\n\t" "sbb %0, %0\n\t" - : "=r" (ret), "+m" (*(volatile uint32_t *) (addr)) + : "=r" (ret), "+m" (*(volatile u32_t *) (addr)) : "Ir" (bit)); return ret; @@ -455,7 +455,7 @@ static ALWAYS_INLINE __asm__ volatile("btsl %2, %1;\n\t" "sbb %0, %0\n\t" - : "=r" (ret), "+m" (*(volatile uint32_t *) (addr)) + : "=r" (ret), "+m" (*(volatile u32_t *) (addr)) : "Ir" (bit)); return ret; @@ -468,7 +468,7 @@ static ALWAYS_INLINE __asm__ volatile("btrl %2, %1;\n\t" "sbb %0, %0\n\t" - : "=r" (ret), "+m" (*(volatile uint32_t *) (addr)) + : "=r" (ret), "+m" (*(volatile u32_t *) (addr)) : "Ir" (bit)); return ret; diff --git a/include/arch/x86/irq_controller.h b/include/arch/x86/irq_controller.h index 9a57998248f..8905fd28f96 100644 --- a/include/arch/x86/irq_controller.h +++ b/include/arch/x86/irq_controller.h @@ -63,7 +63,7 @@ * @returns: N/A */ static inline void _irq_controller_irq_config(unsigned int vector, - unsigned int irq, uint32_t flags) + unsigned int irq, u32_t flags) { __irq_controller_irq_config(vector, irq, flags); } diff --git a/include/arch/x86/segmentation.h b/include/arch/x86/segmentation.h index e348c6fdd0c..d5d96c9ee4b 100644 --- a/include/arch/x86/segmentation.h +++ b/include/arch/x86/segmentation.h @@ -69,56 +69,56 @@ extern "C" { /* Section 7.2.1 of IA architecture SW developer manual, Vol 3. */ struct __packed task_state_segment { - uint16_t backlink; - uint16_t reserved_1; - uint32_t esp0; - uint16_t ss0; - uint16_t reserved_2; - uint32_t esp1; - uint16_t ss1; - uint16_t reserved_3; - uint32_t esp2; - uint16_t ss2; - uint16_t reserved_4; - uint32_t cr3; - uint32_t eip; - uint32_t eflags; - uint32_t eax; - uint32_t ecx; - uint32_t edx; - uint32_t ebx; - uint32_t esp; - uint32_t ebp; - uint32_t esi; - uint32_t edi; - uint16_t es; - uint16_t reserved_5; - uint16_t cs; - uint16_t reserved_6; - uint16_t ss; - uint16_t reserved_7; - uint16_t ds; - uint16_t reserved_8; - uint16_t fs; - uint16_t reserved_9; - uint16_t gs; - uint16_t reserved_10; - uint16_t ldt_ss; - uint16_t reserved_11; - uint8_t t:1; /* Trap bit */ - uint16_t reserved_12:15; - uint16_t iomap; + u16_t backlink; + u16_t reserved_1; + u32_t esp0; + u16_t ss0; + u16_t reserved_2; + u32_t esp1; + u16_t ss1; + u16_t reserved_3; + u32_t esp2; + u16_t ss2; + u16_t reserved_4; + u32_t cr3; + u32_t eip; + u32_t eflags; + u32_t eax; + u32_t ecx; + u32_t edx; + u32_t ebx; + u32_t esp; + u32_t ebp; + u32_t esi; + u32_t edi; + u16_t es; + u16_t reserved_5; + u16_t cs; + u16_t reserved_6; + u16_t ss; + u16_t reserved_7; + u16_t ds; + u16_t reserved_8; + u16_t fs; + u16_t reserved_9; + u16_t gs; + u16_t reserved_10; + u16_t ldt_ss; + u16_t reserved_11; + u8_t t:1; /* Trap bit */ + u16_t reserved_12:15; + u16_t iomap; }; /* Section 3.4.2 of IA architecture SW developer manual, Vol 3. */ struct __packed segment_selector { union { struct { - uint8_t rpl:2; - uint8_t table:1; /* 0=gdt 1=ldt */ - uint16_t index:13; + u8_t rpl:2; + u8_t table:1; /* 0=gdt 1=ldt */ + u16_t index:13; }; - uint16_t val; + u16_t val; }; }; @@ -138,39 +138,39 @@ struct __packed segment_descriptor { /* First DWORD: 0-15 */ union { /* IRQ, call, trap gates */ - uint16_t limit_low; + u16_t limit_low; /* Task gates */ - uint16_t reserved_task_gate_0; + u16_t reserved_task_gate_0; /* Everything else */ - uint16_t offset_low; + u16_t offset_low; }; /* First DWORD: 16-31 */ union { /* Call/Task/Interrupt/Trap gates */ - uint16_t segment_selector; + u16_t segment_selector; /* TSS/LDT/Segments */ - uint16_t base_low; /* Bits 0-15 */ + u16_t base_low; /* Bits 0-15 */ }; /* Second DWORD: 0-7 */ union { /* TSS/LDT/Segments */ - uint8_t base_mid; /* Bits 16-23 */ + u8_t base_mid; /* Bits 16-23 */ /* Task gates */ - uint8_t reserved_task_gate_1; + u8_t reserved_task_gate_1; /* IRQ/Trap/Call Gates */ struct { /* Reserved except in case of call gates */ - uint8_t reserved_or_param:5; + u8_t reserved_or_param:5; /* Bits 5-7 0 0 0 per CPU manual */ - uint8_t always_0_0:3; + u8_t always_0_0:3; }; }; @@ -179,59 +179,59 @@ struct __packed segment_descriptor { /* Code or data Segments */ struct { /* Set by the processor, init to 0 */ - uint8_t accessed:1; + u8_t accessed:1; /* executable ? readable : writable */ - uint8_t rw:1; + u8_t rw:1; /* executable ? conforming : direction */ - uint8_t cd:1; + u8_t cd:1; /* 1=code 0=data */ - uint8_t executable:1; + u8_t executable:1; /* Next 3 fields actually common to all */ /* 1=code or data, 0=system type */ - uint8_t descriptor_type:1; + u8_t descriptor_type:1; - uint8_t dpl:2; - uint8_t present:1; + u8_t dpl:2; + u8_t present:1; }; /* System types */ struct { /* One of the SEG_TYPE_* macros above */ - uint8_t type:4; + u8_t type:4; /* Alas, C doesn't let you do a union of the first * 4 bits of a bitfield and put the rest outside of it, * it ends up getting padded. */ - uint8_t use_other_union:4; + u8_t use_other_union:4; }; }; /* Second DWORD: 16-31 */ union { /* Call/IRQ/trap gates */ - uint16_t offset_hi; + u16_t offset_hi; /* Task Gates */ - uint16_t reserved_task_gate_2; + u16_t reserved_task_gate_2; /* segment/LDT/TSS */ struct { - uint8_t limit_hi:4; + u8_t limit_hi:4; /* flags */ - uint8_t avl:1; /* CPU ignores this */ + u8_t avl:1; /* CPU ignores this */ /* 1=Indicates 64-bit code segment in IA-32e mode */ - uint8_t flags_l:1; /* L field */ + u8_t flags_l:1; /* L field */ - uint8_t db:1; /* D/B field 1=32-bit 0=16-bit*/ - uint8_t granularity:1; + u8_t db:1; /* D/B field 1=32-bit 0=16-bit*/ + u8_t granularity:1; - uint8_t base_hi; /* Bits 24-31 */ + u8_t base_hi; /* Bits 24-31 */ }; }; @@ -242,7 +242,7 @@ struct __packed segment_descriptor { * IA manual calls this a 'pseudo descriptor'. */ struct __packed pseudo_descriptor { - uint16_t size; + u16_t size; struct segment_descriptor *entries; }; @@ -254,7 +254,7 @@ struct __packed far_ptr { /** Far pointer offset, unused when invoking a task. */ void *offset; /** Far pointer segment/gate selector. */ - uint16_t sel; + u16_t sel; }; @@ -270,7 +270,7 @@ struct __packed far_ptr { * or implement some tool to populate values post-link like gen_idt does. */ #define _LIMIT_AND_BASE(base_p, limit_p, granularity_p) \ - .base_low = (((uint32_t)base_p) & 0xFFFF), \ + .base_low = (((u32_t)base_p) & 0xFFFF), \ .base_mid = (((base_p) >> 16) & 0xFF), \ .base_hi = (((base_p) >> 24) & 0xFF), \ .limit_low = ((limit_p) & 0xFFFF), \ @@ -399,8 +399,8 @@ extern struct pseudo_descriptor _gdt; * @param segment_selector Segment selector */ static inline void _sd_set_seg_offset(struct segment_descriptor *sd, - uint16_t segment_selector, - uint32_t offset) + u16_t segment_selector, + u32_t offset) { sd->offset_low = offset & 0xFFFF; sd->offset_hi = offset >> 16; @@ -418,8 +418,8 @@ static inline void _sd_set_seg_offset(struct segment_descriptor *sd, * @param dpl descriptor privilege level */ static inline void _init_irq_gate(struct segment_descriptor *sd, - uint16_t seg_selector, uint32_t offset, - uint32_t dpl) + u16_t seg_selector, u32_t offset, + u32_t dpl) { _sd_set_seg_offset(sd, seg_selector, offset); sd->dpl = dpl; @@ -434,7 +434,7 @@ static inline void _init_irq_gate(struct segment_descriptor *sd, * @param sel Segment selector * @param offset Offset within that selector */ -static inline void _far_jump(uint16_t sel, void *offset) +static inline void _far_jump(u16_t sel, void *offset) { struct far_ptr ptr = { .sel = sel, @@ -451,7 +451,7 @@ static inline void _far_jump(uint16_t sel, void *offset) * @param sel Segment selector * @param offset Offset within that selector */ -static inline void _far_call(uint16_t sel, void *offset) +static inline void _far_call(u16_t sel, void *offset) { struct far_ptr ptr = { .sel = sel, @@ -467,7 +467,7 @@ static inline void _far_call(uint16_t sel, void *offset) * * @param sel Segment selector in GDT for desired TSS */ -static inline void _set_tss(uint16_t sel) +static inline void _set_tss(u16_t sel) { __asm__ __volatile__ ("ltr %0" :: "r" (sel)); } @@ -478,9 +478,9 @@ static inline void _set_tss(uint16_t sel) * * @return Segment selector for current IA task */ -static inline uint16_t _get_tss(void) +static inline u16_t _get_tss(void) { - uint16_t sel; + u16_t sel; __asm__ __volatile__ ("str %0" : "=r" (sel)); return sel; @@ -514,9 +514,9 @@ static inline void _get_idt(struct pseudo_descriptor *idt) * * @return Segment selector in the GDT for the current LDT */ -static inline uint16_t _get_ldt(void) +static inline u16_t _get_ldt(void) { - uint16_t ret; + u16_t ret; __asm__ __volatile__ ("sldt %0" : "=m" (ret)); return ret; @@ -528,7 +528,7 @@ static inline uint16_t _get_ldt(void) * * @param ldt Segment selector in the GDT for an LDT */ -static inline void _set_ldt(uint16_t ldt) +static inline void _set_ldt(u16_t ldt) { __asm__ __volatile__ ("lldt %0" :: "m" (ldt)); @@ -564,9 +564,9 @@ static inline void _set_idt(const struct pseudo_descriptor *idt) * * @return Segment selector */ -static inline uint16_t _get_cs(void) +static inline u16_t _get_cs(void) { - uint16_t cs = 0; + u16_t cs = 0; __asm__ __volatile__ ("mov %%cs, %0" : "=r" (cs)); return cs; @@ -578,9 +578,9 @@ static inline uint16_t _get_cs(void) * * @return Segment selector */ -static inline uint16_t _get_ds(void) +static inline u16_t _get_ds(void) { - uint16_t ds = 0; + u16_t ds = 0; __asm__ __volatile__ ("mov %%ds, %0" : "=r" (ds)); return ds; diff --git a/include/arch/xtensa/arch.h b/include/arch/xtensa/arch.h index 8ff69f20662..d65c4383b61 100644 --- a/include/arch/xtensa/arch.h +++ b/include/arch/xtensa/arch.h @@ -52,7 +52,7 @@ extern "C" { #define _NANO_ERR_RESERVED_IRQ (4) /* Reserved interrupt */ /* Xtensa GPRs are often designated by two different names */ -#define sys_define_gpr_with_alias(name1, name2) union { uint32_t name1, name2; } +#define sys_define_gpr_with_alias(name1, name2) union { u32_t name1, name2; } #include @@ -68,7 +68,7 @@ extern "C" { * @return most significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_msb_set(u32_t op) { if (!op) return 0; @@ -87,13 +87,13 @@ static ALWAYS_INLINE unsigned int find_msb_set(uint32_t op) * @return least significant bit set, 0 if @a op is 0 */ -static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) +static ALWAYS_INLINE unsigned int find_lsb_set(u32_t op) { return __builtin_ffs(op); } /* internal routine documented in C file, needed by IRQ_CONNECT() macro */ -extern void _irq_priority_set(uint32_t irq, uint32_t prio, uint32_t flags); +extern void _irq_priority_set(u32_t irq, u32_t prio, u32_t flags); /** @@ -142,7 +142,7 @@ extern void _irq_priority_set(uint32_t irq, uint32_t prio, uint32_t flags); FUNC_NORETURN void _SysFatalErrorHandler(unsigned int reason, const NANO_ESF *esf); -extern uint32_t _timer_cycle_get_32(void); +extern u32_t _timer_cycle_get_32(void); #define _arch_k_cycle_get_32() _timer_cycle_get_32() #endif /* !defined(_ASMLANGUAGE) && !defined(__ASSEMBLER__) */ diff --git a/include/arch/xtensa/exc.h b/include/arch/xtensa/exc.h index b6542b28826..c8f22146ae5 100644 --- a/include/arch/xtensa/exc.h +++ b/include/arch/xtensa/exc.h @@ -30,7 +30,7 @@ extern "C" { struct __esf { /* XXX - not finished yet */ sys_define_gpr_with_alias(a1, sp); - uint32_t pc; + u32_t pc; }; typedef struct __esf NANO_ESF; diff --git a/include/arch/xtensa/sys_io.h b/include/arch/xtensa/sys_io.h index 5b8dbbda4b3..dfcdd106d99 100644 --- a/include/arch/xtensa/sys_io.h +++ b/include/arch/xtensa/sys_io.h @@ -12,15 +12,15 @@ /* Memory mapped registers I/O functions */ -static ALWAYS_INLINE uint32_t sys_read32(mem_addr_t addr) +static ALWAYS_INLINE u32_t sys_read32(mem_addr_t addr) { - return *(volatile uint32_t *)addr; + return *(volatile u32_t *)addr; } -static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr) +static ALWAYS_INLINE void sys_write32(u32_t data, mem_addr_t addr) { - *(volatile uint32_t *)addr = data; + *(volatile u32_t *)addr = data; } @@ -28,16 +28,16 @@ static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr) static ALWAYS_INLINE void sys_set_bit(mem_addr_t addr, unsigned int bit) { - uint32_t temp = *(volatile uint32_t *)addr; + u32_t temp = *(volatile u32_t *)addr; - *(volatile uint32_t *)addr = temp | (1 << bit); + *(volatile u32_t *)addr = temp | (1 << bit); } static ALWAYS_INLINE void sys_clear_bit(mem_addr_t addr, unsigned int bit) { - uint32_t temp = *(volatile uint32_t *)addr; + u32_t temp = *(volatile u32_t *)addr; - *(volatile uint32_t *)addr = temp & ~(1 << bit); + *(volatile u32_t *)addr = temp & ~(1 << bit); } static ALWAYS_INLINE int sys_test_bit(mem_addr_t addr, unsigned int bit) diff --git a/include/arch/xtensa/xtensa_irq.h b/include/arch/xtensa/xtensa_irq.h index 68cf9103635..9c2d7f647fb 100644 --- a/include/arch/xtensa/xtensa_irq.h +++ b/include/arch/xtensa/xtensa_irq.h @@ -19,7 +19,7 @@ * * @return N/A */ -static ALWAYS_INLINE void _arch_irq_enable(uint32_t irq) +static ALWAYS_INLINE void _arch_irq_enable(u32_t irq) { _xt_ints_on(1 << irq); } @@ -33,7 +33,7 @@ static ALWAYS_INLINE void _arch_irq_enable(uint32_t irq) * * @return N/A */ -static ALWAYS_INLINE void _arch_irq_disable(uint32_t irq) +static ALWAYS_INLINE void _arch_irq_disable(u32_t irq) { _xt_ints_off(1 << irq); } diff --git a/include/clock_control.h b/include/clock_control.h index af9e9c72e74..9a8bd9a4e21 100644 --- a/include/clock_control.h +++ b/include/clock_control.h @@ -34,7 +34,7 @@ typedef int (*clock_control)(struct device *dev, clock_control_subsys_t sys); typedef int (*clock_control_get)(struct device *dev, clock_control_subsys_t sys, - uint32_t *rate); + u32_t *rate); struct clock_control_driver_api { clock_control on; @@ -79,7 +79,7 @@ static inline int clock_control_off(struct device *dev, */ static inline int clock_control_get_rate(struct device *dev, clock_control_subsys_t sys, - uint32_t *rate) + u32_t *rate) { const struct clock_control_driver_api *api = dev->driver_api; diff --git a/include/console.h b/include/console.h index 3b43864afaa..d7e77967d80 100644 --- a/include/console.h +++ b/include/console.h @@ -34,7 +34,7 @@ void console_getchar_init(void); * * @return A character read, including control characters. */ -uint8_t console_getchar(void); +u8_t console_getchar(void); /** @brief Initialize console_getline() call. * diff --git a/include/counter.h b/include/counter.h index 2b486ea0e4e..a47d6760c3c 100644 --- a/include/counter.h +++ b/include/counter.h @@ -31,11 +31,11 @@ typedef void (*counter_callback_t)(struct device *dev, void *user_data); typedef int (*counter_api_start)(struct device *dev); typedef int (*counter_api_stop)(struct device *dev); -typedef uint32_t (*counter_api_read)(struct device *dev); +typedef u32_t (*counter_api_read)(struct device *dev); typedef int (*counter_api_set_alarm)(struct device *dev, counter_callback_t callback, - uint32_t count, void *user_data); -typedef uint32_t (*counter_api_get_pending_int)(struct device *dev); + u32_t count, void *user_data); +typedef u32_t (*counter_api_get_pending_int)(struct device *dev); struct counter_driver_api { counter_api_start start; @@ -85,7 +85,7 @@ static inline int counter_stop(struct device *dev) * * @return 32-bit value */ -static inline uint32_t counter_read(struct device *dev) +static inline u32_t counter_read(struct device *dev) { const struct counter_driver_api *api = dev->driver_api; @@ -108,7 +108,7 @@ static inline uint32_t counter_read(struct device *dev) */ static inline int counter_set_alarm(struct device *dev, counter_callback_t callback, - uint32_t count, void *user_data) + u32_t count, void *user_data) { const struct counter_driver_api *api = dev->driver_api; diff --git a/include/crc16.h b/include/crc16.h index 860a292d1ea..f041203d0c8 100644 --- a/include/crc16.h +++ b/include/crc16.h @@ -28,8 +28,8 @@ * * @return The computed CRC16 value */ -uint16_t crc16(const uint8_t *src, size_t len, uint16_t polynomial, - uint16_t initial_value); +u16_t crc16(const u8_t *src, size_t len, u16_t polynomial, + u16_t initial_value); /** * @brief Compute CCITT variant of CRC 16 @@ -42,7 +42,7 @@ uint16_t crc16(const uint8_t *src, size_t len, uint16_t polynomial, * * @return The computed CRC16 value */ -static inline uint16_t crc16_ccitt(const uint8_t *src, size_t len) +static inline u16_t crc16_ccitt(const u8_t *src, size_t len) { return crc16(src, len, 0x1021, 0xffff); } @@ -58,7 +58,7 @@ static inline uint16_t crc16_ccitt(const uint8_t *src, size_t len) * * @return The computed CRC16 value */ -static inline uint16_t crc16_ansi(const uint8_t *src, size_t len) +static inline u16_t crc16_ansi(const u8_t *src, size_t len) { return crc16(src, len, 0x8005, 0xffff); } diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h index e941db035d3..0a69f16c452 100644 --- a/include/crypto/cipher.h +++ b/include/crypto/cipher.h @@ -105,7 +105,7 @@ static inline int cipher_begin_session(struct device *dev, enum cipher_op optype) { struct crypto_driver_api *api; - uint32_t flags; + u32_t flags; api = (struct crypto_driver_api *) dev->driver_api; ctx->device = dev; @@ -210,7 +210,7 @@ static inline int cipher_block_op(struct cipher_ctx *ctx, * @return 0 on success, negative errno code on fail. */ static inline int cipher_cbc_op(struct cipher_ctx *ctx, - struct cipher_pkt *pkt, uint8_t *iv) + struct cipher_pkt *pkt, u8_t *iv) { __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CBC, "CBC mode " "session invoking a different mode handler"); @@ -237,7 +237,7 @@ static inline int cipher_cbc_op(struct cipher_ctx *ctx, * @return 0 on success, negative errno code on fail. */ static inline int cipher_ctr_op(struct cipher_ctx *ctx, - struct cipher_pkt *pkt, uint8_t *iv) + struct cipher_pkt *pkt, u8_t *iv) { __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CTR, "CTR mode " "session invoking a different mode handler"); @@ -259,7 +259,7 @@ static inline int cipher_ctr_op(struct cipher_ctx *ctx, * @return 0 on success, negative errno code on fail. */ static inline int cipher_ccm_op(struct cipher_ctx *ctx, - struct cipher_aead_pkt *pkt, uint8_t *nonce) + struct cipher_aead_pkt *pkt, u8_t *nonce) { __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CCM, "CCM mode " "session invoking a different mode handler"); diff --git a/include/crypto/cipher_structs.h b/include/crypto/cipher_structs.h index 6c0e5f1d924..61f1aa3737e 100644 --- a/include/crypto/cipher_structs.h +++ b/include/crypto/cipher_structs.h @@ -51,13 +51,13 @@ typedef int (*block_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt); * like CBC, CTR, CCM. */ typedef int (*cbc_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt, - uint8_t *iv); + u8_t *iv); typedef int (*ctr_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt, - uint8_t *ctr); + u8_t *ctr); typedef int (*ccm_op_t)(struct cipher_ctx *ctx, struct cipher_aead_pkt *pkt, - uint8_t *nonce); + u8_t *nonce); struct cipher_ops { @@ -72,15 +72,15 @@ struct cipher_ops { }; struct ccm_params { - uint16_t tag_len; - uint16_t nonce_len; + u16_t tag_len; + u16_t nonce_len; }; struct ctr_params { /* CTR mode counter is a split counter composed of iv and counter * such that ivlen + ctr_len = keylen */ - uint32_t ctr_len; + u32_t ctr_len; }; /* Structure encoding session parameters. Refer to comments for individual @@ -98,7 +98,7 @@ struct cipher_ctx { /* To be populated by the app before calling begin_session() */ union { /* Cryptographic key to be used in this session */ - uint8_t *bit_stream; + u8_t *bit_stream; /* For cases where key is protected and is not * available to caller */ @@ -140,7 +140,7 @@ struct cipher_ctx { /* Cryptographic keylength in bytes. To be populated by the app * before calling begin_session() */ - uint16_t keylen; + u16_t keylen; /* How certain fields are to be interpreted for this sesssion. @@ -148,7 +148,7 @@ struct cipher_ctx { * An app can obtain the capability flags supported by a hw/driver * by calling cipher_query_hwcaps(). (A bitmask of CAP_* below) */ - uint16_t flags; + u16_t flags; }; /* Various cipher_ctx.flags options. Not all drivers support all flags. @@ -186,7 +186,7 @@ struct cipher_ctx { struct cipher_pkt { /* Start address of Input buffer */ - uint8_t *in_buf; + u8_t *in_buf; /* Bytes to be operated upon */ int in_len; @@ -195,7 +195,7 @@ struct cipher_pkt { * the application. Can be NULL for in place ops. To be populated * with contents by the driver on return from op / async_callback */ - uint8_t *out_buf; + u8_t *out_buf; /* Size of the out_buf area allocated by the application. Drivers should * not write past the size of output buffer @@ -212,7 +212,7 @@ struct cipher_pkt { * returns a first level success / failure status. To be populated * by the driver on return from op / async_callback. */ - uint8_t status; + u8_t status; /* Context this packet relates to. This can be useful to get the * session details esp for async ops. Will be populated by the @@ -230,16 +230,16 @@ struct cipher_aead_pkt { struct cipher_pkt *pkt; /* Start address for Associated data. This has to be supplied by app */ - uint8_t *ad; + u8_t *ad; /* Size of Associated data. This has to be supplied by the app */ - uint32_t ad_len; + u32_t ad_len; /* Start address for the Auth hash. For an Encryption op this will * be populated by the driver when it returns from cipher_ccm_op call. * For a decryption op this has to be supplied by the app. */ - uint8_t *tag; + u8_t *tag; }; /* Prototype for the application function to be invoked by the crypto driver diff --git a/include/device.h b/include/device.h index 0bc4b7e8b43..21df6c86811 100644 --- a/include/device.h +++ b/include/device.h @@ -274,7 +274,7 @@ struct device_config { char *name; int (*init)(struct device *device); #ifdef CONFIG_DEVICE_POWER_MANAGEMENT - int (*device_pm_control)(struct device *device, uint32_t command, + int (*device_pm_control)(struct device *device, u32_t command, void *context); #endif const void *config_info; @@ -353,7 +353,7 @@ void device_busy_clear(struct device *busy_dev); * @retval 0 Always returns 0 */ int device_pm_control_nop(struct device *unused_device, - uint32_t unused_ctrl_command, void *unused_context); + u32_t unused_ctrl_command, void *unused_context); /** * @brief Call the set power state function of a device * @@ -367,7 +367,7 @@ int device_pm_control_nop(struct device *unused_device, * @retval Errno Negative errno code if failure. */ static inline int device_set_power_state(struct device *device, - uint32_t device_power_state) + u32_t device_power_state) { return device->config->device_pm_control(device, DEVICE_PM_SET_POWER_STATE, &device_power_state); @@ -387,7 +387,7 @@ static inline int device_set_power_state(struct device *device, * @retval Errno Negative errno code if failure. */ static inline int device_get_power_state(struct device *device, - uint32_t *device_power_state) + u32_t *device_power_state) { return device->config->device_pm_control(device, DEVICE_PM_GET_POWER_STATE, device_power_state); diff --git a/include/disk_access.h b/include/disk_access.h index 6a4029fb906..c4fc139dcc1 100644 --- a/include/disk_access.h +++ b/include/disk_access.h @@ -72,8 +72,8 @@ int disk_access_status(void); * * @return 0 on success, negative errno code on fail */ -int disk_access_read(uint8_t *data_buf, uint32_t start_sector, - uint32_t num_sector); +int disk_access_read(u8_t *data_buf, u32_t start_sector, + u32_t num_sector); /* * @brief write data to disk @@ -86,8 +86,8 @@ int disk_access_read(uint8_t *data_buf, uint32_t start_sector, * * @return 0 on success, negative errno code on fail */ -int disk_access_write(const uint8_t *data_buf, uint32_t start_sector, - uint32_t num_sector); +int disk_access_write(const u8_t *data_buf, u32_t start_sector, + u32_t num_sector); /* * @brief Get/Configure disk parameters @@ -98,7 +98,7 @@ int disk_access_write(const uint8_t *data_buf, uint32_t start_sector, * * @return 0 on success, negative errno code on fail */ -int disk_access_ioctl(uint8_t cmd, void *buff); +int disk_access_ioctl(u8_t cmd, void *buff); #ifdef __cplusplus diff --git a/include/display/grove_lcd.h b/include/display/grove_lcd.h index 5f222640cfe..5d888afe887 100644 --- a/include/display/grove_lcd.h +++ b/include/display/grove_lcd.h @@ -20,7 +20,7 @@ extern "C" { * @param data the ASCII text to display * @param size the length of the text in bytes */ -void glcd_print(struct device *port, char *data, uint32_t size); +void glcd_print(struct device *port, char *data, u32_t size); /** @@ -30,7 +30,7 @@ void glcd_print(struct device *port, char *data, uint32_t size); * @param col the column for the cursor to be moved to (0-15) * @param row the row it should be moved to (0 or 1) */ -void glcd_cursor_pos_set(struct device *port, uint8_t col, uint8_t row); +void glcd_cursor_pos_set(struct device *port, u8_t col, u8_t row); /** * @brief Clear the current display @@ -57,7 +57,7 @@ void glcd_clear(struct device *port); * @param opt An 8bit bitmask of GLCD_DS_* options. * */ -void glcd_display_state_set(struct device *port, uint8_t opt); +void glcd_display_state_set(struct device *port, u8_t opt); /** * @brief return the display feature set associated with the device @@ -66,7 +66,7 @@ void glcd_display_state_set(struct device *port, uint8_t opt); * * @return the display feature set associated with the device. */ -uint8_t glcd_display_state_get(struct device *port); +u8_t glcd_display_state_get(struct device *port); /* Defines for the GLCD_CMD_INPUT_SET to change text direction */ #define GLCD_IS_SHIFT_INCREMENT (1 << 1) @@ -83,7 +83,7 @@ uint8_t glcd_display_state_get(struct device *port); * @param opt A bitmask of GLCD_IS_* options * */ -void glcd_input_state_set(struct device *port, uint8_t opt); +void glcd_input_state_set(struct device *port, u8_t opt); /** * @brief return the input set associated with the device @@ -92,7 +92,7 @@ void glcd_input_state_set(struct device *port, uint8_t opt); * * @return the input set associated with the device. */ -uint8_t glcd_input_state_get(struct device *port); +u8_t glcd_input_state_get(struct device *port); /* Defines for the LCD_FUNCTION_SET */ #define GLCD_FS_8BIT_MODE (1 << 4) @@ -111,7 +111,7 @@ uint8_t glcd_input_state_get(struct device *port); * of the display as per needed. Controlling things like the number of rows, * dot size, and text display quality. */ -void glcd_function_set(struct device *port, uint8_t opt); +void glcd_function_set(struct device *port, u8_t opt); /** * @brief return the function set associated with the device @@ -120,7 +120,7 @@ void glcd_function_set(struct device *port, uint8_t opt); * * @return the function features set associated with the device. */ -uint8_t glcd_function_get(struct device *port); +u8_t glcd_function_get(struct device *port); /* Available color selections */ @@ -133,7 +133,7 @@ uint8_t glcd_function_get(struct device *port); * @param port Pointer to device structure for driver instance. * @param color One of the pre-defined color options */ -void glcd_color_select(struct device *port, uint8_t color); +void glcd_color_select(struct device *port, u8_t color); /** @@ -144,7 +144,7 @@ void glcd_color_select(struct device *port, uint8_t color); * @param g A numeric value for the green color (max is 255) * @param b A numeric value for the blue color (max is 255) */ -void glcd_color_set(struct device *port, uint8_t r, uint8_t g, uint8_t b); +void glcd_color_set(struct device *port, u8_t r, u8_t g, u8_t b); /** diff --git a/include/display/mb_display.h b/include/display/mb_display.h index f82ce8c9159..6d1237bf02b 100644 --- a/include/display/mb_display.h +++ b/include/display/mb_display.h @@ -36,13 +36,13 @@ extern "C" { struct mb_image { union { struct { - uint8_t c1:1, + u8_t c1:1, c2:1, c3:1, c4:1, c5:1; } r[5]; - uint8_t row[5]; + u8_t row[5]; }; }; @@ -127,8 +127,8 @@ struct mb_display *mb_display_get(void); * @param img Array of image bitmaps (struct mb_image objects). * @param img_count Number of images in 'img' array. */ -void mb_display_image(struct mb_display *disp, uint32_t mode, int32_t duration, - const struct mb_image *img, uint8_t img_count); +void mb_display_image(struct mb_display *disp, u32_t mode, s32_t duration, + const struct mb_image *img, u8_t img_count); /** * @brief Print a string of characters on the BBC micro:bit LED display. @@ -147,7 +147,7 @@ void mb_display_image(struct mb_display *disp, uint32_t mode, int32_t duration, * @param ... Optional list of format arguments. */ __printf_like(4, 5) void mb_display_print(struct mb_display *disp, - uint32_t mode, int32_t duration, + u32_t mode, s32_t duration, const char *fmt, ...); /** diff --git a/include/dma.h b/include/dma.h index f6ededd7dce..448f24343c7 100644 --- a/include/dma.h +++ b/include/dma.h @@ -66,7 +66,7 @@ enum dma_channel_direction { */ struct dma_channel_config { /* Hardware Interface handshake for peripheral (I2C, SPI, etc) */ - uint32_t handshake_interface; + u32_t handshake_interface; /* Select active polarity for handshake (low/high) */ enum dma_handshake_polarity handshake_polarity; /* DMA transfer direction from mem/peripheral to mem/peripheral */ @@ -95,11 +95,11 @@ struct dma_channel_config { */ struct dma_transfer_config { /* Total amount of data in bytes to transfer */ - uint32_t block_size; + u32_t block_size; /* Source address for the transaction */ - uint32_t *source_address; + u32_t *source_address; /* Destination address */ - uint32_t *destination_address; + u32_t *destination_address; }; /** @@ -137,23 +137,23 @@ struct dma_transfer_config { * reserved [ 13 : 15 ] */ struct dma_block_config { - uint32_t source_address; - uint32_t source_gather_interval; - uint32_t dest_address; - uint32_t dest_scatter_interval; - uint16_t dest_scatter_count; - uint16_t source_gather_count; - uint32_t block_size; + u32_t source_address; + u32_t source_gather_interval; + u32_t dest_address; + u32_t dest_scatter_interval; + u16_t dest_scatter_count; + u16_t source_gather_count; + u32_t block_size; struct dma_block_config *next_block; - uint16_t source_gather_en : 1; - uint16_t dest_scatter_en : 1; - uint16_t source_addr_adj : 2; - uint16_t dest_addr_adj : 2; - uint16_t source_reload_en : 1; - uint16_t dest_reload_en : 1; - uint16_t fifo_mode_control : 4; - uint16_t flow_control_mode : 1; - uint16_t reserved : 3; + u16_t source_gather_en : 1; + u16_t dest_scatter_en : 1; + u16_t source_addr_adj : 2; + u16_t dest_addr_adj : 2; + u16_t source_reload_en : 1; + u16_t dest_reload_en : 1; + u16_t fifo_mode_control : 4; + u16_t flow_control_mode : 1; + u16_t reserved : 3; }; /** @@ -192,23 +192,23 @@ struct dma_block_config { * (error_code: zero-transfer success, non zero-error happens). */ struct dma_config { - uint32_t dma_slot : 6; - uint32_t channel_direction : 3; - uint32_t complete_callback_en : 1; - uint32_t error_callback_en : 1; - uint32_t source_handshake : 1; - uint32_t dest_handshake : 1; - uint32_t channel_priority : 4; - uint32_t source_chaining_en : 1; - uint32_t dest_chaining_en : 1; - uint32_t reserved : 13; - uint32_t source_data_size : 16; - uint32_t dest_data_size : 16; - uint32_t source_burst_length : 16; - uint32_t dest_burst_length : 16; - uint32_t block_count; + u32_t dma_slot : 6; + u32_t channel_direction : 3; + u32_t complete_callback_en : 1; + u32_t error_callback_en : 1; + u32_t source_handshake : 1; + u32_t dest_handshake : 1; + u32_t channel_priority : 4; + u32_t source_chaining_en : 1; + u32_t dest_chaining_en : 1; + u32_t reserved : 13; + u32_t source_data_size : 16; + u32_t dest_data_size : 16; + u32_t source_burst_length : 16; + u32_t dest_burst_length : 16; + u32_t block_count; struct dma_block_config *head_block; - void (*dma_callback)(struct device *dev, uint32_t channel, + void (*dma_callback)(struct device *dev, u32_t channel, int error_code); }; @@ -219,22 +219,22 @@ struct dma_config { * public documentation. */ -typedef int (*dma_api_channel_config)(struct device *dev, uint32_t channel, +typedef int (*dma_api_channel_config)(struct device *dev, u32_t channel, struct dma_channel_config *config); -typedef int (*dma_api_transfer_config)(struct device *dev, uint32_t channel, +typedef int (*dma_api_transfer_config)(struct device *dev, u32_t channel, struct dma_transfer_config *config); -typedef int (*dma_api_transfer_start)(struct device *dev, uint32_t channel); +typedef int (*dma_api_transfer_start)(struct device *dev, u32_t channel); -typedef int (*dma_api_transfer_stop)(struct device *dev, uint32_t channel); +typedef int (*dma_api_transfer_stop)(struct device *dev, u32_t channel); -typedef int (*dma_api_config)(struct device *dev, uint32_t channel, +typedef int (*dma_api_config)(struct device *dev, u32_t channel, struct dma_config *config); -typedef int (*dma_api_start)(struct device *dev, uint32_t channel); +typedef int (*dma_api_start)(struct device *dev, u32_t channel); -typedef int (*dma_api_stop)(struct device *dev, uint32_t channel); +typedef int (*dma_api_stop)(struct device *dev, u32_t channel); struct dma_driver_api { dma_api_channel_config channel_config; @@ -260,7 +260,7 @@ struct dma_driver_api { * @retval 0 if successful. * @retval Negative errno code if failure. */ -static inline int dma_config(struct device *dev, uint32_t channel, +static inline int dma_config(struct device *dev, u32_t channel, struct dma_config *config) { const struct dma_driver_api *api = dev->driver_api; @@ -279,7 +279,7 @@ static inline int dma_config(struct device *dev, uint32_t channel, * @retval 0 if successful. * @retval Negative errno code if failure. */ -static inline int dma_start(struct device *dev, uint32_t channel) +static inline int dma_start(struct device *dev, u32_t channel) { const struct dma_driver_api *api = dev->driver_api; @@ -296,7 +296,7 @@ static inline int dma_start(struct device *dev, uint32_t channel) * @retval 0 if successful. * @retval Negative errno code if failure. */ -static inline int dma_stop(struct device *dev, uint32_t channel) +static inline int dma_stop(struct device *dev, u32_t channel) { const struct dma_driver_api *api = dev->driver_api; @@ -315,7 +315,7 @@ static inline int dma_stop(struct device *dev, uint32_t channel) * @retval Negative errno code if failure. */ static inline int __deprecated dma_channel_config(struct device *dev, - uint32_t channel, struct dma_channel_config *config) + u32_t channel, struct dma_channel_config *config) { const struct dma_driver_api *api = dev->driver_api; @@ -335,7 +335,7 @@ static inline int __deprecated dma_channel_config(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated dma_transfer_config(struct device *dev, - uint32_t channel, struct dma_transfer_config *config) + u32_t channel, struct dma_transfer_config *config) { const struct dma_driver_api *api = dev->driver_api; @@ -354,7 +354,7 @@ static inline int __deprecated dma_transfer_config(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated dma_transfer_start(struct device *dev, - uint32_t channel) + u32_t channel) { const struct dma_driver_api *api = dev->driver_api; @@ -372,7 +372,7 @@ static inline int __deprecated dma_transfer_start(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated dma_transfer_stop(struct device *dev, - uint32_t channel) + u32_t channel) { const struct dma_driver_api *api = dev->driver_api; @@ -392,7 +392,7 @@ static inline int __deprecated dma_transfer_stop(struct device *dev, * * @retval common DMA index to be placed into registers. */ -static inline enum dma_burst_length dma_width_index(uint32_t size) +static inline enum dma_burst_length dma_width_index(u32_t size) { /* Check boundaries (max supported width is 32 Bytes) */ if (size < 1 || size > 32) { @@ -421,7 +421,7 @@ static inline enum dma_burst_length dma_width_index(uint32_t size) * * @retval common DMA index to be placed into registers. */ -static inline enum dma_burst_length dma_burst_index(uint32_t burst) +static inline enum dma_burst_length dma_burst_index(u32_t burst) { /* Check boundaries (max supported burst length is 256) */ if (burst < 1 || burst > 256) { diff --git a/include/drivers/clock_control/arm_clock_control.h b/include/drivers/clock_control/arm_clock_control.h index 06fca28402c..6d0c4121333 100644 --- a/include/drivers/clock_control/arm_clock_control.h +++ b/include/drivers/clock_control/arm_clock_control.h @@ -34,7 +34,7 @@ struct arm_clock_control_t { /* Clock can be configured for 3 states: Active, Sleep, Deep Sleep */ enum arm_soc_state_t state; /* Identifies the device on the bus */ - uint32_t device; + u32_t device; }; #endif /* _ARM_CLOCK_CONTROL_H_ */ diff --git a/include/drivers/clock_control/stm32_clock_control.h b/include/drivers/clock_control/stm32_clock_control.h index 085efdf727a..63bd59427bb 100644 --- a/include/drivers/clock_control/stm32_clock_control.h +++ b/include/drivers/clock_control/stm32_clock_control.h @@ -32,8 +32,8 @@ enum { }; struct stm32_pclken { - uint32_t bus; - uint32_t enr; + u32_t bus; + u32_t enr; }; #endif /* _STM32_CLOCK_CONTROL_H_ */ diff --git a/include/drivers/clock_control/stm32f4_clock_control.h b/include/drivers/clock_control/stm32f4_clock_control.h index c7af0085522..7580ac5bd2c 100644 --- a/include/drivers/clock_control/stm32f4_clock_control.h +++ b/include/drivers/clock_control/stm32f4_clock_control.h @@ -127,8 +127,8 @@ enum { }; struct stm32f4x_pclken { - uint32_t bus; - uint32_t enr; + u32_t bus; + u32_t enr; }; #endif /* _STM32F4_CLOCK_CONTROL_H_ */ diff --git a/include/drivers/console/console.h b/include/drivers/console/console.h index 490050bc454..99afe20bf88 100644 --- a/include/drivers/console/console.h +++ b/include/drivers/console/console.h @@ -40,7 +40,7 @@ struct console_input { * @return N/A */ typedef void (*console_input_fn)(struct k_fifo *avail, struct k_fifo *lines, - uint8_t (*completion)(char *str, uint8_t len)); + u8_t (*completion)(char *str, u8_t len)); #ifdef __cplusplus } diff --git a/include/drivers/console/ipm_console.h b/include/drivers/console/ipm_console.h index 09cfe7b31c1..5e6882e6ea4 100644 --- a/include/drivers/console/ipm_console.h +++ b/include/drivers/console/ipm_console.h @@ -41,7 +41,7 @@ struct ipm_console_receiver_config_info { * Ring buffer data area for stashing characters from the interrupt * callback */ - uint32_t *ring_buf_data; + u32_t *ring_buf_data; /** Size of ring_buf_data in 32-bit chunks */ unsigned int rb_size32; diff --git a/include/drivers/console/telnet_console.h b/include/drivers/console/telnet_console.h index fe983dcf468..530888e24b6 100644 --- a/include/drivers/console/telnet_console.h +++ b/include/drivers/console/telnet_console.h @@ -28,7 +28,7 @@ extern "C" { * @return N/A */ void telnet_register_input(struct k_fifo *avail, struct k_fifo *lines, - uint8_t (*completion)(char *str, uint8_t len)); + u8_t (*completion)(char *str, u8_t len)); #ifdef __cplusplus } diff --git a/include/drivers/console/uart_console.h b/include/drivers/console/uart_console.h index 8277e7e1959..7e4684eb60f 100644 --- a/include/drivers/console/uart_console.h +++ b/include/drivers/console/uart_console.h @@ -30,7 +30,7 @@ extern "C" { * @return N/A */ void uart_register_input(struct k_fifo *avail, struct k_fifo *lines, - uint8_t (*completion)(char *str, uint8_t len)); + u8_t (*completion)(char *str, u8_t len)); /* * Allows having debug hooks in the console driver for handling incoming @@ -44,7 +44,7 @@ typedef UART_CONSOLE_OUT_DEBUG_HOOK_SIG(uart_console_out_debug_hook_t); void uart_console_out_debug_hook_install( uart_console_out_debug_hook_t *hook); -typedef int (*uart_console_in_debug_hook_t) (uint8_t); +typedef int (*uart_console_in_debug_hook_t) (u8_t); void uart_console_in_debug_hook_install(uart_console_in_debug_hook_t hook); diff --git a/include/drivers/console/uart_pipe.h b/include/drivers/console/uart_pipe.h index ee8f41e5c60..ca13c6f9d4a 100644 --- a/include/drivers/console/uart_pipe.h +++ b/include/drivers/console/uart_pipe.h @@ -29,7 +29,7 @@ extern "C" { * * @return Buffer to be used on next receive. */ -typedef uint8_t *(*uart_pipe_recv_cb)(uint8_t *buf, size_t *off); +typedef u8_t *(*uart_pipe_recv_cb)(u8_t *buf, size_t *off); /** @brief Register UART application. * @@ -39,7 +39,7 @@ typedef uint8_t *(*uart_pipe_recv_cb)(uint8_t *buf, size_t *off); * @param len Size of buffer. * @param cb Callback to be called on data reception. */ -void uart_pipe_register(uint8_t *buf, size_t len, uart_pipe_recv_cb cb); +void uart_pipe_register(u8_t *buf, size_t len, uart_pipe_recv_cb cb); /** @brief Send data over UART. * @@ -50,7 +50,7 @@ void uart_pipe_register(uint8_t *buf, size_t len, uart_pipe_recv_cb cb); * * @return 0 on success or negative error */ -int uart_pipe_send(const uint8_t *data, int len); +int uart_pipe_send(const u8_t *data, int len); #ifdef __cplusplus } diff --git a/include/drivers/gpio/gpio_mmio32.h b/include/drivers/gpio/gpio_mmio32.h index 332315886a6..228f14938e0 100644 --- a/include/drivers/gpio/gpio_mmio32.h +++ b/include/drivers/gpio/gpio_mmio32.h @@ -12,13 +12,13 @@ #include struct gpio_mmio32_config { - volatile uint32_t *reg; - uint32_t mask; + volatile u32_t *reg; + u32_t mask; }; struct gpio_mmio32_context { const struct gpio_mmio32_config *config; - uint32_t invert; /* Mask of 'reg' bits that should be inverted */ + u32_t invert; /* Mask of 'reg' bits that should be inverted */ }; int gpio_mmio32_init(struct device *dev); @@ -43,7 +43,7 @@ int gpio_mmio32_init(struct device *dev); static struct gpio_mmio32_context _dev_name##_dev_data; \ \ static const struct gpio_mmio32_config _dev_name##_dev_cfg = { \ - .reg = (volatile uint32_t *)_address, \ + .reg = (volatile u32_t *)_address, \ .mask = _mask, \ }; \ \ diff --git a/include/drivers/ioapic.h b/include/drivers/ioapic.h index 7c2edece23a..8914f9716da 100644 --- a/include/drivers/ioapic.h +++ b/include/drivers/ioapic.h @@ -41,7 +41,7 @@ extern "C" { void _ioapic_irq_enable(unsigned int irq); void _ioapic_irq_disable(unsigned int irq); void _ioapic_int_vec_set(unsigned int irq, unsigned int vector); -void _ioapic_irq_set(unsigned int irq, unsigned int vector, uint32_t flags); +void _ioapic_irq_set(unsigned int irq, unsigned int vector, u32_t flags); #endif /* _ASMLANGUAGE */ #ifdef __cplusplus diff --git a/include/drivers/k20_sim.h b/include/drivers/k20_sim.h index 8bf7f0a7471..39b63a5e3ad 100644 --- a/include/drivers/k20_sim.h +++ b/include/drivers/k20_sim.h @@ -28,116 +28,116 @@ extern "C" { #define SIM_OCS32K_LPO 3 /* 1kHz */ typedef union { - uint32_t value; /* reset = 0x8000 F03F */ + u32_t value; /* reset = 0x8000 F03F */ struct { - uint32_t res_0_11 : 12 __packed; - uint32_t ram_size : 4 __packed; - uint32_t res_16_17 : 2 __packed; - uint32_t osc32k_sel : 2 __packed; - uint32_t res_20_28 : 9 __packed; - uint32_t usb_volt_stby : 1 __packed; - uint32_t usb_stop_stby : 1 __packed; - uint32_t usb_reg_en : 1 __packed; + u32_t res_0_11 : 12 __packed; + u32_t ram_size : 4 __packed; + u32_t res_16_17 : 2 __packed; + u32_t osc32k_sel : 2 __packed; + u32_t res_20_28 : 9 __packed; + u32_t usb_volt_stby : 1 __packed; + u32_t usb_stop_stby : 1 __packed; + u32_t usb_reg_en : 1 __packed; } field; } SIM_SOPT1_t; /* 0x000 */ typedef union { - uint32_t value; + u32_t value; struct { - uint32_t res_0_23 : 24 __packed; - uint32_t usb_reg_write_en : 1 __packed; - uint32_t usb_volt_write_en : 1 __packed; - uint32_t usb_stop_write_en : 1 __packed; - uint32_t res_27_31 : 5 __packed; + u32_t res_0_23 : 24 __packed; + u32_t usb_reg_write_en : 1 __packed; + u32_t usb_volt_write_en : 1 __packed; + u32_t usb_stop_write_en : 1 __packed; + u32_t res_27_31 : 5 __packed; } field; } SIM_SOPT1CFG_t; /* 0x004 */ typedef union { - uint32_t value; + u32_t value; struct { - uint32_t res_0_3 : 4 __packed; - uint32_t rtc_clk_out_sel : 1 __packed; - uint32_t clk_out_sel : 3 __packed; - uint32_t flex_bus_sl : 2 __packed; - uint32_t res_10 : 1 __packed; - uint32_t ptd7pad : 1 __packed; - uint32_t trace_clk_sel : 1 __packed; - uint32_t res_13_15 : 3 __packed; - uint32_t fll_pll_clk_sel : 1 __packed; - uint32_t res_17 : 1 __packed; - uint32_t usb_src : 1 __packed; - uint32_t res_19_31 : 13 __packed; + u32_t res_0_3 : 4 __packed; + u32_t rtc_clk_out_sel : 1 __packed; + u32_t clk_out_sel : 3 __packed; + u32_t flex_bus_sl : 2 __packed; + u32_t res_10 : 1 __packed; + u32_t ptd7pad : 1 __packed; + u32_t trace_clk_sel : 1 __packed; + u32_t res_13_15 : 3 __packed; + u32_t fll_pll_clk_sel : 1 __packed; + u32_t res_17 : 1 __packed; + u32_t usb_src : 1 __packed; + u32_t res_19_31 : 13 __packed; } field; } SIM_SOPT2_t; /* 0x1004 */ typedef union { - uint32_t value; + u32_t value; struct { - uint32_t ftm0_flt0 : 1 __packed; - uint32_t ftm0_flt1 : 1 __packed; - uint32_t ftm0_flt2 : 1 __packed; - uint32_t res_3 : 1 __packed; - uint32_t ftm1_flt0 : 1 __packed; - uint32_t res_5_7 : 3 __packed; - uint32_t ftm2_flt0 : 1 __packed; - uint32_t res_9_17 : 9 __packed; - uint32_t ftm1_ch0_src : 2 __packed; - uint32_t ftm2_ch0_src : 2 __packed; - uint32_t res_22_23 : 2 __packed; - uint32_t ftm0_clk_sel : 1 __packed; - uint32_t ftm1_clk_sel : 1 __packed; - uint32_t ftm2_clk_sel : 1 __packed; - uint32_t res_27 : 1 __packed; - uint32_t ftm0_trg0_src : 1 __packed; - uint32_t ftm0_trg1_src : 1 __packed; - uint32_t res_30_31 : 2 __packed; + u32_t ftm0_flt0 : 1 __packed; + u32_t ftm0_flt1 : 1 __packed; + u32_t ftm0_flt2 : 1 __packed; + u32_t res_3 : 1 __packed; + u32_t ftm1_flt0 : 1 __packed; + u32_t res_5_7 : 3 __packed; + u32_t ftm2_flt0 : 1 __packed; + u32_t res_9_17 : 9 __packed; + u32_t ftm1_ch0_src : 2 __packed; + u32_t ftm2_ch0_src : 2 __packed; + u32_t res_22_23 : 2 __packed; + u32_t ftm0_clk_sel : 1 __packed; + u32_t ftm1_clk_sel : 1 __packed; + u32_t ftm2_clk_sel : 1 __packed; + u32_t res_27 : 1 __packed; + u32_t ftm0_trg0_src : 1 __packed; + u32_t ftm0_trg1_src : 1 __packed; + u32_t res_30_31 : 2 __packed; } field; } SIM_SOPT4_t; /* 0x100C */ typedef union { - uint32_t value; + u32_t value; struct { - uint32_t uart0_tx_src : 2 __packed; - uint32_t uart0_rx_src : 2 __packed; - uint32_t uart1_tx_src : 2 __packed; - uint32_t uart1_rx_src : 2 __packed; - uint32_t res_8_31 : 24 __packed; + u32_t uart0_tx_src : 2 __packed; + u32_t uart0_rx_src : 2 __packed; + u32_t uart1_tx_src : 2 __packed; + u32_t uart1_rx_src : 2 __packed; + u32_t res_8_31 : 24 __packed; } field; } SIM_SOPT5_t; /* 0x1010 */ typedef union { - uint32_t value; + u32_t value; struct { - uint32_t uart0_tx_src : 2 __packed; - uint32_t uart0_rx_src : 2 __packed; - uint32_t uart1_tx_src : 2 __packed; - uint32_t uart1_rx_src : 2 __packed; - uint32_t res_8_9 : 2 __packed; - uint32_t uart4_clk_en : 1 __packed; - uint32_t uart5_clk_en : 1 __packed; - uint32_t res_12_31: 20 __packed; + u32_t uart0_tx_src : 2 __packed; + u32_t uart0_rx_src : 2 __packed; + u32_t uart1_tx_src : 2 __packed; + u32_t uart1_rx_src : 2 __packed; + u32_t res_8_9 : 2 __packed; + u32_t uart4_clk_en : 1 __packed; + u32_t uart5_clk_en : 1 __packed; + u32_t res_12_31: 20 __packed; } field; } SIM_SCGC1_t; /* 0x1028*/ typedef union { - uint32_t value; + u32_t value; struct { - uint32_t res_0 : 1 __packed; - uint32_t ewm_clk_en_0 : 1 __packed; - uint32_t cmt_clk_en_0 : 1 __packed; - uint32_t res_3_5 : 3 __packed; - uint32_t i2c0_clk_en : 1 __packed; - uint32_t i2c1_clk_en : 1 __packed; - uint32_t res_8_9 : 2 __packed; - uint32_t uart0_clk_en : 1 __packed; - uint32_t uart1_clk_en : 1 __packed; - uint32_t uart2_clk_en : 1 __packed; - uint32_t uart3_clk_en : 1 __packed; - uint32_t res_14_17 : 4 __packed; - uint32_t usb_clk_en : 1 __packed; - uint32_t cmp_clk_en : 1 __packed; - uint32_t vref_clk_en : 1 __packed; - uint32_t res_21_31 : 11 __packed; + u32_t res_0 : 1 __packed; + u32_t ewm_clk_en_0 : 1 __packed; + u32_t cmt_clk_en_0 : 1 __packed; + u32_t res_3_5 : 3 __packed; + u32_t i2c0_clk_en : 1 __packed; + u32_t i2c1_clk_en : 1 __packed; + u32_t res_8_9 : 2 __packed; + u32_t uart0_clk_en : 1 __packed; + u32_t uart1_clk_en : 1 __packed; + u32_t uart2_clk_en : 1 __packed; + u32_t uart3_clk_en : 1 __packed; + u32_t res_14_17 : 4 __packed; + u32_t usb_clk_en : 1 __packed; + u32_t cmp_clk_en : 1 __packed; + u32_t vref_clk_en : 1 __packed; + u32_t res_21_31 : 11 __packed; } field; } SIM_SCGC4_t; /* 0x1034 */ @@ -148,29 +148,29 @@ typedef union { #define SIM_SCGC5_PORTE_CLK_EN (1 << 13) typedef union { - uint32_t value; /* reset 0 */ + u32_t value; /* reset 0 */ struct { - uint32_t lptimer : 1 __packed; - uint32_t res_1_4 : 4 __packed; - uint32_t tsi : 1 __packed; - uint32_t res_6_8 : 3 __packed; - uint32_t port_a_clk_en : 1 __packed; - uint32_t port_b_clk_en : 1 __packed; - uint32_t port_c_clk_en : 1 __packed; - uint32_t port_d_clk_en : 1 __packed; - uint32_t port_e_clk_en : 1 __packed; - uint32_t res_14_31 : 18 __packed; + u32_t lptimer : 1 __packed; + u32_t res_1_4 : 4 __packed; + u32_t tsi : 1 __packed; + u32_t res_6_8 : 3 __packed; + u32_t port_a_clk_en : 1 __packed; + u32_t port_b_clk_en : 1 __packed; + u32_t port_c_clk_en : 1 __packed; + u32_t port_d_clk_en : 1 __packed; + u32_t port_e_clk_en : 1 __packed; + u32_t res_14_31 : 18 __packed; } field; } SIM_SCGC5_t; /* 0x1038 */ typedef union { - uint32_t value; /* reset 0x0001 0000 */ + u32_t value; /* reset 0x0001 0000 */ struct { - uint32_t res_0_15 : 16 __packed; - uint32_t outdiv4 : 4 __packed; - uint32_t outdiv3 : 4 __packed; - uint32_t outdiv2 : 4 __packed; - uint32_t outdiv1 : 4 __packed; + u32_t res_0_15 : 16 __packed; + u32_t outdiv4 : 4 __packed; + u32_t outdiv3 : 4 __packed; + u32_t outdiv2 : 4 __packed; + u32_t outdiv1 : 4 __packed; } field; } SIM_CLKDIV1_t; /* 0x1044 */ @@ -179,24 +179,24 @@ typedef union { struct K20_SIM { SIM_SOPT1_t sopt1; /* 0x0000 */ SIM_SOPT1CFG_t sopt1_cfg; /* 0x0004 */ - uint8_t res0008_1003[0x1003 - 0x8]; /* 0x0008-0x1003 Reserved */ + u8_t res0008_1003[0x1003 - 0x8]; /* 0x0008-0x1003 Reserved */ SIM_SOPT2_t sopt2; /* 0x1004 */ - uint32_t res1008; /* 0x1008 Reserved */ + u32_t res1008; /* 0x1008 Reserved */ SIM_SOPT4_t sopt4; /* 0x100C */ SIM_SOPT5_t sopt5; /* 0x1010 */ - uint32_t res1014; /* 0x1014 Reserved */ - uint32_t sopt7; /* 0x1018 */ - uint8_t res101c_1027[0x1027 - 0x101c]; /* Reserved */ + u32_t res1014; /* 0x1014 Reserved */ + u32_t sopt7; /* 0x1018 */ + u8_t res101c_1027[0x1027 - 0x101c]; /* Reserved */ SIM_SCGC1_t scgc1; /* 0x1028 */ - uint32_t scgc2; /* 0x102C */ - uint32_t scgc3; /* 0x1030 */ + u32_t scgc2; /* 0x102C */ + u32_t scgc3; /* 0x1030 */ SIM_SCGC4_t scgc4; /* 0x1034 */ SIM_SCGC5_t scgc5; /* 0x1038 */ - uint32_t scgc6; /* 0x103C */ - uint32_t scgc7; /* 0x1040 */ + u32_t scgc6; /* 0x103C */ + u32_t scgc7; /* 0x1040 */ SIM_CLKDIV1_t clkdiv1; /* 0x1044 */ - uint32_t clkdiv2; /* 0x1048 */ - uint8_t res104c_1063[0x1063 - 0x104c]; /* Reserved */ + u32_t clkdiv2; /* 0x1048 */ + u8_t res104c_1063[0x1063 - 0x104c]; /* Reserved */ }; #ifdef __cplusplus diff --git a/include/drivers/mvic.h b/include/drivers/mvic.h index 41fded0633c..410b4b29d8a 100644 --- a/include/drivers/mvic.h +++ b/include/drivers/mvic.h @@ -54,7 +54,7 @@ #define __IRQ_CONTROLLER_VECTOR_MAPPING(irq) ((irq) + 32) void __irq_controller_irq_config(unsigned int vector, unsigned int irq, - uint32_t flags); + u32_t flags); int __irq_controller_isr_vector_get(void); diff --git a/include/drivers/pci/pci.h b/include/drivers/pci/pci.h index b49583c2616..0b9818104ae 100644 --- a/include/drivers/pci/pci.h +++ b/include/drivers/pci/pci.h @@ -30,20 +30,20 @@ extern "C" { /* PCI device information */ struct pci_dev_info { - uint32_t addr; /* I/O or memory region address */ - uint32_t size; /* memory region size */ + u32_t addr; /* I/O or memory region address */ + u32_t size; /* memory region size */ int irq; - uint32_t bus:8; - uint32_t dev:5; - uint32_t function:4; - uint32_t mem_type:1; /* memory type: BAR_SPACE_MEM/BAR_SPACE_IO */ - uint32_t class_type:8; - uint32_t bar:3; - uint32_t _reserved:3; + u32_t bus:8; + u32_t dev:5; + u32_t function:4; + u32_t mem_type:1; /* memory type: BAR_SPACE_MEM/BAR_SPACE_IO */ + u32_t class_type:8; + u32_t bar:3; + u32_t _reserved:3; - uint16_t vendor_id; - uint16_t device_id; + u16_t vendor_id; + u16_t device_id; }; #ifdef CONFIG_PCI_ENUMERATION diff --git a/include/drivers/pci/pci_mgr.h b/include/drivers/pci/pci_mgr.h index 24da618f9b8..9c64ffb9d2e 100644 --- a/include/drivers/pci/pci_mgr.h +++ b/include/drivers/pci/pci_mgr.h @@ -91,24 +91,24 @@ extern "C" { union pci_addr_reg { struct { #ifdef _BIG_ENDIAN - uint32_t enable : 1; /* access enabled */ - uint32_t reserved1 : 7; - uint32_t bus : 8; /* PCI bus number */ - uint32_t device : 5; /* PCI device number */ - uint32_t func : 3; /* device function number */ - uint32_t reg : 6; /* config space register number */ - uint32_t offset : 2; /* offset for access data */ + u32_t enable : 1; /* access enabled */ + u32_t reserved1 : 7; + u32_t bus : 8; /* PCI bus number */ + u32_t device : 5; /* PCI device number */ + u32_t func : 3; /* device function number */ + u32_t reg : 6; /* config space register number */ + u32_t offset : 2; /* offset for access data */ #else - uint32_t offset : 2; /* offset for access data */ - uint32_t reg : 6; /* config space register number */ - uint32_t func : 3; /* device function number */ - uint32_t device : 5; /* PCI device number */ - uint32_t bus : 8; /* PCI bus number */ - uint32_t reserved1 : 7; - uint32_t enable : 1; /* access enabled */ + u32_t offset : 2; /* offset for access data */ + u32_t reg : 6; /* config space register number */ + u32_t func : 3; /* device function number */ + u32_t device : 5; /* PCI device number */ + u32_t bus : 8; /* PCI bus number */ + u32_t reserved1 : 7; + u32_t enable : 1; /* access enabled */ #endif } field; - uint32_t value; + u32_t value; }; @@ -141,22 +141,22 @@ union pci_addr_reg { union pcie_addr_reg { struct { #ifdef _BIG_ENDIAN - uint32_t reserved1 : 4; - uint32_t bus : 8; /* PCI bus number */ - uint32_t device : 5; /* PCI device number */ - uint32_t func : 3; /* device function number */ - uint32_t reg : 10; /* config space register number */ - uint32_t reserved0 : 2; + u32_t reserved1 : 4; + u32_t bus : 8; /* PCI bus number */ + u32_t device : 5; /* PCI device number */ + u32_t func : 3; /* device function number */ + u32_t reg : 10; /* config space register number */ + u32_t reserved0 : 2; #else - uint32_t reserved0 : 2; - uint32_t reg : 10; /* config space register number */ - uint32_t func : 3; /* device function number */ - uint32_t device : 5; /* PCI device number */ - uint32_t bus : 8; /* PCI bus number */ - uint32_t reserved1 : 4; + u32_t reserved0 : 2; + u32_t reg : 10; /* config space register number */ + u32_t func : 3; /* device function number */ + u32_t device : 5; /* PCI device number */ + u32_t bus : 8; /* PCI bus number */ + u32_t reserved1 : 4; #endif } field; - uint32_t value; + u32_t value; }; /* @@ -259,104 +259,104 @@ union pci_dev { struct { /* offset 00: */ #ifdef _BIG_ENDIAN - uint32_t device_id + u32_t device_id : 16; /* device identification */ - uint32_t vendor_id + u32_t vendor_id : 16; /* vendor identification */ #else - uint32_t vendor_id + u32_t vendor_id : 16; /* vendor identification */ - uint32_t device_id + u32_t device_id : 16; /* device identification */ #endif /* offset 04: */ #ifdef _BIG_ENDIAN - uint32_t status : 16; /* device status */ - uint32_t command : 16; /* device command register */ + u32_t status : 16; /* device status */ + u32_t command : 16; /* device command register */ #else - uint32_t command : 16; /* device command register */ - uint32_t status : 16; /* device status */ + u32_t command : 16; /* device command register */ + u32_t status : 16; /* device status */ #endif /* offset 08: */ #ifdef _BIG_ENDIAN - uint32_t class : 8; - uint32_t subclass : 8; - uint32_t reg_if : 8; - uint32_t revision : 8; + u32_t class : 8; + u32_t subclass : 8; + u32_t reg_if : 8; + u32_t revision : 8; #else - uint32_t revision : 8; - uint32_t reg_if : 8; - uint32_t subclass : 8; - uint32_t class : 8; + u32_t revision : 8; + u32_t reg_if : 8; + u32_t subclass : 8; + u32_t class : 8; #endif /* offset 0C: */ #ifdef _BIG_ENDIAN - uint32_t bist : 8; - uint32_t hdr_type : 8; - uint32_t latency_timer : 8; - uint32_t cache_line : 8; + u32_t bist : 8; + u32_t hdr_type : 8; + u32_t latency_timer : 8; + u32_t cache_line : 8; #else - uint32_t cache_line : 8; - uint32_t latency_timer : 8; - uint32_t hdr_type : 8; - uint32_t bist : 8; + u32_t cache_line : 8; + u32_t latency_timer : 8; + u32_t hdr_type : 8; + u32_t bist : 8; #endif - uint32_t bar0; /* offset 10: base address register 0 */ - uint32_t bar1; /* offset 14: base address register 0 */ - uint32_t bar2; /* offset 18: base address register 0 */ - uint32_t bar3; /* offset 1C: base address register 0 */ - uint32_t bar4; /* offset 20: base address register 0 */ - uint32_t bar5; /* offset 24: base address register 0 */ - uint32_t cardbus; /* offset 28: base address register 0 */ + u32_t bar0; /* offset 10: base address register 0 */ + u32_t bar1; /* offset 14: base address register 0 */ + u32_t bar2; /* offset 18: base address register 0 */ + u32_t bar3; /* offset 1C: base address register 0 */ + u32_t bar4; /* offset 20: base address register 0 */ + u32_t bar5; /* offset 24: base address register 0 */ + u32_t cardbus; /* offset 28: base address register 0 */ /* offset 2C: */ #ifdef _BIG_ENDIAN - uint32_t subsys_id + u32_t subsys_id : 16; /* subsystem identifier */ - uint32_t subvendor_id + u32_t subvendor_id : 16; /* subsystem vendor identifier */ #else - uint32_t subvendor_id + u32_t subvendor_id : 16; /* subsystem vendor identifier */ - uint32_t subsys_id + u32_t subsys_id : 16; /* subsystem identifier */ #endif /* offset 30: */ - uint32_t rom_address; + u32_t rom_address; /* offset 34: */ #ifdef _BIG_ENDIAN - uint32_t reserved1 : 24; - uint32_t capability_ptr : 8; + u32_t reserved1 : 24; + u32_t capability_ptr : 8; #else - uint32_t capability_ptr : 8; - uint32_t reserved1 : 24; + u32_t capability_ptr : 8; + u32_t reserved1 : 24; #endif - uint32_t reserved2; /* offset 38: */ + u32_t reserved2; /* offset 38: */ /* offset 3C: */ #ifdef _BIG_ENDIAN - uint32_t max_latency : 8; - uint32_t min_grant : 8; - uint32_t interrupt_pin + u32_t max_latency : 8; + u32_t min_grant : 8; + u32_t interrupt_pin : 8; /* interrupt pin assignment */ - uint32_t interrupt_line + u32_t interrupt_line : 8; /* interrupt line assignment */ #else - uint32_t interrupt_line + u32_t interrupt_line : 8; /* interrupt line assignment */ - uint32_t interrupt_pin + u32_t interrupt_pin : 8; /* interrupt pin assignment */ - uint32_t min_grant : 8; - uint32_t max_latency : 8; + u32_t min_grant : 8; + u32_t max_latency : 8; #endif } field; @@ -365,140 +365,140 @@ union pci_dev { struct { /* offset 00: */ #ifdef _BIG_ENDIAN - uint32_t device_id + u32_t device_id : 16; /* device identification */ - uint32_t vendor_id + u32_t vendor_id : 16; /* vendor identification */ #else - uint32_t vendor_id + u32_t vendor_id : 16; /* vendor identification */ - uint32_t device_id + u32_t device_id : 16; /* device identification */ #endif /* offset 04: */ #ifdef _BIG_ENDIAN - uint32_t status : 16; /* device status */ - uint32_t command + u32_t status : 16; /* device status */ + u32_t command : 16; /* device command register */ #else - uint32_t command + u32_t command : 16; /* device command register */ - uint32_t status : 16; /* device status */ + u32_t status : 16; /* device status */ #endif /* offset 08: */ #ifdef _BIG_ENDIAN - uint32_t class : 8; - uint32_t subclass : 8; - uint32_t reg_if : 8; - uint32_t revision : 8; + u32_t class : 8; + u32_t subclass : 8; + u32_t reg_if : 8; + u32_t revision : 8; #else - uint32_t revision : 8; - uint32_t reg_if : 8; - uint32_t subclass : 8; - uint32_t class : 8; + u32_t revision : 8; + u32_t reg_if : 8; + u32_t subclass : 8; + u32_t class : 8; #endif /* offset 0C: */ #ifdef _BIG_ENDIAN - uint32_t bist : 8; - uint32_t hdr_type : 8; - uint32_t latency_timer : 8; - uint32_t cache_line : 8; + u32_t bist : 8; + u32_t hdr_type : 8; + u32_t latency_timer : 8; + u32_t cache_line : 8; #else - uint32_t cache_line : 8; - uint32_t latency_timer : 8; - uint32_t hdr_type : 8; - uint32_t bist : 8; + u32_t cache_line : 8; + u32_t latency_timer : 8; + u32_t hdr_type : 8; + u32_t bist : 8; #endif - uint32_t bar0; /* offset 10: base address register 0 */ - uint32_t bar1; /* offset 14: base address register 0 */ + u32_t bar0; /* offset 10: base address register 0 */ + u32_t bar1; /* offset 14: base address register 0 */ /* offset 18: */ #ifdef _BIG_ENDIAN - uint32_t secondary_latency : 8; - uint32_t subord_bus : 8; - uint32_t secondary_bus : 8; - uint32_t primary_bus : 8; + u32_t secondary_latency : 8; + u32_t subord_bus : 8; + u32_t secondary_bus : 8; + u32_t primary_bus : 8; #else - uint32_t primary_bus : 8; - uint32_t secondary_bus : 8; - uint32_t subord_bus : 8; - uint32_t secondary_latency : 8; + u32_t primary_bus : 8; + u32_t secondary_bus : 8; + u32_t subord_bus : 8; + u32_t secondary_latency : 8; #endif /* offset 1C: */ #ifdef _BIG_ENDIAN - uint32_t secondary_status : 16; - uint32_t io_limit : 8; - uint32_t io_base : 8; + u32_t secondary_status : 16; + u32_t io_limit : 8; + u32_t io_base : 8; #else - uint32_t io_base : 8; - uint32_t io_limit : 8; - uint32_t secondary_status : 16; + u32_t io_base : 8; + u32_t io_limit : 8; + u32_t secondary_status : 16; #endif /* offset 20: */ #ifdef _BIG_ENDIAN - uint32_t mem_limit : 16; - uint32_t mem_base : 16; + u32_t mem_limit : 16; + u32_t mem_base : 16; #else - uint32_t mem_base : 16; - uint32_t mem_limit : 16; + u32_t mem_base : 16; + u32_t mem_limit : 16; #endif /* offset 24: */ #ifdef _BIG_ENDIAN - uint32_t pre_mem_limit : 16; - uint32_t pre_mem_base : 16; + u32_t pre_mem_limit : 16; + u32_t pre_mem_base : 16; #else - uint32_t pre_mem_base : 16; - uint32_t pre_mem_limit : 16; + u32_t pre_mem_base : 16; + u32_t pre_mem_limit : 16; #endif /* offset 28: */ - uint32_t pre_mem_base_upper; + u32_t pre_mem_base_upper; /* offset 2C: */ - uint32_t pre_mem_limit_upper; + u32_t pre_mem_limit_upper; /* offset 30: */ #ifdef _BIG_ENDIAN - uint32_t io_limit_upper : 16; - uint32_t io_base_upper : 16; + u32_t io_limit_upper : 16; + u32_t io_base_upper : 16; #else - uint32_t io_base_upper : 16; - uint32_t io_limit_upper : 16; + u32_t io_base_upper : 16; + u32_t io_limit_upper : 16; #endif /* offset 34: */ #ifdef _BIG_ENDIAN - uint32_t reserved : 24; - uint32_t capability_ptr : 8; + u32_t reserved : 24; + u32_t capability_ptr : 8; #else - uint32_t capability_ptr : 8; - uint32_t reserved : 24; + u32_t capability_ptr : 8; + u32_t reserved : 24; #endif /* offset 38: */ - uint32_t rom_address; + u32_t rom_address; /* offset 3C: */ #ifdef _BIG_ENDIAN - uint32_t bridge_control : 16; - uint32_t interrupt_pin + u32_t bridge_control : 16; + u32_t interrupt_pin : 8; /* interrupt pin assignment */ - uint32_t interrupt_line + u32_t interrupt_line : 8; /* interrupt line assignment */ #else - uint32_t interrupt_line + u32_t interrupt_line : 8; /* interrupt line assignment */ - uint32_t interrupt_pin + u32_t interrupt_pin : 8; /* interrupt pin assignment */ - uint32_t bridge_control : 16; + u32_t bridge_control : 16; #endif } bridge_field; @@ -506,27 +506,27 @@ union pci_dev { /* direct access to each word in the PCI header */ struct { - uint32_t word0; /* word 0: offset 00 */ - uint32_t word1; /* word 1: offset 04 */ - uint32_t word2; /* word 2: offset 08 */ - uint32_t word3; /* word 3: offset 0C */ - uint32_t word4; /* word 4: offset 10 */ - uint32_t word5; /* word 5: offset 14 */ - uint32_t word6; /* word 6: offset 18 */ - uint32_t word7; /* word 7: offset 1C */ - uint32_t word8; /* word 8: offset 20 */ - uint32_t word9; /* word 9: offset 24 */ - uint32_t word10; /* word 10: offset 28 */ - uint32_t word11; /* word 11: offset 2C */ - uint32_t word12; /* word 12: offset 30 */ - uint32_t word13; /* word 13: offset 34 */ - uint32_t word14; /* word 14: offset 38 */ - uint32_t word15; /* word 15: offset 3C */ + u32_t word0; /* word 0: offset 00 */ + u32_t word1; /* word 1: offset 04 */ + u32_t word2; /* word 2: offset 08 */ + u32_t word3; /* word 3: offset 0C */ + u32_t word4; /* word 4: offset 10 */ + u32_t word5; /* word 5: offset 14 */ + u32_t word6; /* word 6: offset 18 */ + u32_t word7; /* word 7: offset 1C */ + u32_t word8; /* word 8: offset 20 */ + u32_t word9; /* word 9: offset 24 */ + u32_t word10; /* word 10: offset 28 */ + u32_t word11; /* word 11: offset 2C */ + u32_t word12; /* word 12: offset 30 */ + u32_t word13; /* word 13: offset 34 */ + u32_t word14; /* word 14: offset 38 */ + u32_t word15; /* word 15: offset 3C */ } word; struct { /* array of words for the header */ - uint32_t word[PCI_HEADER_WORDS]; + u32_t word[PCI_HEADER_WORDS]; } words; }; @@ -544,26 +544,26 @@ union pci_dev { union pci_cap_hdr { struct { /* offset 00: */ - uint32_t id : 8; /* capability ID */ - uint32_t next_ptr + u32_t id : 8; /* capability ID */ + u32_t next_ptr : 8; /* pointer to next capability */ - uint32_t feature + u32_t feature : 16; /* capability specific field */ } field; - uint32_t word; /* array of words for the header */ + u32_t word; /* array of words for the header */ } pci_cap_hdr_t; union pcie_cap_hdr { struct { /* offset 00: */ - uint32_t id : 16; /* capability ID */ - uint32_t version : 4; /* version */ - uint32_t next_ptr + u32_t id : 16; /* capability ID */ + u32_t version : 4; /* version */ + u32_t next_ptr : 12; /* pointer to next capability */ } field; - uint32_t word; /* array of words for the header */ + u32_t word; /* array of words for the header */ }; /* @@ -599,23 +599,23 @@ struct _pci_msi_hdr { union { struct { /* offset 00: */ - uint32_t id : 8; /* capability ID */ - uint32_t next_ptr : 8; /* pointer to next capability */ - uint32_t enabled : 1; /* MSI enabled */ - uint32_t msg_req : 3; /* requested message count */ - uint32_t msg_grant : 3; /* granted message count */ - uint32_t is_64_bit : 1; /* 64-bit capable */ - uint32_t reserved : 8; /* */ + u32_t id : 8; /* capability ID */ + u32_t next_ptr : 8; /* pointer to next capability */ + u32_t enabled : 1; /* MSI enabled */ + u32_t msg_req : 3; /* requested message count */ + u32_t msg_grant : 3; /* granted message count */ + u32_t is_64_bit : 1; /* 64-bit capable */ + u32_t reserved : 8; /* */ } msi_cap; struct { /* offset 00: */ - uint32_t id : 8; /* capability ID */ - uint32_t next_ptr : 8; /* pointer to next capability */ - uint32_t table_size : 11; /* MSI-x table size */ - uint32_t reserved : 3; /* */ - uint32_t func_mask : 1; /* 1 for vectors masked */ - uint32_t enabled : 1; /* MSI-x enabled */ + u32_t id : 8; /* capability ID */ + u32_t next_ptr : 8; /* pointer to next capability */ + u32_t table_size : 11; /* MSI-x table size */ + u32_t reserved : 3; /* */ + u32_t func_mask : 1; /* 1 for vectors masked */ + u32_t enabled : 1; /* MSI-x enabled */ } msix_cap; } cap; @@ -623,135 +623,135 @@ struct _pci_msi_hdr { /* 32-bit MSI header */ struct { /* offset 04: */ - uint32_t addr; /* message address register */ + u32_t addr; /* message address register */ /* offset 08 */ - uint32_t data : 16; /* message data register */ - uint32_t spare : 16; /* */ + u32_t data : 16; /* message data register */ + u32_t spare : 16; /* */ } regs32; /* 64-bit MSI header */ struct { /* offset 04: */ - uint32_t addr_low; /* message address register + u32_t addr_low; /* message address register * (lower) */ /* offset 08: */ - uint32_t addr_high; /* message address register + u32_t addr_high; /* message address register * (upper) */ /* offset 0C: */ - uint32_t data : 16; /* message data register */ - uint32_t spare : 16; /* */ + u32_t data : 16; /* message data register */ + u32_t spare : 16; /* */ } regs64; } regs; }; union pci_msi_hdr { struct _pci_msi_hdr field; /* MSI header fields */ - uint32_t word[4]; /* array of words for the header */ + u32_t word[4]; /* array of words for the header */ }; /* * number of pci controllers; initialized to 0 until the controllers have been * created */ -extern uint32_t pci_controller_cnt; +extern u32_t pci_controller_cnt; struct pci_msix_table { - uint32_t msg_addr; - uint32_t msg_addr_high; - uint32_t msg_data; - uint32_t vec_ctrl; + u32_t msg_addr; + u32_t msg_addr_high; + u32_t msg_data; + u32_t vec_ctrl; }; struct pci_msix_entry { - uint32_t vector; /* guest to write a vector */ - uint16_t entry; /* driver to specify entry, guest OS writes */ + u32_t vector; /* guest to write a vector */ + u16_t entry; /* driver to specify entry, guest OS writes */ }; struct pci_msix_info { - uint32_t bus_no; - uint32_t dev_no; - uint32_t func_no; - uint32_t msix_vec; + u32_t bus_no; + u32_t dev_no; + u32_t func_no; + u32_t msix_vec; }; /* manager interface API */ -extern void pci_read(uint32_t controller, +extern void pci_read(u32_t controller, union pci_addr_reg addr, - uint32_t size, - uint32_t *data); -extern void pci_write(uint32_t controller, + u32_t size, + u32_t *data); +extern void pci_write(u32_t controller, union pci_addr_reg addr, - uint32_t size, - uint32_t data); + u32_t size, + u32_t data); -extern void pci_header_get(uint32_t controller, +extern void pci_header_get(u32_t controller, union pci_addr_reg pci_ctrl_addr, union pci_dev *pci_dev_header); /* General PCI configuration access routines */ -extern void pci_config_out_long(uint32_t bus, /* bus number */ - uint32_t dev, /* device number */ - uint32_t func, /* function number */ - uint32_t offset, /* offset into the configuration +extern void pci_config_out_long(u32_t bus, /* bus number */ + u32_t dev, /* device number */ + u32_t func, /* function number */ + u32_t offset, /* offset into the configuration * space */ - uint32_t data /* data written to the offset */ + u32_t data /* data written to the offset */ ); -extern void pci_config_out_word(uint32_t bus, /* bus number */ - uint32_t dev, /* device number */ - uint32_t func, /* function number */ - uint32_t offset, /* offset into the configuration +extern void pci_config_out_word(u32_t bus, /* bus number */ + u32_t dev, /* device number */ + u32_t func, /* function number */ + u32_t offset, /* offset into the configuration * space */ - uint16_t data /* data written to the offset */ + u16_t data /* data written to the offset */ ); -extern void pci_config_out_byte(uint32_t bus, /* bus number */ - uint32_t dev, /* device number */ - uint32_t func, /* function number */ - uint32_t offset, /* offset into the configuration +extern void pci_config_out_byte(u32_t bus, /* bus number */ + u32_t dev, /* device number */ + u32_t func, /* function number */ + u32_t offset, /* offset into the configuration * space */ - uint8_t data /* data written to the offset */ + u8_t data /* data written to the offset */ ); -extern void pci_config_in_long(uint32_t bus, /* bus number */ - uint32_t dev, /* device number */ - uint32_t func, /* function number */ - uint32_t offset, /* offset into the configuration +extern void pci_config_in_long(u32_t bus, /* bus number */ + u32_t dev, /* device number */ + u32_t func, /* function number */ + u32_t offset, /* offset into the configuration * space */ - uint32_t *data /* return value address */ + u32_t *data /* return value address */ ); -extern void pci_config_in_word(uint32_t bus, /* bus number */ - uint32_t dev, /* device number */ - uint32_t func, /* function number */ - uint32_t offset, /* offset into the configuration +extern void pci_config_in_word(u32_t bus, /* bus number */ + u32_t dev, /* device number */ + u32_t func, /* function number */ + u32_t offset, /* offset into the configuration * space */ - uint16_t *data /* return value address */ + u16_t *data /* return value address */ ); -extern void pci_config_in_byte(uint32_t bus, /* bus number */ - uint32_t dev, /* device number */ - uint32_t func, /* function number */ - uint32_t offset, /* offset into the configuration +extern void pci_config_in_byte(u32_t bus, /* bus number */ + u32_t dev, /* device number */ + u32_t func, /* function number */ + u32_t offset, /* offset into the configuration * space */ - uint8_t *data /* return value address */ + u8_t *data /* return value address */ ); extern int pci_config_ext_cap_ptr_find( - uint8_t ext_cap_find_id, /* Extended capabilities ID to search for */ - uint32_t bus, /* PCI bus number */ - uint32_t device, /* PCI device number */ - uint32_t function, /* PCI function number */ - uint8_t *p_offset /* returned config space offset */ + u8_t ext_cap_find_id, /* Extended capabilities ID to search for */ + u32_t bus, /* PCI bus number */ + u32_t device, /* PCI device number */ + u32_t function, /* PCI function number */ + u8_t *p_offset /* returned config space offset */ ); #endif /* _ASMLANGUAGE */ diff --git a/include/drivers/rand32.h b/include/drivers/rand32.h index d9b29b967b8..c214d63b750 100644 --- a/include/drivers/rand32.h +++ b/include/drivers/rand32.h @@ -26,7 +26,7 @@ extern "C" { #endif -extern uint32_t sys_rand32_get(void); +extern u32_t sys_rand32_get(void); #ifdef __cplusplus } diff --git a/include/drivers/sysapic.h b/include/drivers/sysapic.h index 6d7c5b32fe1..4e3869fce2b 100644 --- a/include/drivers/sysapic.h +++ b/include/drivers/sysapic.h @@ -23,7 +23,7 @@ /* irq_controller.h interface */ void __irq_controller_irq_config(unsigned int vector, unsigned int irq, - uint32_t flags); + u32_t flags); int __irq_controller_isr_vector_get(void); diff --git a/include/drivers/system_timer.h b/include/drivers/system_timer.h index 64ffb541949..dbaf3d4cd7c 100644 --- a/include/drivers/system_timer.h +++ b/include/drivers/system_timer.h @@ -36,14 +36,14 @@ extern void sys_clock_disable(void); #endif #ifdef CONFIG_TICKLESS_IDLE -extern void _timer_idle_enter(int32_t ticks); +extern void _timer_idle_enter(s32_t ticks); extern void _timer_idle_exit(void); #endif /* CONFIG_TICKLESS_IDLE */ -extern void _nano_sys_clock_tick_announce(int32_t ticks); +extern void _nano_sys_clock_tick_announce(s32_t ticks); extern int sys_clock_device_ctrl(struct device *device, - uint32_t ctrl_command, void *context); + u32_t ctrl_command, void *context); /* * Currently regarding timers, only loapic timer and arcv2_timer0 implements @@ -54,7 +54,7 @@ extern int sys_clock_device_ctrl(struct device *device, #define sys_clock_device_ctrl device_pm_control_nop #endif -extern int32_t _sys_idle_elapsed_ticks; +extern s32_t _sys_idle_elapsed_ticks; #define _sys_clock_tick_announce() \ _nano_sys_clock_tick_announce(_sys_idle_elapsed_ticks) diff --git a/include/drivers/usb/usb_dc.h b/include/drivers/usb/usb_dc.h index d9d13b657b5..0ae236e0894 100644 --- a/include/drivers/usb/usb_dc.h +++ b/include/drivers/usb/usb_dc.h @@ -71,15 +71,15 @@ struct usb_dc_ep_cfg_data { * IN EP = 0x80 | \ * OUT EP = 0x00 | \ */ - uint8_t ep_addr; - uint16_t ep_mps; /** Endpoint max packet size */ + u8_t ep_addr; + u16_t ep_mps; /** Endpoint max packet size */ enum usb_dc_ep_type ep_type; /** Endpoint type */ }; /** * Callback function signature for the USB Endpoint status */ -typedef void (*usb_dc_ep_callback)(uint8_t ep, +typedef void (*usb_dc_ep_callback)(u8_t ep, enum usb_dc_ep_cb_status_code cb_status); /** @@ -125,7 +125,7 @@ int usb_dc_reset(void); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_set_address(const uint8_t addr); +int usb_dc_set_address(const u8_t addr); /** * @brief set USB device controller status callback @@ -160,7 +160,7 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data * const cfg); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_set_stall(const uint8_t ep); +int usb_dc_ep_set_stall(const u8_t ep); /** * @brief clear stall condition for the selected endpoint @@ -170,7 +170,7 @@ int usb_dc_ep_set_stall(const uint8_t ep); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_clear_stall(const uint8_t ep); +int usb_dc_ep_clear_stall(const u8_t ep); /** * @brief check if selected endpoint is stalled @@ -181,7 +181,7 @@ int usb_dc_ep_clear_stall(const uint8_t ep); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_is_stalled(const uint8_t ep, uint8_t *const stalled); +int usb_dc_ep_is_stalled(const u8_t ep, u8_t *const stalled); /** * @brief halt the selected endpoint @@ -191,7 +191,7 @@ int usb_dc_ep_is_stalled(const uint8_t ep, uint8_t *const stalled); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_halt(const uint8_t ep); +int usb_dc_ep_halt(const u8_t ep); /** * @brief enable the selected endpoint @@ -205,7 +205,7 @@ int usb_dc_ep_halt(const uint8_t ep); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_enable(const uint8_t ep); +int usb_dc_ep_enable(const u8_t ep); /** * @brief disable the selected endpoint @@ -219,7 +219,7 @@ int usb_dc_ep_enable(const uint8_t ep); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_disable(const uint8_t ep); +int usb_dc_ep_disable(const u8_t ep); /** * @brief flush the selected endpoint @@ -229,7 +229,7 @@ int usb_dc_ep_disable(const uint8_t ep); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_flush(const uint8_t ep); +int usb_dc_ep_flush(const u8_t ep); /** * @brief write data to the specified endpoint @@ -248,8 +248,8 @@ int usb_dc_ep_flush(const uint8_t ep); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data, - const uint32_t data_len, uint32_t * const ret_bytes); +int usb_dc_ep_write(const u8_t ep, const u8_t *const data, + const u32_t data_len, u32_t * const ret_bytes); /** * @brief read data from the specified endpoint @@ -270,8 +270,8 @@ int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data, * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_read(const uint8_t ep, uint8_t *const data, - const uint32_t max_data_len, uint32_t *const read_bytes); +int usb_dc_ep_read(const u8_t ep, u8_t *const data, + const u32_t max_data_len, u32_t *const read_bytes); /** * @brief set callback function for the specified endpoint @@ -286,7 +286,7 @@ int usb_dc_ep_read(const uint8_t ep, uint8_t *const data, * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_set_callback(const uint8_t ep, const usb_dc_ep_callback cb); +int usb_dc_ep_set_callback(const u8_t ep, const usb_dc_ep_callback cb); /** * @brief read data from the specified endpoint @@ -306,8 +306,8 @@ int usb_dc_ep_set_callback(const uint8_t ep, const usb_dc_ep_callback cb); * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len, - uint32_t *read_bytes); +int usb_dc_ep_read_wait(u8_t ep, u8_t *data, u32_t max_data_len, + u32_t *read_bytes); /** @@ -323,6 +323,6 @@ int usb_dc_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len, * * @return 0 on success, negative errno code on fail. */ -int usb_dc_ep_read_continue(uint8_t ep); +int usb_dc_ep_read_continue(u8_t ep); #endif /* __USB_DC_H__ */ diff --git a/include/eth.h b/include/eth.h index 597e6c516c7..08626a4ce46 100644 --- a/include/eth.h +++ b/include/eth.h @@ -25,9 +25,9 @@ extern "C" { * This structure holds all API function pointers. */ struct eth_driver_api { - int (*send)(struct device *dev, uint8_t *buffer, uint16_t len); + int (*send)(struct device *dev, u8_t *buffer, u16_t len); void (*register_callback)(struct device *dev, - void (*cb)(uint8_t *buffer, uint16_t len)); + void (*cb)(u8_t *buffer, u16_t len)); }; /** @@ -41,7 +41,7 @@ struct eth_driver_api { * * @return Error code */ -static inline int eth_send(struct device *dev, uint8_t *buffer, uint16_t len) +static inline int eth_send(struct device *dev, u8_t *buffer, u16_t len) { const struct eth_driver_api *api = dev->driver_api; @@ -59,7 +59,7 @@ static inline int eth_send(struct device *dev, uint8_t *buffer, uint16_t len) * @return Error code */ static inline void eth_register_callback(struct device *dev, - void (*cb)(uint8_t *buffer, uint16_t len)) + void (*cb)(u8_t *buffer, u16_t len)) { const struct eth_driver_api *api = dev->driver_api; diff --git a/include/gpio.h b/include/gpio.h index 098740a5708..eea38090e1e 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -198,7 +198,7 @@ struct gpio_callback; * @param "struct device *port" Device struct for the GPIO device. * @param "struct gpio_callback *cb" Original struct gpio_callback * owning this handler - * @param "uint32_t pins" Mask of pins that triggers the callback handler + * @param "u32_t pins" Mask of pins that triggers the callback handler * * Note: cb pointer can be used to retrieve private data through * CONTAINER_OF() if original struct gpio_callback is stored in @@ -206,7 +206,7 @@ struct gpio_callback; */ typedef void (*gpio_callback_handler_t)(struct device *port, struct gpio_callback *cb, - uint32_t pins); + u32_t pins); /** * @brief GPIO callback structure @@ -233,7 +233,7 @@ struct gpio_callback { * called or not. The selected pins must be configured to trigger * an interrupt. */ - uint32_t pin_mask; + u32_t pin_mask; }; /** @@ -244,21 +244,21 @@ struct gpio_callback { * (Internal use only.) */ typedef int (*gpio_config_t)(struct device *port, int access_op, - uint32_t pin, int flags); + u32_t pin, int flags); typedef int (*gpio_write_t)(struct device *port, int access_op, - uint32_t pin, uint32_t value); + u32_t pin, u32_t value); typedef int (*gpio_read_t)(struct device *port, int access_op, - uint32_t pin, uint32_t *value); + u32_t pin, u32_t *value); typedef int (*gpio_manage_callback_t)(struct device *port, struct gpio_callback *callback, bool set); typedef int (*gpio_enable_callback_t)(struct device *port, int access_op, - uint32_t pin); + u32_t pin); typedef int (*gpio_disable_callback_t)(struct device *port, int access_op, - uint32_t pin); -typedef uint32_t (*gpio_api_get_pending_int)(struct device *dev); + u32_t pin); +typedef u32_t (*gpio_api_get_pending_int)(struct device *dev); struct gpio_driver_api { gpio_config_t config; @@ -280,7 +280,7 @@ struct gpio_driver_api { * @param flags Flags for pin configuration. IN/OUT, interrupt ... * @return 0 if successful, negative errno code on failure. */ -static inline int gpio_pin_configure(struct device *port, uint32_t pin, +static inline int gpio_pin_configure(struct device *port, u32_t pin, int flags) { const struct gpio_driver_api *api = port->driver_api; @@ -295,8 +295,8 @@ static inline int gpio_pin_configure(struct device *port, uint32_t pin, * @param value Value set on the pin. * @return 0 if successful, negative errno code on failure. */ -static inline int gpio_pin_write(struct device *port, uint32_t pin, - uint32_t value) +static inline int gpio_pin_write(struct device *port, u32_t pin, + u32_t value) { const struct gpio_driver_api *api = port->driver_api; @@ -313,8 +313,8 @@ static inline int gpio_pin_write(struct device *port, uint32_t pin, * @param value Integer pointer to receive the data values from the pin. * @return 0 if successful, negative errno code on failure. */ -static inline int gpio_pin_read(struct device *port, uint32_t pin, - uint32_t *value) +static inline int gpio_pin_read(struct device *port, u32_t pin, + u32_t *value) { const struct gpio_driver_api *api = port->driver_api; @@ -329,7 +329,7 @@ static inline int gpio_pin_read(struct device *port, uint32_t pin, */ static inline void gpio_init_callback(struct gpio_callback *callback, gpio_callback_handler_t handler, - uint32_t pin_mask) + u32_t pin_mask) { __ASSERT(callback, "Callback pointer should not be NULL"); __ASSERT(handler, "Callback handler pointer should not be NULL"); @@ -385,7 +385,7 @@ static inline int gpio_remove_callback(struct device *port, * the pin to trigger an interruption. So as a semantic detail, if no * callback is registered, of course none will be called. */ -static inline int gpio_pin_enable_callback(struct device *port, uint32_t pin) +static inline int gpio_pin_enable_callback(struct device *port, u32_t pin) { const struct gpio_driver_api *api = port->driver_api; @@ -398,7 +398,7 @@ static inline int gpio_pin_enable_callback(struct device *port, uint32_t pin) * @param pin Pin number where the callback function is disabled. * @return 0 if successful, negative errno code on failure. */ -static inline int gpio_pin_disable_callback(struct device *port, uint32_t pin) +static inline int gpio_pin_disable_callback(struct device *port, u32_t pin) { const struct gpio_driver_api *api = port->driver_api; @@ -433,7 +433,7 @@ static inline int gpio_port_configure(struct device *port, int flags) * @param value Value to set on the port. * @return 0 if successful, negative errno code on failure. */ -static inline int gpio_port_write(struct device *port, uint32_t value) +static inline int gpio_port_write(struct device *port, u32_t value) { const struct gpio_driver_api *api = port->driver_api; @@ -453,7 +453,7 @@ static inline int gpio_port_write(struct device *port, uint32_t value) * @param value Integer pointer to receive the data value from the port. * @return 0 if successful, negative errno code on failure. */ -static inline int gpio_port_read(struct device *port, uint32_t *value) +static inline int gpio_port_read(struct device *port, u32_t *value) { const struct gpio_driver_api *api = port->driver_api; @@ -512,7 +512,7 @@ static inline int gpio_get_pending_int(struct device *dev) struct gpio_pin_config { char *gpio_controller; - uint32_t gpio_pin; + u32_t gpio_pin; }; #define GPIO_DECLARE_PIN_CONFIG_IDX(_idx) \ diff --git a/include/i2c.h b/include/i2c.h index 3acda7a8128..71ab560beb8 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -86,23 +86,23 @@ extern "C" { */ struct i2c_msg { /** Data buffer in bytes */ - uint8_t *buf; + u8_t *buf; /** Length of buffer in bytes */ - uint32_t len; + u32_t len; /** Flags for this message */ - uint8_t flags; + u8_t flags; }; union dev_config { - uint32_t raw; + u32_t raw; struct __bits { - uint32_t use_10_bit_addr : 1; - uint32_t speed : 3; - uint32_t is_master_device : 1; - uint32_t is_slave_read : 1; - uint32_t reserved : 26; + u32_t use_10_bit_addr : 1; + u32_t speed : 3; + u32_t is_master_device : 1; + u32_t is_slave_read : 1; + u32_t reserved : 26; } bits; }; @@ -113,11 +113,11 @@ union dev_config { * public documentation. */ typedef int (*i2c_api_configure_t)(struct device *dev, - uint32_t dev_config); + u32_t dev_config); typedef int (*i2c_api_full_io_t)(struct device *dev, struct i2c_msg *msgs, - uint8_t num_msgs, - uint16_t addr); + u8_t num_msgs, + u16_t addr); struct i2c_driver_api { i2c_api_configure_t configure; @@ -137,7 +137,7 @@ struct i2c_driver_api { * @retval 0 If successful. * @retval -EIO General input / output error, failed to configure device. */ -static inline int i2c_configure(struct device *dev, uint32_t dev_config) +static inline int i2c_configure(struct device *dev, u32_t dev_config) { const struct i2c_driver_api *api = dev->driver_api; @@ -157,8 +157,8 @@ static inline int i2c_configure(struct device *dev, uint32_t dev_config) * @retval 0 If successful. * @retval -EIO General input / output error. */ -static inline int i2c_write(struct device *dev, uint8_t *buf, - uint32_t num_bytes, uint16_t addr) +static inline int i2c_write(struct device *dev, u8_t *buf, + u32_t num_bytes, u16_t addr) { const struct i2c_driver_api *api = dev->driver_api; struct i2c_msg msg; @@ -183,8 +183,8 @@ static inline int i2c_write(struct device *dev, uint8_t *buf, * @retval 0 If successful. * @retval -EIO General input / output error. */ -static inline int i2c_read(struct device *dev, uint8_t *buf, - uint32_t num_bytes, uint16_t addr) +static inline int i2c_read(struct device *dev, u8_t *buf, + u32_t num_bytes, u16_t addr) { const struct i2c_driver_api *api = dev->driver_api; struct i2c_msg msg; @@ -215,8 +215,8 @@ static inline int i2c_read(struct device *dev, uint8_t *buf, * @retval -EIO General input / output error. */ static inline int i2c_transfer(struct device *dev, - struct i2c_msg *msgs, uint8_t num_msgs, - uint16_t addr) + struct i2c_msg *msgs, u8_t num_msgs, + u16_t addr) { const struct i2c_driver_api *api = dev->driver_api; @@ -238,9 +238,9 @@ static inline int i2c_transfer(struct device *dev, * @retval 0 If successful. * @retval -EIO General input / output error. */ -static inline int i2c_burst_read(struct device *dev, uint16_t dev_addr, - uint8_t start_addr, uint8_t *buf, - uint8_t num_bytes) +static inline int i2c_burst_read(struct device *dev, u16_t dev_addr, + u8_t start_addr, u8_t *buf, + u8_t num_bytes) { const struct i2c_driver_api *api = dev->driver_api; struct i2c_msg msg[2]; @@ -271,9 +271,9 @@ static inline int i2c_burst_read(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval -EIO General input / output error. */ -static inline int i2c_burst_write(struct device *dev, uint16_t dev_addr, - uint8_t start_addr, uint8_t *buf, - uint8_t num_bytes) +static inline int i2c_burst_write(struct device *dev, u16_t dev_addr, + u8_t start_addr, u8_t *buf, + u8_t num_bytes) { const struct i2c_driver_api *api = dev->driver_api; struct i2c_msg msg[2]; @@ -303,8 +303,8 @@ static inline int i2c_burst_write(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval -EIO General input / output error. */ -static inline int i2c_reg_read_byte(struct device *dev, uint16_t dev_addr, - uint8_t reg_addr, uint8_t *value) +static inline int i2c_reg_read_byte(struct device *dev, u16_t dev_addr, + u8_t reg_addr, u8_t *value) { return i2c_burst_read(dev, dev_addr, reg_addr, value, 1); } @@ -323,10 +323,10 @@ static inline int i2c_reg_read_byte(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval -EIO General input / output error. */ -static inline int i2c_reg_write_byte(struct device *dev, uint16_t dev_addr, - uint8_t reg_addr, uint8_t value) +static inline int i2c_reg_write_byte(struct device *dev, u16_t dev_addr, + u8_t reg_addr, u8_t value) { - uint8_t tx_buf[2] = {reg_addr, value}; + u8_t tx_buf[2] = {reg_addr, value}; return i2c_write(dev, tx_buf, 2, dev_addr); } @@ -346,11 +346,11 @@ static inline int i2c_reg_write_byte(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval -EIO General input / output error. */ -static inline int i2c_reg_update_byte(struct device *dev, uint8_t dev_addr, - uint8_t reg_addr, uint8_t mask, - uint8_t value) +static inline int i2c_reg_update_byte(struct device *dev, u8_t dev_addr, + u8_t reg_addr, u8_t mask, + u8_t value) { - uint8_t old_value, new_value; + u8_t old_value, new_value; int rc; rc = i2c_reg_read_byte(dev, dev_addr, reg_addr, &old_value); @@ -381,12 +381,12 @@ static inline int i2c_reg_update_byte(struct device *dev, uint8_t dev_addr, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int i2c_burst_read16(struct device *dev, uint16_t dev_addr, - uint16_t start_addr, uint8_t *buf, - uint8_t num_bytes) +static inline int i2c_burst_read16(struct device *dev, u16_t dev_addr, + u16_t start_addr, u8_t *buf, + u8_t num_bytes) { const struct i2c_driver_api *api = dev->driver_api; - uint8_t addr_buffer[2]; + u8_t addr_buffer[2]; struct i2c_msg msg[2]; addr_buffer[1] = start_addr & 0xFF; @@ -417,12 +417,12 @@ static inline int i2c_burst_read16(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int i2c_burst_write16(struct device *dev, uint16_t dev_addr, - uint16_t start_addr, uint8_t *buf, - uint8_t num_bytes) +static inline int i2c_burst_write16(struct device *dev, u16_t dev_addr, + u16_t start_addr, u8_t *buf, + u8_t num_bytes) { const struct i2c_driver_api *api = dev->driver_api; - uint8_t addr_buffer[2]; + u8_t addr_buffer[2]; struct i2c_msg msg[2]; addr_buffer[1] = start_addr & 0xFF; @@ -452,8 +452,8 @@ static inline int i2c_burst_write16(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int i2c_reg_read16(struct device *dev, uint16_t dev_addr, - uint16_t reg_addr, uint8_t *value) +static inline int i2c_reg_read16(struct device *dev, u16_t dev_addr, + u16_t reg_addr, u8_t *value) { return i2c_burst_read16(dev, dev_addr, reg_addr, value, 1); } @@ -472,8 +472,8 @@ static inline int i2c_reg_read16(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int i2c_reg_write16(struct device *dev, uint16_t dev_addr, - uint16_t reg_addr, uint8_t value) +static inline int i2c_reg_write16(struct device *dev, u16_t dev_addr, + u16_t reg_addr, u8_t value) { return i2c_burst_write16(dev, dev_addr, reg_addr, &value, 1); } @@ -493,11 +493,11 @@ static inline int i2c_reg_write16(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int i2c_reg_update16(struct device *dev, uint16_t dev_addr, - uint16_t reg_addr, uint8_t mask, - uint8_t value) +static inline int i2c_reg_update16(struct device *dev, u16_t dev_addr, + u16_t reg_addr, u8_t mask, + u8_t value) { - uint8_t old_value, new_value; + u8_t old_value, new_value; int rc; rc = i2c_reg_read16(dev, dev_addr, reg_addr, &old_value); @@ -531,10 +531,10 @@ static inline int i2c_reg_update16(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int i2c_burst_read_addr(struct device *dev, uint16_t dev_addr, - uint8_t *start_addr, - const uint8_t addr_size, - uint8_t *buf, uint8_t num_bytes) +static inline int i2c_burst_read_addr(struct device *dev, u16_t dev_addr, + u8_t *start_addr, + const u8_t addr_size, + u8_t *buf, u8_t num_bytes) { const struct i2c_driver_api *api = dev->driver_api; struct i2c_msg msg[2]; @@ -567,10 +567,10 @@ static inline int i2c_burst_read_addr(struct device *dev, uint16_t dev_addr, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int i2c_burst_write_addr(struct device *dev, uint16_t dev_addr, - uint8_t *start_addr, - const uint8_t addr_size, - uint8_t *buf, uint8_t num_bytes) +static inline int i2c_burst_write_addr(struct device *dev, u16_t dev_addr, + u8_t *start_addr, + const u8_t addr_size, + u8_t *buf, u8_t num_bytes) { const struct i2c_driver_api *api = dev->driver_api; struct i2c_msg msg[2]; @@ -604,10 +604,10 @@ static inline int i2c_burst_write_addr(struct device *dev, uint16_t dev_addr, * @retval Negative errno code if failure. */ static inline int i2c_reg_read_addr(struct device *dev, - uint16_t dev_addr, - uint8_t *reg_addr, - const uint8_t addr_size, - uint8_t *value) + u16_t dev_addr, + u8_t *reg_addr, + const u8_t addr_size, + u8_t *value) { return i2c_burst_read_addr(dev, dev_addr, reg_addr, addr_size, value, 1); @@ -631,10 +631,10 @@ static inline int i2c_reg_read_addr(struct device *dev, * @retval Negative errno code if failure. */ static inline int i2c_reg_write_addr(struct device *dev, - uint16_t dev_addr, - uint8_t *reg_addr, - const uint8_t addr_size, - uint8_t value) + u16_t dev_addr, + u8_t *reg_addr, + const u8_t addr_size, + u8_t value) { return i2c_burst_write_addr(dev, dev_addr, reg_addr, addr_size, &value, 1); @@ -659,13 +659,13 @@ static inline int i2c_reg_write_addr(struct device *dev, * @retval Negative errno code if failure. */ static inline int i2c_reg_update_addr(struct device *dev, - uint16_t dev_addr, - uint8_t *reg_addr, - uint8_t addr_size, - uint8_t mask, - uint8_t value) + u16_t dev_addr, + u8_t *reg_addr, + u8_t addr_size, + u8_t mask, + u8_t value) { - uint8_t old_value, new_value; + u8_t old_value, new_value; int rc; rc = i2c_reg_read_addr(dev, dev_addr, reg_addr, @@ -685,7 +685,7 @@ static inline int i2c_reg_update_addr(struct device *dev, struct i2c_client_config { char *i2c_master; - uint16_t i2c_addr; + u16_t i2c_addr; }; #define I2C_DECLARE_CLIENT_CONFIG struct i2c_client_config i2c_client diff --git a/include/ipm.h b/include/ipm.h index c388cccd0bc..4276db0595a 100644 --- a/include/ipm.h +++ b/include/ipm.h @@ -37,12 +37,12 @@ extern "C" { * * @param "void *context" Arbitrary context pointer provided at * registration time. - * @param "uint32_t id" Message type identifier. + * @param "u32_t id" Message type identifier. * @param "volatile void *data" Message data pointer. The correct * amount of data to read out * must be inferred using the message id/upper level protocol. */ -typedef void (*ipm_callback_t)(void *context, uint32_t id, volatile void *data); +typedef void (*ipm_callback_t)(void *context, u32_t id, volatile void *data); /** * @typedef ipm_send_t @@ -50,7 +50,7 @@ typedef void (*ipm_callback_t)(void *context, uint32_t id, volatile void *data); * * See @a ipm_send() for argument definitions. */ -typedef int (*ipm_send_t)(struct device *ipmdev, int wait, uint32_t id, +typedef int (*ipm_send_t)(struct device *ipmdev, int wait, u32_t id, const void *data, int size); /** * @typedef ipm_max_data_size_get_t @@ -66,7 +66,7 @@ typedef int (*ipm_max_data_size_get_t)(struct device *ipmdev); * * See @a ipm_max_id_val_get() for argument definitions. */ -typedef uint32_t (*ipm_max_id_val_get_t)(struct device *ipmdev); +typedef u32_t (*ipm_max_id_val_get_t)(struct device *ipmdev); /** * @typedef ipm_register_callback_t @@ -128,7 +128,7 @@ struct ipm_driver_api { * or the device isn't an outbound IPM channel. * @retval 0 On success. */ -static inline int ipm_send(struct device *ipmdev, int wait, uint32_t id, +static inline int ipm_send(struct device *ipmdev, int wait, u32_t id, const void *data, int size) { const struct ipm_driver_api *api = ipmdev->driver_api; @@ -180,7 +180,7 @@ static inline int ipm_max_data_size_get(struct device *ipmdev) * * @return Maximum possible value of a message ID. */ -static inline uint32_t ipm_max_id_val_get(struct device *ipmdev) +static inline u32_t ipm_max_id_val_get(struct device *ipmdev) { const struct ipm_driver_api *api = ipmdev->driver_api; diff --git a/include/kernel.h b/include/kernel.h index dbee429c0aa..8d42c623924 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -243,7 +243,7 @@ typedef void (*k_thread_entry_t)(void *p1, void *p2, void *p3); extern k_tid_t k_thread_spawn(char *stack, size_t stack_size, k_thread_entry_t entry, void *p1, void *p2, void *p3, - int prio, uint32_t options, int32_t delay); + int prio, u32_t options, s32_t delay); /** * @brief Put the current thread to sleep. @@ -255,7 +255,7 @@ extern k_tid_t k_thread_spawn(char *stack, size_t stack_size, * * @return N/A */ -extern void k_sleep(int32_t duration); +extern void k_sleep(s32_t duration); /** * @brief Cause the current thread to busy wait. @@ -265,7 +265,7 @@ extern void k_sleep(int32_t duration); * * @return N/A */ -extern void k_busy_wait(uint32_t usec_to_wait); +extern void k_busy_wait(u32_t usec_to_wait); /** * @brief Yield the current thread. @@ -348,10 +348,10 @@ struct _static_thread_data { void *init_p2; void *init_p3; int init_prio; - uint32_t init_options; - int32_t init_delay; + u32_t init_options; + s32_t init_delay; void (*init_abort)(void); - uint32_t init_groups; + u32_t init_groups; }; #define _THREAD_INITIALIZER(stack, stack_size, \ @@ -511,7 +511,7 @@ extern void k_thread_resume(k_tid_t thread); * * @return N/A */ -extern void k_sched_time_slice_set(int32_t slice, int prio); +extern void k_sched_time_slice_set(s32_t slice, int prio); /** * @} end defgroup thread_apis @@ -724,25 +724,25 @@ extern void *k_thread_custom_data_get(void); #endif #ifdef _NON_OPTIMIZED_TICKS_PER_SEC -extern int32_t _ms_to_ticks(int32_t ms); +extern s32_t _ms_to_ticks(s32_t ms); #else -static ALWAYS_INLINE int32_t _ms_to_ticks(int32_t ms) +static ALWAYS_INLINE s32_t _ms_to_ticks(s32_t ms) { - return (int32_t)ceiling_fraction((uint32_t)ms, _ms_per_tick); + return (s32_t)ceiling_fraction((u32_t)ms, _ms_per_tick); } #endif /* added tick needed to account for tick in progress */ #define _TICK_ALIGN 1 -static inline int64_t __ticks_to_ms(int64_t ticks) +static inline s64_t __ticks_to_ms(s64_t ticks) { #ifdef CONFIG_SYS_CLOCK_EXISTS #ifdef _NON_OPTIMIZED_TICKS_PER_SEC - return (MSEC_PER_SEC * (uint64_t)ticks) / sys_clock_ticks_per_sec; + return (MSEC_PER_SEC * (u64_t)ticks) / sys_clock_ticks_per_sec; #else - return (uint64_t)ticks * _ms_per_tick; + return (u64_t)ticks * _ms_per_tick; #endif #else @@ -760,11 +760,11 @@ struct _timeout { sys_dnode_t node; struct k_thread *thread; sys_dlist_t *wait_q; - int32_t delta_ticks_from_prev; + s32_t delta_ticks_from_prev; _timeout_func_t func; }; -extern int32_t _timeout_remaining_get(struct _timeout *timeout); +extern s32_t _timeout_remaining_get(struct _timeout *timeout); /** * INTERNAL_HIDDEN @endcond @@ -792,10 +792,10 @@ struct k_timer { void (*stop_fn)(struct k_timer *); /* timer period */ - int32_t period; + s32_t period; /* timer status */ - uint32_t status; + u32_t status; /* user-specific data, also used to support legacy features */ void *user_data; @@ -904,7 +904,7 @@ extern void k_timer_init(struct k_timer *timer, * @return N/A */ extern void k_timer_start(struct k_timer *timer, - int32_t duration, int32_t period); + s32_t duration, s32_t period); /** * @brief Stop a timer. @@ -936,7 +936,7 @@ extern void k_timer_stop(struct k_timer *timer); * * @return Timer status. */ -extern uint32_t k_timer_status_get(struct k_timer *timer); +extern u32_t k_timer_status_get(struct k_timer *timer); /** * @brief Synchronize thread to timer expiration. @@ -955,7 +955,7 @@ extern uint32_t k_timer_status_get(struct k_timer *timer); * * @return Timer status. */ -extern uint32_t k_timer_status_sync(struct k_timer *timer); +extern u32_t k_timer_status_sync(struct k_timer *timer); /** * @brief Get time remaining before a timer next expires. @@ -967,7 +967,7 @@ extern uint32_t k_timer_status_sync(struct k_timer *timer); * * @return Remaining time (in milliseconds). */ -static inline int32_t k_timer_remaining_get(struct k_timer *timer) +static inline s32_t k_timer_remaining_get(struct k_timer *timer) { return _timeout_remaining_get(&timer->timeout); } @@ -1021,7 +1021,7 @@ static inline void *k_timer_user_data_get(struct k_timer *timer) * * @return Current uptime. */ -extern int64_t k_uptime_get(void); +extern s64_t k_uptime_get(void); /** * @brief Get system uptime (32-bit version). @@ -1036,7 +1036,7 @@ extern int64_t k_uptime_get(void); * * @return Current uptime. */ -extern uint32_t k_uptime_get_32(void); +extern u32_t k_uptime_get_32(void); /** * @brief Get elapsed time. @@ -1049,7 +1049,7 @@ extern uint32_t k_uptime_get_32(void); * * @return Elapsed time. */ -extern int64_t k_uptime_delta(int64_t *reftime); +extern s64_t k_uptime_delta(s64_t *reftime); /** * @brief Get elapsed time (32-bit version). @@ -1067,7 +1067,7 @@ extern int64_t k_uptime_delta(int64_t *reftime); * * @return Elapsed time. */ -extern uint32_t k_uptime_delta_32(int64_t *reftime); +extern u32_t k_uptime_delta_32(s64_t *reftime); /** * @brief Read the hardware clock. @@ -1222,7 +1222,7 @@ extern void k_queue_merge_slist(struct k_queue *queue, sys_slist_t *list); * @return Address of the data item if successful; NULL if returned * without waiting, or waiting period timed out. */ -extern void *k_queue_get(struct k_queue *queue, int32_t timeout); +extern void *k_queue_get(struct k_queue *queue, s32_t timeout); /** * @brief Query a queue to see if it has data available. @@ -1495,7 +1495,7 @@ struct k_lifo { struct k_stack { _wait_q_t wait_q; - uint32_t *base, *next, *top; + u32_t *base, *next, *top; _OBJECT_TRACING_NEXT_PTR(k_stack); }; @@ -1531,7 +1531,7 @@ struct k_stack { * @return N/A */ extern void k_stack_init(struct k_stack *stack, - uint32_t *buffer, int num_entries); + u32_t *buffer, int num_entries); /** * @brief Push an element onto a stack. @@ -1545,7 +1545,7 @@ extern void k_stack_init(struct k_stack *stack, * * @return N/A */ -extern void k_stack_push(struct k_stack *stack, uint32_t data); +extern void k_stack_push(struct k_stack *stack, u32_t data); /** * @brief Pop an element from a stack. @@ -1564,7 +1564,7 @@ extern void k_stack_push(struct k_stack *stack, uint32_t data); * @retval -EBUSY Returned without waiting. * @retval -EAGAIN Waiting period timed out. */ -extern int k_stack_pop(struct k_stack *stack, uint32_t *data, int32_t timeout); +extern int k_stack_pop(struct k_stack *stack, u32_t *data, s32_t timeout); /** * @brief Statically define and initialize a stack @@ -1577,7 +1577,7 @@ extern int k_stack_pop(struct k_stack *stack, uint32_t *data, int32_t timeout); * @param stack_num_entries Maximum number of values that can be stacked. */ #define K_STACK_DEFINE(name, stack_num_entries) \ - uint32_t __noinit \ + u32_t __noinit \ _k_stack_buf_##name[stack_num_entries]; \ struct k_stack name \ __in_section(_k_stack, static, name) = \ @@ -1782,7 +1782,7 @@ extern void k_delayed_work_init(struct k_delayed_work *work, */ extern int k_delayed_work_submit_to_queue(struct k_work_q *work_q, struct k_delayed_work *work, - int32_t delay); + s32_t delay); /** * @brief Cancel a delayed work item. @@ -1860,7 +1860,7 @@ static inline void k_work_submit(struct k_work *work) * @retval -EADDRINUSE Work item is pending on a different workqueue. */ static inline int k_delayed_work_submit(struct k_delayed_work *work, - int32_t delay) + s32_t delay) { return k_delayed_work_submit_to_queue(&k_sys_work_q, work, delay); } @@ -1876,7 +1876,7 @@ static inline int k_delayed_work_submit(struct k_delayed_work *work, * * @return Remaining time (in milliseconds). */ -static inline int32_t k_delayed_work_remaining_get(struct k_delayed_work *work) +static inline s32_t k_delayed_work_remaining_get(struct k_delayed_work *work) { return _timeout_remaining_get(&work->timeout); } @@ -1892,7 +1892,7 @@ static inline int32_t k_delayed_work_remaining_get(struct k_delayed_work *work) struct k_mutex { _wait_q_t wait_q; struct k_thread *owner; - uint32_t lock_count; + u32_t lock_count; int owner_orig_prio; _OBJECT_TRACING_NEXT_PTR(k_mutex); @@ -1962,7 +1962,7 @@ extern void k_mutex_init(struct k_mutex *mutex); * @retval -EBUSY Returned without waiting. * @retval -EAGAIN Waiting period timed out. */ -extern int k_mutex_lock(struct k_mutex *mutex, int32_t timeout); +extern int k_mutex_lock(struct k_mutex *mutex, s32_t timeout); /** * @brief Unlock a mutex. @@ -2051,7 +2051,7 @@ extern void k_sem_init(struct k_sem *sem, unsigned int initial_count, * @retval -EBUSY Returned without waiting. * @retval -EAGAIN Waiting period timed out. */ -extern int k_sem_take(struct k_sem *sem, int32_t timeout); +extern int k_sem_take(struct k_sem *sem, s32_t timeout); /** * @brief Give a semaphore. @@ -2227,7 +2227,7 @@ extern void k_alert_init(struct k_alert *alert, k_alert_handler_t handler, * @retval -EBUSY Returned without waiting. * @retval -EAGAIN Waiting period timed out. */ -extern int k_alert_recv(struct k_alert *alert, int32_t timeout); +extern int k_alert_recv(struct k_alert *alert, s32_t timeout); /** * @brief Signal an alert. @@ -2256,12 +2256,12 @@ extern void k_alert_send(struct k_alert *alert); struct k_msgq { _wait_q_t wait_q; size_t msg_size; - uint32_t max_msgs; + u32_t max_msgs; char *buffer_start; char *buffer_end; char *read_ptr; char *write_ptr; - uint32_t used_msgs; + u32_t used_msgs; _OBJECT_TRACING_NEXT_PTR(k_msgq); }; @@ -2335,7 +2335,7 @@ struct k_msgq { * @return N/A */ extern void k_msgq_init(struct k_msgq *q, char *buffer, - size_t msg_size, uint32_t max_msgs); + size_t msg_size, u32_t max_msgs); /** * @brief Send a message to a message queue. @@ -2353,7 +2353,7 @@ extern void k_msgq_init(struct k_msgq *q, char *buffer, * @retval -ENOMSG Returned without waiting or queue purged. * @retval -EAGAIN Waiting period timed out. */ -extern int k_msgq_put(struct k_msgq *q, void *data, int32_t timeout); +extern int k_msgq_put(struct k_msgq *q, void *data, s32_t timeout); /** * @brief Receive a message from a message queue. @@ -2372,7 +2372,7 @@ extern int k_msgq_put(struct k_msgq *q, void *data, int32_t timeout); * @retval -ENOMSG Returned without waiting. * @retval -EAGAIN Waiting period timed out. */ -extern int k_msgq_get(struct k_msgq *q, void *data, int32_t timeout); +extern int k_msgq_get(struct k_msgq *q, void *data, s32_t timeout); /** * @brief Purge a message queue. @@ -2397,7 +2397,7 @@ extern void k_msgq_purge(struct k_msgq *q); * * @return Number of unused ring buffer entries. */ -static inline uint32_t k_msgq_num_free_get(struct k_msgq *q) +static inline u32_t k_msgq_num_free_get(struct k_msgq *q) { return q->max_msgs - q->used_msgs; } @@ -2411,7 +2411,7 @@ static inline uint32_t k_msgq_num_free_get(struct k_msgq *q) * * @return Number of messages. */ -static inline uint32_t k_msgq_num_used_get(struct k_msgq *q) +static inline u32_t k_msgq_num_used_get(struct k_msgq *q) { return q->used_msgs; } @@ -2445,11 +2445,11 @@ struct k_mem_block { struct k_mbox_msg { /** internal use only - needed for legacy API support */ - uint32_t _mailbox; + u32_t _mailbox; /** size of message (in bytes) */ size_t size; /** application-defined information value */ - uint32_t info; + u32_t info; /** sender's message data buffer */ void *tx_data; /** internal use only - needed for legacy API support */ @@ -2535,7 +2535,7 @@ extern void k_mbox_init(struct k_mbox *mbox); * @retval -EAGAIN Waiting period timed out. */ extern int k_mbox_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, - int32_t timeout); + s32_t timeout); /** * @brief Send a mailbox message in an asynchronous manner. @@ -2574,7 +2574,7 @@ extern void k_mbox_async_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, * @retval -EAGAIN Waiting period timed out. */ extern int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *rx_msg, - void *buffer, int32_t timeout); + void *buffer, s32_t timeout); /** * @brief Retrieve mailbox message data into a buffer. @@ -2625,7 +2625,7 @@ extern void k_mbox_data_get(struct k_mbox_msg *rx_msg, void *buffer); */ extern int k_mbox_data_block_get(struct k_mbox_msg *rx_msg, struct k_mem_pool *pool, - struct k_mem_block *block, int32_t timeout); + struct k_mem_block *block, s32_t timeout); /** * @} end defgroup mailbox_apis @@ -2728,7 +2728,7 @@ extern void k_pipe_init(struct k_pipe *pipe, unsigned char *buffer, */ extern int k_pipe_put(struct k_pipe *pipe, void *data, size_t bytes_to_write, size_t *bytes_written, - size_t min_xfer, int32_t timeout); + size_t min_xfer, s32_t timeout); /** * @brief Read data from a pipe. @@ -2751,7 +2751,7 @@ extern int k_pipe_put(struct k_pipe *pipe, void *data, */ extern int k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, size_t *bytes_read, - size_t min_xfer, int32_t timeout); + size_t min_xfer, s32_t timeout); /** * @brief Write memory block to a pipe. @@ -2780,11 +2780,11 @@ extern void k_pipe_block_put(struct k_pipe *pipe, struct k_mem_block *block, struct k_mem_slab { _wait_q_t wait_q; - uint32_t num_blocks; + u32_t num_blocks; size_t block_size; char *buffer; char *free_list; - uint32_t num_used; + u32_t num_used; _OBJECT_TRACING_NEXT_PTR(k_mem_slab); }; @@ -2857,7 +2857,7 @@ struct k_mem_slab { * @return N/A */ extern void k_mem_slab_init(struct k_mem_slab *slab, void *buffer, - size_t block_size, uint32_t num_blocks); + size_t block_size, u32_t num_blocks); /** * @brief Allocate memory from a memory slab. @@ -2876,7 +2876,7 @@ extern void k_mem_slab_init(struct k_mem_slab *slab, void *buffer, * @retval -EAGAIN Waiting period timed out. */ extern int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, - int32_t timeout); + s32_t timeout); /** * @brief Free memory allocated from a memory slab. @@ -2901,7 +2901,7 @@ extern void k_mem_slab_free(struct k_mem_slab *slab, void **mem); * * @return Number of allocated memory blocks. */ -static inline uint32_t k_mem_slab_num_used_get(struct k_mem_slab *slab) +static inline u32_t k_mem_slab_num_used_get(struct k_mem_slab *slab) { return slab->num_used; } @@ -2916,7 +2916,7 @@ static inline uint32_t k_mem_slab_num_used_get(struct k_mem_slab *slab) * * @return Number of unallocated memory blocks. */ -static inline uint32_t k_mem_slab_num_free_get(struct k_mem_slab *slab) +static inline u32_t k_mem_slab_num_free_get(struct k_mem_slab *slab) { return slab->num_blocks - slab->num_used; } @@ -2937,7 +2937,7 @@ static inline uint32_t k_mem_slab_num_free_get(struct k_mem_slab *slab) */ struct k_mem_pool_quad_block { char *mem_blocks; /* pointer to the first of four memory blocks */ - uint32_t mem_status; /* four bits. If bit is set, memory block is + u32_t mem_status; /* four bits. If bit is set, memory block is allocated */ }; /* @@ -2954,7 +2954,7 @@ struct k_mem_pool_quad_block { */ struct k_mem_pool_block_set { size_t block_size; /* memory block size */ - uint32_t nr_of_entries; /* nr of quad block structures in the array */ + u32_t nr_of_entries; /* nr of quad block structures in the array */ struct k_mem_pool_quad_block *quad_block; int count; }; @@ -2963,8 +2963,8 @@ struct k_mem_pool_block_set { struct k_mem_pool { size_t max_block_size; size_t min_block_size; - uint32_t nr_of_maxblocks; - uint32_t nr_of_block_sets; + u32_t nr_of_maxblocks; + u32_t nr_of_block_sets; struct k_mem_pool_block_set *block_set; char *bufblock; _wait_q_t wait_q; @@ -3098,7 +3098,7 @@ __asm__(".macro _build_mem_pool name, min_size, max_size, n_max\n\t" __asm__("_mem_pool_block_set_count_" STRINGIFY(name) ":\n\t"); \ __asm__(".int __memory_pool_block_set_count\n\t"); \ __asm__(".popsection\n\t"); \ - extern uint32_t _mem_pool_block_set_count_##name; \ + extern u32_t _mem_pool_block_set_count_##name; \ extern struct k_mem_pool_block_set _mem_pool_block_sets_##name[] #define _MEMORY_POOL_BUFFER_DEFINE(name, max_size, n_max, align) \ @@ -3179,7 +3179,7 @@ static void __attribute__ ((used)) __k_mem_pool_quad_block_size_define(void) * @retval -EAGAIN Waiting period timed out. */ extern int k_mem_pool_alloc(struct k_mem_pool *pool, struct k_mem_block *block, - size_t size, int32_t timeout); + size_t size, s32_t timeout); /** * @brief Free memory allocated from a memory pool. @@ -3374,19 +3374,19 @@ struct k_poll_event { struct _poller *poller; /* optional user-specified tag, opaque, untouched by the API */ - uint32_t tag:8; + u32_t tag:8; /* bitfield of event types (bitwise-ORed K_POLL_TYPE_xxx values) */ - uint32_t type:_POLL_NUM_TYPES; + u32_t type:_POLL_NUM_TYPES; /* bitfield of event states (bitwise-ORed K_POLL_STATE_xxx values) */ - uint32_t state:_POLL_NUM_STATES; + u32_t state:_POLL_NUM_STATES; /* mode of operation, from enum k_poll_modes */ - uint32_t mode:1; + u32_t mode:1; /* unused bits in 32-bit word */ - uint32_t unused:_POLL_EVENT_NUM_UNUSED_BITS; + u32_t unused:_POLL_EVENT_NUM_UNUSED_BITS; /* per-type data */ union { @@ -3436,7 +3436,7 @@ struct k_poll_event { * @return N/A */ -extern void k_poll_event_init(struct k_poll_event *event, uint32_t type, +extern void k_poll_event_init(struct k_poll_event *event, u32_t type, int mode, void *obj); /** @@ -3481,7 +3481,7 @@ extern void k_poll_event_init(struct k_poll_event *event, uint32_t type, */ extern int k_poll(struct k_poll_event *events, int num_events, - int32_t timeout); + s32_t timeout); /** * @brief Initialize a poll signal object. @@ -3518,7 +3518,7 @@ extern int k_poll_signal(struct k_poll_signal *signal, int result); /* private internal function */ extern int _handle_obj_poll_event(struct k_poll_event **obj_poll_event, - uint32_t state); + u32_t state); /** * @} end defgroup poll_apis @@ -3550,7 +3550,7 @@ extern void k_cpu_idle(void); */ extern void k_cpu_atomic_idle(unsigned int key); -extern void _sys_power_save_idle_exit(int32_t ticks); +extern void _sys_power_save_idle_exit(s32_t ticks); #include diff --git a/include/kernel_version.h b/include/kernel_version.h index 6754b70cf5b..1ee00ebb18f 100644 --- a/include/kernel_version.h +++ b/include/kernel_version.h @@ -32,7 +32,7 @@ extern "C" { /* kernel version routines */ -extern uint32_t sys_kernel_version_get(void); +extern u32_t sys_kernel_version_get(void); #ifdef __cplusplus } diff --git a/include/linker/intlist.ld b/include/linker/intlist.ld index 6299113c887..fdf8fe0d93d 100644 --- a/include/linker/intlist.ld +++ b/include/linker/intlist.ld @@ -12,8 +12,8 @@ * struct { * void *spurious_irq_handler; * void *sw_irq_handler; - * uint32_t num_isrs; - * uint32_t num_vectors; + * u32_t num_isrs; + * u32_t num_vectors; * struct _isr_list isrs[]; <- of size num_isrs * } * diff --git a/include/logging/event_logger.h b/include/logging/event_logger.h index 0985d6ae026..cf7500fe7a8 100644 --- a/include/logging/event_logger.h +++ b/include/logging/event_logger.h @@ -47,7 +47,7 @@ struct event_logger { * @return N/A */ void sys_event_logger_init(struct event_logger *logger, - uint32_t *logger_buffer, uint32_t buffer_size); + u32_t *logger_buffer, u32_t buffer_size); /** @@ -63,8 +63,8 @@ void sys_event_logger_init(struct event_logger *logger, * * @return N/A */ -void sys_event_logger_put(struct event_logger *logger, uint16_t event_id, - uint32_t *event_data, uint8_t data_size); +void sys_event_logger_put(struct event_logger *logger, u16_t event_id, + u32_t *event_data, u8_t data_size); /** @@ -88,9 +88,9 @@ void sys_event_logger_put(struct event_logger *logger, uint16_t event_id, * @retval Number of 32-bit words copied. * @retval 0 If no message was already available. */ -int sys_event_logger_get(struct event_logger *logger, uint16_t *event_id, - uint8_t *dropped_event_count, uint32_t *buffer, - uint8_t *buffer_size); +int sys_event_logger_get(struct event_logger *logger, u16_t *event_id, + u8_t *dropped_event_count, u32_t *buffer, + u8_t *buffer_size); /** * @brief Retrieve an event message from the logger, wait if empty. @@ -113,9 +113,9 @@ int sys_event_logger_get(struct event_logger *logger, uint16_t *event_id, * @retval EMSGSIZE If the buffer size is smaller than the message size. * @retval Number of DWORDs copied, otherwise. */ -int sys_event_logger_get_wait(struct event_logger *logger, uint16_t *event_id, - uint8_t *dropped_event_count, uint32_t *buffer, - uint8_t *buffer_size); +int sys_event_logger_get_wait(struct event_logger *logger, u16_t *event_id, + u8_t *dropped_event_count, u32_t *buffer, + u8_t *buffer_size); #ifdef CONFIG_SYS_CLOCK_EXISTS /** @@ -144,10 +144,10 @@ int sys_event_logger_get_wait(struct event_logger *logger, uint16_t *event_id, * available. */ int sys_event_logger_get_wait_timeout(struct event_logger *logger, - uint16_t *event_id, - uint8_t *dropped_event_count, - uint32_t *buffer, uint8_t *buffer_size, - uint32_t timeout); + u16_t *event_id, + u8_t *dropped_event_count, + u32_t *buffer, u8_t *buffer_size, + u32_t timeout); /** * @} */ diff --git a/include/logging/kernel_event_logger.h b/include/logging/kernel_event_logger.h index 7ce1e7fb351..238cf612996 100644 --- a/include/logging/kernel_event_logger.h +++ b/include/logging/kernel_event_logger.h @@ -58,7 +58,7 @@ static inline void _sys_k_event_logger_interrupt(void) {}; * * @return Timestamp value (application-defined). */ -typedef uint32_t (*sys_k_timer_func_t)(void); +typedef u32_t (*sys_k_timer_func_t)(void); /** * @cond INTERNAL_HIDDEN @@ -173,9 +173,9 @@ static inline int sys_k_must_log_event(int event_type) * * @return N/A */ -static inline void sys_k_event_logger_put(uint16_t event_id, - uint32_t *event_data, - uint8_t data_size) +static inline void sys_k_event_logger_put(u16_t event_id, + u32_t *event_data, + u8_t data_size) { #ifdef CONFIG_KERNEL_EVENT_LOGGER sys_event_logger_put(&sys_k_event_logger, event_id, @@ -198,9 +198,9 @@ static inline void sys_k_event_logger_put(uint16_t event_id, * @return N/A */ #ifdef CONFIG_KERNEL_EVENT_LOGGER -extern void sys_k_event_logger_put_timed(uint16_t event_id); +extern void sys_k_event_logger_put_timed(u16_t event_id); #else -static inline void sys_k_event_logger_put_timed(uint16_t event_id) +static inline void sys_k_event_logger_put_timed(u16_t event_id) { ARG_UNUSED(event_id); }; @@ -225,8 +225,8 @@ static inline void sys_k_event_logger_put_timed(uint16_t event_id) * the size of the event to be retrieved. */ #ifdef CONFIG_KERNEL_EVENT_LOGGER -static inline int sys_k_event_logger_get(uint16_t *event_id, uint8_t *dropped, - uint32_t *event_data, uint8_t *data_size) +static inline int sys_k_event_logger_get(u16_t *event_id, u8_t *dropped, + u32_t *event_data, u8_t *data_size) { return sys_event_logger_get(&sys_k_event_logger, event_id, dropped, event_data, data_size); @@ -251,8 +251,8 @@ static inline int sys_k_event_logger_get(uint16_t *event_id, uint8_t *dropped, * the size of the event to be retrieved. */ #ifdef CONFIG_KERNEL_EVENT_LOGGER -static inline int sys_k_event_logger_get_wait(uint16_t *event_id, - uint8_t *dropped, uint32_t *event_data, uint8_t *data_size) +static inline int sys_k_event_logger_get_wait(u16_t *event_id, + u8_t *dropped, u32_t *event_data, u8_t *data_size) { return sys_event_logger_get_wait(&sys_k_event_logger, event_id, dropped, event_data, data_size); @@ -281,9 +281,9 @@ static inline int sys_k_event_logger_get_wait(uint16_t *event_id, * the size of the event to be retrieved. */ #if defined(CONFIG_KERNEL_EVENT_LOGGER) -static inline int sys_k_event_logger_get_wait_timeout(uint16_t *event_id, - uint8_t *dropped, uint32_t *event_data, - uint8_t *data_size, uint32_t timeout) +static inline int sys_k_event_logger_get_wait_timeout(u16_t *event_id, + u8_t *dropped, u32_t *event_data, + u8_t *data_size, u32_t timeout) { return sys_event_logger_get_wait_timeout(&sys_k_event_logger, event_id, dropped, event_data, diff --git a/include/misc/byteorder.h b/include/misc/byteorder.h index 848dc9d872b..fc5654b7f0c 100644 --- a/include/misc/byteorder.h +++ b/include/misc/byteorder.h @@ -16,8 +16,8 @@ #include /* Internal helpers only used by the sys_* APIs further below */ -#define __bswap_16(x) ((uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) -#define __bswap_32(x) ((uint32_t) ((((x) >> 24) & 0xff) | \ +#define __bswap_16(x) ((u16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) +#define __bswap_32(x) ((u32_t) ((((x) >> 24) & 0xff) | \ (((x) >> 8) & 0xff00) | \ (((x) & 0xff00) << 8) | \ (((x) & 0xff) << 24))) @@ -117,7 +117,7 @@ * @param val 16-bit integer in host endianness. * @param dst Destination memory address to store the result. */ -static inline void sys_put_be16(uint16_t val, uint8_t dst[2]) +static inline void sys_put_be16(u16_t val, u8_t dst[2]) { dst[0] = val >> 8; dst[1] = val; @@ -132,7 +132,7 @@ static inline void sys_put_be16(uint16_t val, uint8_t dst[2]) * @param val 32-bit integer in host endianness. * @param dst Destination memory address to store the result. */ -static inline void sys_put_be32(uint32_t val, uint8_t dst[4]) +static inline void sys_put_be32(u32_t val, u8_t dst[4]) { sys_put_be16(val >> 16, dst); sys_put_be16(val, &dst[2]); @@ -147,7 +147,7 @@ static inline void sys_put_be32(uint32_t val, uint8_t dst[4]) * @param val 16-bit integer in host endianness. * @param dst Destination memory address to store the result. */ -static inline void sys_put_le16(uint16_t val, uint8_t dst[2]) +static inline void sys_put_le16(u16_t val, u8_t dst[2]) { dst[0] = val; dst[1] = val >> 8; @@ -162,7 +162,7 @@ static inline void sys_put_le16(uint16_t val, uint8_t dst[2]) * @param val 32-bit integer in host endianness. * @param dst Destination memory address to store the result. */ -static inline void sys_put_le32(uint32_t val, uint8_t dst[4]) +static inline void sys_put_le32(u32_t val, u8_t dst[4]) { sys_put_le16(val, dst); sys_put_le16(val >> 16, &dst[2]); @@ -177,7 +177,7 @@ static inline void sys_put_le32(uint32_t val, uint8_t dst[4]) * @param val 64-bit integer in host endianness. * @param dst Destination memory address to store the result. */ -static inline void sys_put_le64(uint64_t val, uint8_t dst[8]) +static inline void sys_put_le64(u64_t val, u8_t dst[8]) { sys_put_le32(val, dst); sys_put_le32(val >> 32, &dst[4]); @@ -193,9 +193,9 @@ static inline void sys_put_le64(uint64_t val, uint8_t dst[8]) * * @return 16-bit integer in host endianness. */ -static inline uint16_t sys_get_be16(const uint8_t src[2]) +static inline u16_t sys_get_be16(const u8_t src[2]) { - return ((uint16_t)src[0] << 8) | src[1]; + return ((u16_t)src[0] << 8) | src[1]; } /** @@ -208,9 +208,9 @@ static inline uint16_t sys_get_be16(const uint8_t src[2]) * * @return 32-bit integer in host endianness. */ -static inline uint32_t sys_get_be32(const uint8_t src[4]) +static inline u32_t sys_get_be32(const u8_t src[4]) { - return ((uint32_t)sys_get_be16(&src[0]) << 16) | sys_get_be16(&src[2]); + return ((u32_t)sys_get_be16(&src[0]) << 16) | sys_get_be16(&src[2]); } /** @@ -223,9 +223,9 @@ static inline uint32_t sys_get_be32(const uint8_t src[4]) * * @return 16-bit integer in host endianness. */ -static inline uint16_t sys_get_le16(const uint8_t src[2]) +static inline u16_t sys_get_le16(const u8_t src[2]) { - return ((uint16_t)src[1] << 8) | src[0]; + return ((u16_t)src[1] << 8) | src[0]; } /** @@ -238,9 +238,9 @@ static inline uint16_t sys_get_le16(const uint8_t src[2]) * * @return 32-bit integer in host endianness. */ -static inline uint32_t sys_get_le32(const uint8_t src[4]) +static inline u32_t sys_get_le32(const u8_t src[4]) { - return ((uint32_t)sys_get_le16(&src[2]) << 16) | sys_get_le16(&src[0]); + return ((u32_t)sys_get_le16(&src[2]) << 16) | sys_get_le16(&src[0]); } /** @@ -253,9 +253,9 @@ static inline uint32_t sys_get_le32(const uint8_t src[4]) * * @return 64-bit integer in host endianness. */ -static inline uint64_t sys_get_le64(const uint8_t src[8]) +static inline u64_t sys_get_le64(const u8_t src[8]) { - return ((uint64_t)sys_get_le32(&src[4]) << 32) | sys_get_le32(&src[0]); + return ((u64_t)sys_get_le32(&src[4]) << 32) | sys_get_le32(&src[0]); } /** @@ -280,7 +280,7 @@ static inline void sys_memcpy_swap(void *dst, const void *src, size_t length) src += length - 1; for (; length > 0; length--) { - *((uint8_t *)dst++) = *((uint8_t *)src--); + *((u8_t *)dst++) = *((u8_t *)src--); } } @@ -299,10 +299,10 @@ static inline void sys_mem_swap(void *buf, size_t length) size_t i; for (i = 0; i < (length/2); i++) { - uint8_t tmp = ((uint8_t *)buf)[i]; + u8_t tmp = ((u8_t *)buf)[i]; - ((uint8_t *)buf)[i] = ((uint8_t *)buf)[length - 1 - i]; - ((uint8_t *)buf)[length - 1 - i] = tmp; + ((u8_t *)buf)[i] = ((u8_t *)buf)[length - 1 - i]; + ((u8_t *)buf)[length - 1 - i] = tmp; } } diff --git a/include/misc/ring_buffer.h b/include/misc/ring_buffer.h index f7cbc5c307b..88e993360b5 100644 --- a/include/misc/ring_buffer.h +++ b/include/misc/ring_buffer.h @@ -19,20 +19,20 @@ extern "C" { #endif -#define SIZE32_OF(x) (sizeof((x))/sizeof(uint32_t)) +#define SIZE32_OF(x) (sizeof((x))/sizeof(u32_t)) /** * @brief A structure to represent a ring buffer */ struct ring_buf { - uint32_t head; /**< Index in buf for the head element */ - uint32_t tail; /**< Index in buf for the tail element */ - uint32_t dropped_put_count; /**< Running tally of the number of failed + u32_t head; /**< Index in buf for the head element */ + u32_t tail; /**< Index in buf for the tail element */ + u32_t dropped_put_count; /**< Running tally of the number of failed * put attempts */ - uint32_t size; /**< Size of buf in 32-bit chunks */ - uint32_t *buf; /**< Memory region for stored entries */ - uint32_t mask; /**< Modulo mask if size is a power of 2 */ + u32_t size; /**< Size of buf in 32-bit chunks */ + u32_t *buf; /**< Memory region for stored entries */ + u32_t mask; /**< Modulo mask if size is a power of 2 */ #ifdef CONFIG_OBJECT_TRACING struct ring_buf *__next; #endif @@ -61,7 +61,7 @@ struct ring_buf { * @param pow Ring buffer size exponent. */ #define SYS_RING_BUF_DECLARE_POW2(name, pow) \ - static uint32_t _ring_buffer_data_##name[1 << (pow)]; \ + static u32_t _ring_buffer_data_##name[1 << (pow)]; \ struct ring_buf name = { \ .size = (1 << (pow)), \ .mask = (1 << (pow)) - 1, \ @@ -83,7 +83,7 @@ struct ring_buf { * @param size32 Size of ring buffer (in 32-bit words). */ #define SYS_RING_BUF_DECLARE_SIZE(name, size32) \ - static uint32_t _ring_buffer_data_##name[size32]; \ + static u32_t _ring_buffer_data_##name[size32]; \ struct ring_buf name = { \ .size = size32, \ .buf = _ring_buffer_data_##name \ @@ -102,10 +102,10 @@ struct ring_buf { * * @param buf Address of ring buffer. * @param size Ring buffer size (in 32-bit words). - * @param data Ring buffer data area (typically uint32_t data[size]). + * @param data Ring buffer data area (typically u32_t data[size]). */ -static inline void sys_ring_buf_init(struct ring_buf *buf, uint32_t size, - uint32_t *data) +static inline void sys_ring_buf_init(struct ring_buf *buf, u32_t size, + u32_t *data) { buf->head = 0; buf->tail = 0; @@ -175,8 +175,8 @@ static inline int sys_ring_buf_space_get(struct ring_buf *buf) * @retval 0 Data item was written. * @retval -EMSGSIZE Ring buffer has insufficient free space. */ -int sys_ring_buf_put(struct ring_buf *buf, uint16_t type, uint8_t value, - uint32_t *data, uint8_t size32); +int sys_ring_buf_put(struct ring_buf *buf, u16_t type, u8_t value, + u32_t *data, u8_t size32); /** * @brief Read a data item from a ring buffer. @@ -202,8 +202,8 @@ int sys_ring_buf_put(struct ring_buf *buf, uint16_t type, uint8_t value, * @retval -EMSGSIZE Data area @a data is too small; @a size32 now contains * the number of 32-bit words needed. */ -int sys_ring_buf_get(struct ring_buf *buf, uint16_t *type, uint8_t *value, - uint32_t *data, uint8_t *size32); +int sys_ring_buf_get(struct ring_buf *buf, u16_t *type, u8_t *value, + u32_t *data, u8_t *size32); /** * @} diff --git a/include/misc/util.h b/include/misc/util.h index 1f788597c05..ac7ad4df589 100644 --- a/include/misc/util.h +++ b/include/misc/util.h @@ -25,9 +25,9 @@ extern "C" { /* Helper to pass a int as a pointer or vice-versa. * Those are available for 32 bits architectures: */ -#define POINTER_TO_UINT(x) ((uint32_t) (x)) +#define POINTER_TO_UINT(x) ((u32_t) (x)) #define UINT_TO_POINTER(x) ((void *) (x)) -#define POINTER_TO_INT(x) ((int32_t) (x)) +#define POINTER_TO_INT(x) ((s32_t) (x)) #define INT_TO_POINTER(x) ((void *) (x)) /* Evaluates to 0 if cond is true-ish; compile error otherwise */ @@ -85,9 +85,9 @@ static inline int is_power_of_two(unsigned int x) return (x != 0) && !(x & (x - 1)); } -static inline int64_t arithmetic_shift_right(int64_t value, uint8_t shift) +static inline s64_t arithmetic_shift_right(s64_t value, u8_t shift) { - int64_t sign_ext; + s64_t sign_ext; if (shift == 0) { return value; diff --git a/include/pinmux.h b/include/pinmux.h index 1bc69552fcc..a92ab87d9ac 100644 --- a/include/pinmux.h +++ b/include/pinmux.h @@ -42,25 +42,25 @@ extern "C" { * @brief Callback API upon setting a PIN's function * See pinmux_pin_set() for argument description */ -typedef int (*pmux_set)(struct device *dev, uint32_t pin, uint32_t func); +typedef int (*pmux_set)(struct device *dev, u32_t pin, u32_t func); /** * @typedef pmux_get * @brief Callback API upon getting a PIN's function * See pinmux_pin_get() for argument description */ -typedef int (*pmux_get)(struct device *dev, uint32_t pin, uint32_t *func); +typedef int (*pmux_get)(struct device *dev, u32_t pin, u32_t *func); /** * @typedef pmux_pullup * @brief Callback API upon setting a PIN's pullup * See pinmix_pin_pullup() for argument description */ -typedef int (*pmux_pullup)(struct device *dev, uint32_t pin, uint8_t func); +typedef int (*pmux_pullup)(struct device *dev, u32_t pin, u8_t func); /** * @typedef pmux_input * @brief Callback API upon setting a PIN's input function * See pinmux_input() for argument description */ -typedef int (*pmux_input)(struct device *dev, uint32_t pin, uint8_t func); +typedef int (*pmux_input)(struct device *dev, u32_t pin, u8_t func); struct pinmux_driver_api { pmux_set set; @@ -71,8 +71,8 @@ struct pinmux_driver_api { static inline int pinmux_pin_set(struct device *dev, - uint32_t pin, - uint32_t func) + u32_t pin, + u32_t func) { const struct pinmux_driver_api *api = dev->driver_api; @@ -80,8 +80,8 @@ static inline int pinmux_pin_set(struct device *dev, } static inline int pinmux_pin_get(struct device *dev, - uint32_t pin, - uint32_t *func) + u32_t pin, + u32_t *func) { const struct pinmux_driver_api *api = dev->driver_api; @@ -89,8 +89,8 @@ static inline int pinmux_pin_get(struct device *dev, } static inline int pinmux_pin_pullup(struct device *dev, - uint32_t pin, - uint8_t func) + u32_t pin, + u8_t func) { const struct pinmux_driver_api *api = dev->driver_api; @@ -98,8 +98,8 @@ static inline int pinmux_pin_pullup(struct device *dev, } static inline int pinmux_pin_input_enable(struct device *dev, - uint32_t pin, - uint8_t func) + u32_t pin, + u8_t func) { const struct pinmux_driver_api *api = dev->driver_api; diff --git a/include/power.h b/include/power.h index f8e1e2c645f..60a28455f39 100644 --- a/include/power.h +++ b/include/power.h @@ -109,7 +109,7 @@ void _sys_soc_resume(void); * @retval SYS_PM_LOW_POWER_STATE If CPU low power state was entered. * @retval SYS_PM_DEEP_SLEEP If SOC low power state was entered. */ -extern int _sys_soc_suspend(int32_t ticks); +extern int _sys_soc_suspend(s32_t ticks); /** * @} diff --git a/include/pwm.h b/include/pwm.h index b4dfdb9bb87..f38f643cb22 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -37,7 +37,7 @@ extern "C" { * See @a pwm_pin_configure() for argument description */ typedef int (*pwm_config_t)(struct device *dev, int access_op, - uint32_t pwm, int flags); + u32_t pwm, int flags); /** * @typedef pwm_set_values_t @@ -45,7 +45,7 @@ typedef int (*pwm_config_t)(struct device *dev, int access_op, * See @a pwm_pin_set_values() for argument description */ typedef int (*pwm_set_values_t)(struct device *dev, int access_op, - uint32_t pwm, uint32_t on, uint32_t off); + u32_t pwm, u32_t on, u32_t off); /** * @typedef pwm_set_duty_cycle_t @@ -53,7 +53,7 @@ typedef int (*pwm_set_values_t)(struct device *dev, int access_op, * See @a pwm_pin_set_duty_cycle() for argument description */ typedef int (*pwm_set_duty_cycle_t)(struct device *dev, int access_op, - uint32_t pwm, uint8_t duty); + u32_t pwm, u8_t duty); /** * @typedef pwm_set_phase_t @@ -61,7 +61,7 @@ typedef int (*pwm_set_duty_cycle_t)(struct device *dev, int access_op, * See @a pwm_pin_set_phase() for argument description */ typedef int (*pwm_set_phase_t)(struct device *dev, int access_op, - uint32_t pwm, uint8_t phase); + u32_t pwm, u8_t phase); /** * @typedef pwm_set_period_t @@ -69,23 +69,23 @@ typedef int (*pwm_set_phase_t)(struct device *dev, int access_op, * See @a pwm_pin_set_period() for argument description */ typedef int (*pwm_set_period_t)(struct device *dev, int access_op, - uint32_t pwm, uint32_t period); + u32_t pwm, u32_t period); /** * @typedef pwm_pin_set_t * @brief Callback API upon setting the pin * See @a pwm_pin_set_cycles() for argument description */ -typedef int (*pwm_pin_set_t)(struct device *dev, uint32_t pwm, - uint32_t period_cycles, uint32_t pulse_cycles); +typedef int (*pwm_pin_set_t)(struct device *dev, u32_t pwm, + u32_t period_cycles, u32_t pulse_cycles); /** * @typedef pwm_get_cycles_per_sec_t * @brief Callback API upon getting cycles per second * See @a pwm_get_cycles_per_sec() for argument description */ -typedef int (*pwm_get_cycles_per_sec_t)(struct device *dev, uint32_t pwm, - uint64_t *cycles); +typedef int (*pwm_get_cycles_per_sec_t)(struct device *dev, u32_t pwm, + u64_t *cycles); /** @brief PWM driver API definition. */ struct pwm_driver_api { @@ -109,8 +109,8 @@ struct pwm_driver_api { * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int pwm_pin_set_cycles(struct device *dev, uint32_t pwm, - uint32_t period, uint32_t pulse) +static inline int pwm_pin_set_cycles(struct device *dev, u32_t pwm, + u32_t period, u32_t pulse) { struct pwm_driver_api *api; @@ -129,11 +129,11 @@ static inline int pwm_pin_set_cycles(struct device *dev, uint32_t pwm, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int pwm_pin_set_usec(struct device *dev, uint32_t pwm, - uint32_t period, uint32_t pulse) +static inline int pwm_pin_set_usec(struct device *dev, u32_t pwm, + u32_t period, u32_t pulse) { struct pwm_driver_api *api; - uint64_t period_cycles, pulse_cycles, cycles_per_sec; + u64_t period_cycles, pulse_cycles, cycles_per_sec; api = (struct pwm_driver_api *)dev->driver_api; @@ -142,17 +142,17 @@ static inline int pwm_pin_set_usec(struct device *dev, uint32_t pwm, } period_cycles = (period * cycles_per_sec) / USEC_PER_SEC; - if (period_cycles >= ((uint64_t)1 << 32)) { + if (period_cycles >= ((u64_t)1 << 32)) { return -ENOTSUP; } pulse_cycles = (pulse * cycles_per_sec) / USEC_PER_SEC; - if (pulse_cycles >= ((uint64_t)1 << 32)) { + if (pulse_cycles >= ((u64_t)1 << 32)) { return -ENOTSUP; } - return api->pin_set(dev, pwm, (uint32_t)period_cycles, - (uint32_t)pulse_cycles); + return api->pin_set(dev, pwm, (u32_t)period_cycles, + (u32_t)pulse_cycles); } /** @@ -166,8 +166,8 @@ static inline int pwm_pin_set_usec(struct device *dev, uint32_t pwm, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int pwm_get_cycles_per_sec(struct device *dev, uint32_t pwm, - uint64_t *cycles) +static inline int pwm_get_cycles_per_sec(struct device *dev, u32_t pwm, + u64_t *cycles) { struct pwm_driver_api *api; @@ -188,7 +188,7 @@ static inline int pwm_get_cycles_per_sec(struct device *dev, uint32_t pwm, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_pin_configure(struct device *dev, - uint8_t pwm, int flags) + u8_t pwm, int flags) { const struct pwm_driver_api *api = dev->driver_api; @@ -212,8 +212,8 @@ static inline int __deprecated pwm_pin_configure(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_pin_set_values(struct device *dev, - uint32_t pwm, uint32_t on, - uint32_t off) + u32_t pwm, u32_t on, + u32_t off) { const struct pwm_driver_api *api = dev->driver_api; @@ -237,8 +237,8 @@ static inline int __deprecated pwm_pin_set_values(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_pin_set_period(struct device *dev, - uint32_t pwm, - uint32_t period) + u32_t pwm, + u32_t period) { const struct pwm_driver_api *api = dev->driver_api; @@ -262,8 +262,8 @@ static inline int __deprecated pwm_pin_set_period(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_pin_set_duty_cycle(struct device *dev, - uint32_t pwm, - uint8_t duty) + u32_t pwm, + u8_t duty) { const struct pwm_driver_api *api = dev->driver_api; @@ -286,7 +286,7 @@ static inline int __deprecated pwm_pin_set_duty_cycle(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_pin_set_phase(struct device *dev, - uint32_t pwm, uint8_t phase) + u32_t pwm, u8_t phase) { const struct pwm_driver_api *api = dev->driver_api; @@ -332,7 +332,7 @@ static inline int __deprecated pwm_all_configure(struct device *dev, int flags) * @retval Negative errno code if failure. */ static inline int __deprecated pwm_all_set_values(struct device *dev, - uint32_t on, uint32_t off) + u32_t on, u32_t off) { const struct pwm_driver_api *api = dev->driver_api; @@ -356,7 +356,7 @@ static inline int __deprecated pwm_all_set_values(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_all_period(struct device *dev, - uint32_t period) + u32_t period) { const struct pwm_driver_api *api = dev->driver_api; @@ -380,7 +380,7 @@ static inline int __deprecated pwm_all_period(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_all_set_duty_cycle(struct device *dev, - uint8_t duty) + u8_t duty) { const struct pwm_driver_api *api = dev->driver_api; @@ -402,7 +402,7 @@ static inline int __deprecated pwm_all_set_duty_cycle(struct device *dev, * @retval Negative errno code if failure. */ static inline int __deprecated pwm_all_set_phase(struct device *dev, - uint8_t phase) + u8_t phase) { const struct pwm_driver_api *api = dev->driver_api; diff --git a/include/random.h b/include/random.h index 62f17bf520e..6547587d362 100644 --- a/include/random.h +++ b/include/random.h @@ -33,8 +33,8 @@ extern "C" { * See random_get_entropy() for argument description */ typedef int (*random_get_entropy_t)(struct device *dev, - uint8_t *buffer, - uint16_t length); + u8_t *buffer, + u16_t length); struct random_driver_api { random_get_entropy_t get_entropy; @@ -52,8 +52,8 @@ struct random_driver_api { * @retval -ERRNO errno code on error. */ static inline int random_get_entropy(struct device *dev, - uint8_t *buffer, - uint16_t length) + u8_t *buffer, + u16_t length) { const struct random_driver_api *api = dev->driver_api; diff --git a/include/rtc.h b/include/rtc.h index 74ef2146042..9624e275b9d 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -50,11 +50,11 @@ enum clk_rtc_div { struct rtc_config { - uint32_t init_val; + u32_t init_val; /*!< enable/disable alarm */ - uint8_t alarm_enable; + u8_t alarm_enable; /*!< initial configuration value for the 32bit RTC alarm value */ - uint32_t alarm_val; + u32_t alarm_val; /*!< Pointer to function to call when alarm value * matches current RTC value */ void (*cb_fn)(struct device *dev); @@ -65,9 +65,9 @@ typedef void (*rtc_api_disable)(struct device *dev); typedef int (*rtc_api_set_config)(struct device *dev, struct rtc_config *config); typedef int (*rtc_api_set_alarm)(struct device *dev, - const uint32_t alarm_val); -typedef uint32_t (*rtc_api_read)(struct device *dev); -typedef uint32_t (*rtc_api_get_pending_int)(struct device *dev); + const u32_t alarm_val); +typedef u32_t (*rtc_api_read)(struct device *dev); +typedef u32_t (*rtc_api_get_pending_int)(struct device *dev); struct rtc_driver_api { rtc_api_enable enable; @@ -78,7 +78,7 @@ struct rtc_driver_api { rtc_api_get_pending_int get_pending_int; }; -static inline uint32_t rtc_read(struct device *dev) +static inline u32_t rtc_read(struct device *dev) { const struct rtc_driver_api *api = dev->driver_api; @@ -109,7 +109,7 @@ static inline int rtc_set_config(struct device *dev, } static inline int rtc_set_alarm(struct device *dev, - const uint32_t alarm_val) + const u32_t alarm_val) { const struct rtc_driver_api *api = dev->driver_api; diff --git a/include/sensor.h b/include/sensor.h index 32d3c4b70c8..31da0b30eb5 100644 --- a/include/sensor.h +++ b/include/sensor.h @@ -35,9 +35,9 @@ extern "C" { */ struct sensor_value { /** Integer part of the value. */ - int32_t val1; + s32_t val1; /** Fractional part of the value. */ - int32_t val2; + s32_t val2; }; /** @@ -403,9 +403,9 @@ static inline int sensor_channel_get(struct device *dev, * * @return The converted value, in Gs. */ -static inline int32_t sensor_ms2_to_g(const struct sensor_value *ms2) +static inline s32_t sensor_ms2_to_g(const struct sensor_value *ms2) { - int64_t micro_ms2 = ms2->val1 * 1000000LL + ms2->val2; + s64_t micro_ms2 = ms2->val1 * 1000000LL + ms2->val2; if (micro_ms2 > 0) { return (micro_ms2 + SENSOR_G / 2) / SENSOR_G; @@ -420,10 +420,10 @@ static inline int32_t sensor_ms2_to_g(const struct sensor_value *ms2) * @param g The G value to be converted. * @param ms2 A pointer to a sensor_value struct, where the result is stored. */ -static inline void sensor_g_to_ms2(int32_t g, struct sensor_value *ms2) +static inline void sensor_g_to_ms2(s32_t g, struct sensor_value *ms2) { - ms2->val1 = ((int64_t)g * SENSOR_G) / 1000000LL; - ms2->val2 = ((int64_t)g * SENSOR_G) % 1000000LL; + ms2->val1 = ((s64_t)g * SENSOR_G) / 1000000LL; + ms2->val2 = ((s64_t)g * SENSOR_G) % 1000000LL; } /** @@ -433,9 +433,9 @@ static inline void sensor_g_to_ms2(int32_t g, struct sensor_value *ms2) * * @return The converted value, in degrees. */ -static inline int32_t sensor_rad_to_degrees(const struct sensor_value *rad) +static inline s32_t sensor_rad_to_degrees(const struct sensor_value *rad) { - int64_t micro_rad_s = rad->val1 * 1000000LL + rad->val2; + s64_t micro_rad_s = rad->val1 * 1000000LL + rad->val2; if (micro_rad_s > 0) { return (micro_rad_s * 180LL + SENSOR_PI / 2) / SENSOR_PI; @@ -450,10 +450,10 @@ static inline int32_t sensor_rad_to_degrees(const struct sensor_value *rad) * @param d The value (in degrees) to be converted. * @param rad A pointer to a sensor_value struct, where the result is stored. */ -static inline void sensor_degrees_to_rad(int32_t d, struct sensor_value *rad) +static inline void sensor_degrees_to_rad(s32_t d, struct sensor_value *rad) { - rad->val1 = ((int64_t)d * SENSOR_PI / 180LL) / 1000000LL; - rad->val2 = ((int64_t)d * SENSOR_PI / 180LL) % 1000000LL; + rad->val1 = ((s64_t)d * SENSOR_PI / 180LL) / 1000000LL; + rad->val2 = ((s64_t)d * SENSOR_PI / 180LL) % 1000000LL; } /** diff --git a/include/shared_irq.h b/include/shared_irq.h index e8ae0080f25..e5ee2211af5 100644 --- a/include/shared_irq.h +++ b/include/shared_irq.h @@ -35,15 +35,15 @@ extern int shared_irq_initialize(struct device *port); typedef void (*shared_irq_config_irq_t)(void); struct shared_irq_config { - uint32_t irq_num; + u32_t irq_num; shared_irq_config_irq_t config; - uint32_t client_count; + u32_t client_count; }; struct shared_irq_client { struct device *isr_dev; isr_t isr_func; - uint32_t enabled; + u32_t enabled; }; struct shared_irq_runtime { diff --git a/include/spi.h b/include/spi.h index 3a154239ed2..041cd6edf48 100644 --- a/include/spi.h +++ b/include/spi.h @@ -62,8 +62,8 @@ extern "C" { * spi controller. */ struct spi_config { - uint32_t config; - uint32_t max_sys_freq; + u32_t config; + u32_t max_sys_freq; }; /** @@ -78,15 +78,15 @@ typedef int (*spi_api_configure)(struct device *dev, * @brief Callback API upon selecting a slave * See spi_slave_select() for argument description */ -typedef int (*spi_api_slave_select)(struct device *dev, uint32_t slave); +typedef int (*spi_api_slave_select)(struct device *dev, u32_t slave); /** * @typedef spi_api_io * @brief Callback API for I/O * See spi_read() and spi_write() for argument descriptions */ typedef int (*spi_api_io)(struct device *dev, - const void *tx_buf, uint32_t tx_buf_len, - void *rx_buf, uint32_t rx_buf_len); + const void *tx_buf, u32_t tx_buf_len, + void *rx_buf, u32_t rx_buf_len); struct spi_driver_api { spi_api_configure configure; @@ -125,7 +125,7 @@ static inline int spi_configure(struct device *dev, * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int spi_slave_select(struct device *dev, uint32_t slave) +static inline int spi_slave_select(struct device *dev, u32_t slave) { const struct spi_driver_api *api = dev->driver_api; @@ -145,7 +145,7 @@ static inline int spi_slave_select(struct device *dev, uint32_t slave) * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int spi_read(struct device *dev, void *buf, uint32_t len) +static inline int spi_read(struct device *dev, void *buf, u32_t len) { const struct spi_driver_api *api = dev->driver_api; @@ -161,7 +161,7 @@ static inline int spi_read(struct device *dev, void *buf, uint32_t len) * @retval 0 If successful. * @retval Negative errno code if failure. */ -static inline int spi_write(struct device *dev, const void *buf, uint32_t len) +static inline int spi_write(struct device *dev, const void *buf, u32_t len) { const struct spi_driver_api *api = dev->driver_api; @@ -184,8 +184,8 @@ static inline int spi_write(struct device *dev, const void *buf, uint32_t len) * @retval Negative errno code if failure. */ static inline int spi_transceive(struct device *dev, - const void *tx_buf, uint32_t tx_buf_len, - void *rx_buf, uint32_t rx_buf_len) + const void *tx_buf, u32_t tx_buf_len, + void *rx_buf, u32_t rx_buf_len) { const struct spi_driver_api *api = dev->driver_api; diff --git a/include/sw_isr_table.h b/include/sw_isr_table.h index bf91db8d50a..cedc8002061 100644 --- a/include/sw_isr_table.h +++ b/include/sw_isr_table.h @@ -48,9 +48,9 @@ extern struct _isr_table_entry _sw_isr_table[]; */ struct _isr_list { /** IRQ line number */ - int32_t irq; + s32_t irq; /** Flags for this IRQ, see ISR_FLAG_* definitions */ - int32_t flags; + s32_t flags; /** ISR to call */ void *func; /** Parameter for non-direct IRQs */ diff --git a/include/sys_clock.h b/include/sys_clock.h index 2e15e9a8eaf..e259f7a271b 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -68,7 +68,7 @@ extern int sys_clock_hw_cycles_per_tick; /* SYS_CLOCK_HW_CYCLES_TO_NS64 converts CPU clock cycles to nanoseconds */ #define SYS_CLOCK_HW_CYCLES_TO_NS64(X) \ - (((uint64_t)(X) * sys_clock_us_per_tick * NSEC_PER_USEC) / \ + (((u64_t)(X) * sys_clock_us_per_tick * NSEC_PER_USEC) / \ sys_clock_hw_cycles_per_tick) /* @@ -76,7 +76,7 @@ extern int sys_clock_hw_cycles_per_tick; * and calculates the average cycle time */ #define SYS_CLOCK_HW_CYCLES_TO_NS_AVG(X, NCYCLES) \ - (uint32_t)(SYS_CLOCK_HW_CYCLES_TO_NS64(X) / NCYCLES) + (u32_t)(SYS_CLOCK_HW_CYCLES_TO_NS64(X) / NCYCLES) /** * @defgroup clock_apis Kernel Clock APIs @@ -94,13 +94,13 @@ extern int sys_clock_hw_cycles_per_tick; * * @return Duration in nanoseconds. */ -#define SYS_CLOCK_HW_CYCLES_TO_NS(X) (uint32_t)(SYS_CLOCK_HW_CYCLES_TO_NS64(X)) +#define SYS_CLOCK_HW_CYCLES_TO_NS(X) (u32_t)(SYS_CLOCK_HW_CYCLES_TO_NS64(X)) /** * @} end defgroup clock_apis */ -extern int64_t _sys_clock_tick_count; +extern s64_t _sys_clock_tick_count; /* * Number of ticks for x seconds. NOTE: With MSEC() or USEC(), diff --git a/include/sys_io.h b/include/sys_io.h index bfb6f3680fd..b9b0e469a46 100644 --- a/include/sys_io.h +++ b/include/sys_io.h @@ -17,14 +17,14 @@ extern "C" { #include #include -typedef uint32_t io_port_t; -typedef uint32_t mm_reg_t; -typedef uint32_t mem_addr_t; +typedef u32_t io_port_t; +typedef u32_t mm_reg_t; +typedef u32_t mem_addr_t; /* Port I/O functions */ /** - * @fn static inline void sys_out8(uint8_t data, io_port_t port); + * @fn static inline void sys_out8(u8_t data, io_port_t port); * @brief Output a byte to an I/O port * * This function writes a byte to the given port. @@ -34,7 +34,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline uint8_t sys_in8(io_port_t port); + * @fn static inline u8_t sys_in8(io_port_t port); * @brief Input a byte from an I/O port * * This function reads a byte from the port. @@ -45,7 +45,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline void sys_out16(uint16_t data, io_port_t port); + * @fn static inline void sys_out16(u16_t data, io_port_t port); * @brief Output a 16 bits to an I/O port * * This function writes a 16 bits to the given port. @@ -55,7 +55,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline uint16_t sys_in16(io_port_t port); + * @fn static inline u16_t sys_in16(io_port_t port); * @brief Input 16 bits from an I/O port * * This function reads 16 bits from the port. @@ -66,7 +66,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline void sys_out32(uint32_t data, io_port_t port); + * @fn static inline void sys_out32(u32_t data, io_port_t port); * @brief Output 32 bits to an I/O port * * This function writes 32 bits to the given port. @@ -76,7 +76,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline uint32_t sys_in32(io_port_t port); + * @fn static inline u32_t sys_in32(io_port_t port); * @brief Input 32 bits from an I/O port * * This function reads 32 bits from the port. @@ -148,7 +148,7 @@ typedef uint32_t mem_addr_t; /* Memory mapped registers I/O functions */ /** - * @fn static inline void sys_write8(uint8_t data, mm_reg_t addr); + * @fn static inline void sys_write8(u8_t data, mm_reg_t addr); * @brief Write a byte to a memory mapped register * * This function writes a byte to the given memory mapped register. @@ -158,7 +158,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline uint8_t sys_read8(mm_reg_t addr); + * @fn static inline u8_t sys_read8(mm_reg_t addr); * @brief Read a byte from a memory mapped register * * This function reads a byte from the given memory mapped register. @@ -169,7 +169,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline void sys_write16(uint16_t data, mm_reg_t addr); + * @fn static inline void sys_write16(u16_t data, mm_reg_t addr); * @brief Write 16 bits to a memory mapped register * * This function writes 16 bits to the given memory mapped register. @@ -179,7 +179,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline uint16_t sys_read16(mm_reg_t addr); + * @fn static inline u16_t sys_read16(mm_reg_t addr); * @brief Read 16 bits from a memory mapped register * * This function reads 16 bits from the given memory mapped register. @@ -191,7 +191,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline void sys_write32(uint32_t data, mm_reg_t addr); + * @fn static inline void sys_write32(u32_t data, mm_reg_t addr); * @brief Write 32 bits to a memory mapped register * * This function writes 32 bits to the given memory mapped register. @@ -201,7 +201,7 @@ typedef uint32_t mem_addr_t; */ /** - * @fn static inline uint32_t sys_read32(mm_reg_t addr); + * @fn static inline u32_t sys_read32(mm_reg_t addr); * @brief Read 32 bits from a memory mapped register * * This function reads 32 bits from the given memory mapped register. diff --git a/include/uart.h b/include/uart.h index b3960c45d36..129941f19c7 100644 --- a/include/uart.h +++ b/include/uart.h @@ -90,12 +90,12 @@ typedef void (*uart_irq_config_func_t)(struct device *port); */ struct uart_device_config { union { - uint32_t port; - uint8_t *base; - uint32_t regs; + u32_t port; + u8_t *base; + u32_t regs; }; - uint32_t sys_clk_freq; + u32_t sys_clk_freq; #ifdef CONFIG_PCI struct pci_dev_info pci_dev; @@ -118,10 +118,10 @@ struct uart_driver_api { #ifdef CONFIG_UART_INTERRUPT_DRIVEN /** Interrupt driven FIFO fill function */ - int (*fifo_fill)(struct device *dev, const uint8_t *tx_data, int len); + int (*fifo_fill)(struct device *dev, const u8_t *tx_data, int len); /** Interrupt driven FIFO read function */ - int (*fifo_read)(struct device *dev, uint8_t *rx_data, const int size); + int (*fifo_read)(struct device *dev, u8_t *rx_data, const int size); /** Interrupt driven transfer enabling function */ void (*irq_tx_enable)(struct device *dev); @@ -162,12 +162,12 @@ struct uart_driver_api { #endif #ifdef CONFIG_UART_LINE_CTRL - int (*line_ctrl_set)(struct device *dev, uint32_t ctrl, uint32_t val); - int (*line_ctrl_get)(struct device *dev, uint32_t ctrl, uint32_t *val); + int (*line_ctrl_set)(struct device *dev, u32_t ctrl, u32_t val); + int (*line_ctrl_get)(struct device *dev, u32_t ctrl, u32_t *val); #endif #ifdef CONFIG_UART_DRV_CMD - int (*drv_cmd)(struct device *dev, uint32_t cmd, uint32_t p); + int (*drv_cmd)(struct device *dev, u32_t cmd, u32_t p); #endif }; @@ -247,7 +247,7 @@ static inline unsigned char uart_poll_out(struct device *dev, * * @return Number of bytes sent. */ -static inline int uart_fifo_fill(struct device *dev, const uint8_t *tx_data, +static inline int uart_fifo_fill(struct device *dev, const u8_t *tx_data, int size) { const struct uart_driver_api *api = dev->driver_api; @@ -268,7 +268,7 @@ static inline int uart_fifo_fill(struct device *dev, const uint8_t *tx_data, * * @return Number of bytes read. */ -static inline int uart_fifo_read(struct device *dev, uint8_t *rx_data, +static inline int uart_fifo_read(struct device *dev, u8_t *rx_data, const int size) { const struct uart_driver_api *api = dev->driver_api; @@ -506,7 +506,7 @@ static inline void uart_irq_callback_set(struct device *dev, * @retval failed Otherwise. */ static inline int uart_line_ctrl_set(struct device *dev, - uint32_t ctrl, uint32_t val) + u32_t ctrl, u32_t val) { const struct uart_driver_api *api = dev->driver_api; @@ -528,7 +528,7 @@ static inline int uart_line_ctrl_set(struct device *dev, * @retval failed Otherwise. */ static inline int uart_line_ctrl_get(struct device *dev, - uint32_t ctrl, uint32_t *val) + u32_t ctrl, u32_t *val) { const struct uart_driver_api *api = dev->driver_api; @@ -556,7 +556,7 @@ static inline int uart_line_ctrl_get(struct device *dev, * @retval 0 If successful. * @retval failed Otherwise. */ -static inline int uart_drv_cmd(struct device *dev, uint32_t cmd, uint32_t p) +static inline int uart_drv_cmd(struct device *dev, u32_t cmd, u32_t p) { const struct uart_driver_api *api = dev->driver_api; diff --git a/include/usb/usb_device.h b/include/usb/usb_device.h index 669bceca1df..e05d6a8d32f 100644 --- a/include/usb/usb_device.h +++ b/include/usb/usb_device.h @@ -51,11 +51,11 @@ /** setup packet definitions */ struct usb_setup_packet { - uint8_t bmRequestType; /**< characteristics of the specific request */ - uint8_t bRequest; /**< specific request */ - uint16_t wValue; /**< request specific parameter */ - uint16_t wIndex; /**< request specific parameter */ - uint16_t wLength; /**< length of data transferred in data phase */ + u8_t bmRequestType; /**< characteristics of the specific request */ + u8_t bRequest; /**< specific request */ + u16_t wValue; /**< request specific parameter */ + u16_t wIndex; /**< request specific parameter */ + u16_t wLength; /**< length of data transferred in data phase */ }; /** @@ -66,7 +66,7 @@ typedef void (*usb_status_callback)(enum usb_dc_status_code status_code); /** * Callback function signature for the USB Endpoint status */ -typedef void (*usb_ep_callback)(uint8_t ep, +typedef void (*usb_ep_callback)(u8_t ep, enum usb_dc_ep_cb_status_code cb_status); /** @@ -74,7 +74,7 @@ typedef void (*usb_ep_callback)(uint8_t ep, * interface number specified in the device descriptor table */ typedef int (*usb_request_handler) (struct usb_setup_packet *detup, - int32_t *transfer_len, uint8_t **payload_data); + s32_t *transfer_len, u8_t **payload_data); /* * USB Endpoint Configuration @@ -92,7 +92,7 @@ struct usb_ep_cfg_data { * IN EP = 0x80 | \ * OUT EP = 0x00 | \ */ - uint8_t ep_addr; + u8_t ep_addr; }; /** @@ -116,12 +116,12 @@ struct usb_interface_cfg_data { * command set. This data area may be used for USB IN or OUT * communications */ - uint8_t *payload_data; + u8_t *payload_data; /** * This data area, allocated by the application, is used to store * Vendor specific payload */ - uint8_t *vendor_data; + u8_t *vendor_data; }; /* @@ -137,13 +137,13 @@ struct usb_cfg_data { * USB device description, see * http://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors */ - const uint8_t *usb_device_description; + const u8_t *usb_device_description; /** Callback to be notified on USB connection status change */ usb_status_callback cb_usb_status; /** USB interface (Class) handler and storage space */ struct usb_interface_cfg_data interface; /** Number of individual endpoints in the device configuration */ - uint8_t num_endpoints; + u8_t num_endpoints; /** * Pointer to an array of endpoint structs of length equal to the * number of EP associated with the device description, @@ -210,8 +210,8 @@ int usb_disable(void); * * @return 0 on success, negative errno code on fail */ -int usb_write(uint8_t ep, const uint8_t *data, uint32_t data_len, - uint32_t *bytes_ret); +int usb_write(u8_t ep, const u8_t *data, u32_t data_len, + u32_t *bytes_ret); /* * @brief read data from the specified endpoint @@ -230,8 +230,8 @@ int usb_write(uint8_t ep, const uint8_t *data, uint32_t data_len, * * @return 0 on success, negative errno code on fail */ -int usb_read(uint8_t ep, uint8_t *data, uint32_t max_data_len, - uint32_t *ret_bytes); +int usb_read(u8_t ep, u8_t *data, u32_t max_data_len, + u32_t *ret_bytes); /* * @brief set STALL condition on the specified endpoint @@ -244,7 +244,7 @@ int usb_read(uint8_t ep, uint8_t *data, uint32_t max_data_len, * * @return 0 on success, negative errno code on fail */ -int usb_ep_set_stall(uint8_t ep); +int usb_ep_set_stall(u8_t ep); /* @@ -258,7 +258,7 @@ int usb_ep_set_stall(uint8_t ep); * * @return 0 on success, negative errno code on fail */ -int usb_ep_clear_stall(uint8_t ep); +int usb_ep_clear_stall(u8_t ep); /** * @brief read data from the specified endpoint @@ -278,8 +278,8 @@ int usb_ep_clear_stall(uint8_t ep); * * @return 0 on success, negative errno code on fail. */ -int usb_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len, - uint32_t *read_bytes); +int usb_ep_read_wait(u8_t ep, u8_t *data, u32_t max_data_len, + u32_t *read_bytes); /** @@ -295,6 +295,6 @@ int usb_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len, * * @return 0 on success, negative errno code on fail. */ -int usb_ep_read_continue(uint8_t ep); +int usb_ep_read_continue(u8_t ep); #endif /* USB_DEVICE_H_ */ diff --git a/include/usb/usbstruct.h b/include/usb/usbstruct.h index 229065a2a11..de1fdb83fde 100644 --- a/include/usb/usbstruct.h +++ b/include/usb/usbstruct.h @@ -85,8 +85,8 @@ /** USB descriptor header */ struct usb_desc_header { - uint8_t bLength; /**< descriptor length */ - uint8_t bDescriptorType; /**< descriptor type */ + u8_t bLength; /**< descriptor length */ + u8_t bDescriptorType; /**< descriptor type */ }; #define DESC_DEVICE 1 diff --git a/include/watchdog.h b/include/watchdog.h index 8cc717e5b67..b2d8e906f0c 100644 --- a/include/watchdog.h +++ b/include/watchdog.h @@ -51,7 +51,7 @@ enum wdt_clock_timeout_cycles { * WDT configuration struct. */ struct wdt_config { - uint32_t timeout; + u32_t timeout; enum wdt_mode mode; void (*interrupt_fn)(struct device *dev); }; diff --git a/kernel/alert.c b/kernel/alert.c index 508d714ec92..375e7cd673a 100644 --- a/kernel/alert.c +++ b/kernel/alert.c @@ -88,7 +88,7 @@ void k_alert_send(struct k_alert *alert) } } -int k_alert_recv(struct k_alert *alert, int32_t timeout) +int k_alert_recv(struct k_alert *alert, s32_t timeout) { return k_sem_take(&alert->sem, timeout); } diff --git a/kernel/device.c b/kernel/device.c index bfec736a995..823d0126996 100644 --- a/kernel/device.c +++ b/kernel/device.c @@ -27,8 +27,8 @@ static struct device *config_levels[] = { }; #ifdef CONFIG_DEVICE_POWER_MANAGEMENT -extern uint32_t __device_busy_start[]; -extern uint32_t __device_busy_end[]; +extern u32_t __device_busy_start[]; +extern u32_t __device_busy_end[]; #define DEVICE_BUSY_SIZE (__device_busy_end - __device_busy_start) #endif @@ -70,7 +70,7 @@ struct device *device_get_binding(const char *name) #ifdef CONFIG_DEVICE_POWER_MANAGEMENT int device_pm_control_nop(struct device *unused_device, - uint32_t unused_ctrl_command, void *unused_context) + u32_t unused_ctrl_command, void *unused_context) { return 0; } diff --git a/kernel/idle.c b/kernel/idle.c index c3eb2910dc7..b6e7d8f18b0 100644 --- a/kernel/idle.c +++ b/kernel/idle.c @@ -17,7 +17,7 @@ * Idle time must be this value or higher for timer to go into tickless idle * state. */ -int32_t _sys_idle_threshold_ticks = CONFIG_TICKLESS_IDLE_THRESH; +s32_t _sys_idle_threshold_ticks = CONFIG_TICKLESS_IDLE_THRESH; #endif /* CONFIG_TICKLESS_IDLE */ #ifdef CONFIG_SYS_POWER_MANAGEMENT @@ -46,7 +46,7 @@ void __attribute__((weak)) _sys_soc_resume_from_deep_sleep(void) * * @return N/A */ -static void set_kernel_idle_time_in_ticks(int32_t ticks) +static void set_kernel_idle_time_in_ticks(s32_t ticks) { _kernel.idle = ticks; } @@ -54,7 +54,7 @@ static void set_kernel_idle_time_in_ticks(int32_t ticks) #define set_kernel_idle_time_in_ticks(x) do { } while (0) #endif -static void _sys_power_save_idle(int32_t ticks __unused) +static void _sys_power_save_idle(s32_t ticks __unused) { #if defined(CONFIG_TICKLESS_IDLE) if ((ticks == K_FOREVER) || ticks >= _sys_idle_threshold_ticks) { @@ -95,7 +95,7 @@ static void _sys_power_save_idle(int32_t ticks __unused) #endif } -void _sys_power_save_idle_exit(int32_t ticks) +void _sys_power_save_idle_exit(s32_t ticks) { #if defined(CONFIG_SYS_POWER_LOW_POWER_STATE) /* Some CPU low power states require notification at the ISR @@ -135,7 +135,7 @@ void idle(void *unused1, void *unused2, void *unused3) #ifdef CONFIG_BOOT_TIME_MEASUREMENT /* record timestamp when idling begins */ - extern uint64_t __idle_tsc; + extern u64_t __idle_tsc; __idle_tsc = _tsc_read(); #endif diff --git a/kernel/include/kernel_structs.h b/kernel/include/kernel_structs.h index 9fdb28e4fca..9f18f365a3c 100644 --- a/kernel/include/kernel_structs.h +++ b/kernel/include/kernel_structs.h @@ -71,10 +71,10 @@ struct _thread_base { sys_dnode_t k_q_node; /* user facing 'thread options'; values defined in include/kernel.h */ - uint8_t user_options; + u8_t user_options; /* thread state */ - uint8_t thread_state; + u8_t thread_state; /* * scheduler lock count and thread priority @@ -93,14 +93,14 @@ struct _thread_base { union { struct { #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ - uint8_t sched_locked; - int8_t prio; + u8_t sched_locked; + s8_t prio; #else /* LITTLE and PDP */ - int8_t prio; - uint8_t sched_locked; + s8_t prio; + u8_t sched_locked; #endif }; - uint16_t preempt; + u16_t preempt; }; /* data returned by APIs */ @@ -159,7 +159,7 @@ struct _ready_q { struct k_thread *cache; /* bitmap of priorities that contain at least one ready thread */ - uint32_t prio_bmap[K_NUM_PRIO_BITMAPS]; + u32_t prio_bmap[K_NUM_PRIO_BITMAPS]; /* ready queues, one per priority */ sys_dlist_t q[K_NUM_PRIORITIES]; @@ -170,7 +170,7 @@ typedef struct _ready_q _ready_q_t; struct _kernel { /* nested interrupt count */ - uint32_t nested; + u32_t nested; /* interrupt stack pointer base */ char *irq_stack; @@ -184,7 +184,7 @@ struct _kernel { #endif #ifdef CONFIG_SYS_POWER_MANAGEMENT - int32_t idle; /* Number of ticks for kernel idling */ + s32_t idle; /* Number of ticks for kernel idling */ #endif /* @@ -236,7 +236,7 @@ _set_thread_return_value_with_data(struct k_thread *thread, } extern void _init_thread_base(struct _thread_base *thread_base, - int priority, uint32_t initial_state, + int priority, u32_t initial_state, unsigned int options); #endif /* _ASMLANGUAGE */ diff --git a/kernel/include/ksched.h b/kernel/include/ksched.h index 3a5bb9cc539..e40f0d20da4 100644 --- a/kernel/include/ksched.h +++ b/kernel/include/ksched.h @@ -17,12 +17,12 @@ extern void _remove_thread_from_ready_q(struct k_thread *thread); extern void _reschedule_threads(int key); extern void k_sched_unlock(void); extern void _pend_thread(struct k_thread *thread, - _wait_q_t *wait_q, int32_t timeout); -extern void _pend_current_thread(_wait_q_t *wait_q, int32_t timeout); + _wait_q_t *wait_q, s32_t timeout); +extern void _pend_current_thread(_wait_q_t *wait_q, s32_t timeout); extern void _move_thread_to_end_of_prio_q(struct k_thread *thread); extern int __must_switch_threads(void); #ifdef _NON_OPTIMIZED_TICKS_PER_SEC -extern int32_t _ms_to_ticks(int32_t ms); +extern s32_t _ms_to_ticks(s32_t ms); #endif extern void idle(void *, void *, void *); @@ -191,7 +191,7 @@ static inline int _get_ready_q_q_index(int prio) static inline int _get_highest_ready_prio(void) { int bitmap = 0; - uint32_t ready_range; + u32_t ready_range; #if (K_NUM_PRIORITIES <= 32) ready_range = _ready_q.prio_bmap[0]; @@ -264,18 +264,18 @@ static ALWAYS_INLINE void _sched_unlock_no_reschedule(void) #endif } -static inline void _set_thread_states(struct k_thread *thread, uint32_t states) +static inline void _set_thread_states(struct k_thread *thread, u32_t states) { thread->base.thread_state |= states; } static inline void _reset_thread_states(struct k_thread *thread, - uint32_t states) + u32_t states) { thread->base.thread_state &= ~states; } -static inline int _is_thread_state_set(struct k_thread *thread, uint32_t state) +static inline int _is_thread_state_set(struct k_thread *thread, u32_t state) { return !!(thread->base.thread_state & state); } @@ -318,7 +318,7 @@ static inline int _has_thread_started(struct k_thread *thread) static inline int _is_thread_prevented_from_running(struct k_thread *thread) { - uint8_t state = thread->base.thread_state; + u8_t state = thread->base.thread_state; return state & (_THREAD_PENDING | _THREAD_PRESTART | _THREAD_DEAD | _THREAD_DUMMY | _THREAD_SUSPENDED); diff --git a/kernel/include/timeout_q.h b/kernel/include/timeout_q.h index 959ab43d41d..f5d7aaa6088 100644 --- a/kernel/include/timeout_q.h +++ b/kernel/include/timeout_q.h @@ -194,7 +194,7 @@ static inline void _dump_timeout_q(void) static inline void _add_timeout(struct k_thread *thread, struct _timeout *timeout, _wait_q_t *wait_q, - int32_t timeout_in_ticks) + s32_t timeout_in_ticks) { __ASSERT(timeout_in_ticks > 0, ""); @@ -206,7 +206,7 @@ static inline void _add_timeout(struct k_thread *thread, _dump_timeout(timeout, 0); _dump_timeout_q(); - int32_t *delta = &timeout->delta_ticks_from_prev; + s32_t *delta = &timeout->delta_ticks_from_prev; struct _timeout *in_q; SYS_DLIST_FOR_EACH_CONTAINER(&_timeout_q, in_q, node) { @@ -238,14 +238,14 @@ inserted: static inline void _add_thread_timeout(struct k_thread *thread, _wait_q_t *wait_q, - int32_t timeout_in_ticks) + s32_t timeout_in_ticks) { _add_timeout(thread, &thread->base.timeout, wait_q, timeout_in_ticks); } /* find the closest deadline in the timeout queue */ -static inline int32_t _get_next_timeout_expiry(void) +static inline s32_t _get_next_timeout_expiry(void) { struct _timeout *t = (struct _timeout *) sys_dlist_peek_head(&_timeout_q); diff --git a/kernel/include/wait_q.h b/kernel/include/wait_q.h index 7a28aedd7e3..670f4f9b950 100644 --- a/kernel/include/wait_q.h +++ b/kernel/include/wait_q.h @@ -26,7 +26,7 @@ static ALWAYS_INLINE void _init_thread_timeout(struct _thread_base *thread_base) } static ALWAYS_INLINE void -_add_thread_timeout(struct k_thread *thread, _wait_q_t *wait_q, int32_t timeout) +_add_thread_timeout(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout) { ARG_UNUSED(thread); ARG_UNUSED(wait_q); diff --git a/kernel/init.c b/kernel/init.c index 09a4b7ed040..4037db246c3 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -51,9 +51,9 @@ const char * const build_timestamp = BUILD_TIMESTAMP; /* boot time measurement items */ #ifdef CONFIG_BOOT_TIME_MEASUREMENT -uint64_t __noinit __start_tsc; /* timestamp when kernel starts */ -uint64_t __noinit __main_tsc; /* timestamp when main task starts */ -uint64_t __noinit __idle_tsc; /* timestamp when CPU goes idle */ +u64_t __noinit __start_tsc; /* timestamp when kernel starts */ +u64_t __noinit __main_tsc; /* timestamp when main task starts */ +u64_t __noinit __idle_tsc; /* timestamp when CPU goes idle */ #endif /* init/main and idle threads */ @@ -133,7 +133,7 @@ void k_call_stacks_analyze(void) void _bss_zero(void) { memset(&__bss_start, 0, - ((uint32_t) &__bss_end - (uint32_t) &__bss_start)); + ((u32_t) &__bss_end - (u32_t) &__bss_start)); } @@ -149,7 +149,7 @@ void _bss_zero(void) void _data_copy(void) { memcpy(&__data_ram_start, &__data_rom_start, - ((uint32_t) &__data_ram_end - (uint32_t) &__data_ram_start)); + ((u32_t) &__data_ram_end - (u32_t) &__data_ram_start)); } #endif @@ -185,7 +185,7 @@ static void _main(void *unused1, void *unused2, void *unused3) #ifdef CONFIG_BOOT_TIME_MEASUREMENT /* record timestamp for kernel's _main() function */ - extern uint64_t __main_tsc; + extern u64_t __main_tsc; __main_tsc = _tsc_read(); #endif diff --git a/kernel/int_latency_bench.c b/kernel/int_latency_bench.c index eeb83246fd6..55e46c6b314 100644 --- a/kernel/int_latency_bench.c +++ b/kernel/int_latency_bench.c @@ -8,7 +8,7 @@ #include "toolchain.h" #include "sections.h" -#include /* uint32_t */ +#include /* u32_t */ #include /* ULONG_MAX */ #include /* printk */ #include @@ -20,25 +20,25 @@ * Timestamp corresponding to when interrupt were turned off. * A value of zero indicated interrupt are not currently locked. */ -static uint32_t int_locked_timestamp; +static u32_t int_locked_timestamp; /* stats tracking the minimum and maximum time when interrupts were locked */ -static uint32_t int_locked_latency_min = ULONG_MAX; -static uint32_t int_locked_latency_max; +static u32_t int_locked_latency_min = ULONG_MAX; +static u32_t int_locked_latency_max; /* overhead added to intLock/intUnlock by this latency benchmark */ -static uint32_t initial_start_delay; -static uint32_t nesting_delay; -static uint32_t stop_delay; +static u32_t initial_start_delay; +static u32_t nesting_delay; +static u32_t stop_delay; /* counter tracking intLock/intUnlock calls once interrupt are locked */ -static uint32_t int_lock_unlock_nest; +static u32_t int_lock_unlock_nest; /* indicate if the interrupt latency benchamrk is ready to be used */ -static uint32_t int_latency_bench_ready; +static u32_t int_latency_bench_ready; /* min amount of time it takes from HW interrupt generation to 'C' handler */ -uint32_t _hw_irq_to_c_handler_latency = ULONG_MAX; +u32_t _hw_irq_to_c_handler_latency = ULONG_MAX; /** * @@ -71,9 +71,9 @@ void _int_latency_start(void) */ void _int_latency_stop(void) { - uint32_t delta; - uint32_t delayOverhead; - uint32_t currentTime = k_cycle_get_32(); + u32_t delta; + u32_t delayOverhead; + u32_t currentTime = k_cycle_get_32(); /* ensured intLatencyStart() was invoked first */ if (int_locked_timestamp) { @@ -121,8 +121,8 @@ void _int_latency_stop(void) */ void int_latency_init(void) { - uint32_t timeToReadTime; - uint32_t cacheWarming = NB_CACHE_WARMING_DRY_RUN; + u32_t timeToReadTime; + u32_t cacheWarming = NB_CACHE_WARMING_DRY_RUN; int_latency_bench_ready = 1; @@ -174,7 +174,7 @@ void int_latency_init(void) */ void int_latency_show(void) { - uint32_t intHandlerLatency = 0; + u32_t intHandlerLatency = 0; if (!int_latency_bench_ready) { printk("error: int_latency_init() has not been invoked\n"); diff --git a/kernel/mailbox.c b/kernel/mailbox.c index 98b17896f90..8e2fecff7f5 100644 --- a/kernel/mailbox.c +++ b/kernel/mailbox.c @@ -36,13 +36,13 @@ K_STACK_DEFINE(async_msg_free, CONFIG_NUM_MBOX_ASYNC_MSGS); /* allocate an asynchronous message descriptor */ static inline void _mbox_async_alloc(struct k_mbox_async **async) { - k_stack_pop(&async_msg_free, (uint32_t *)async, K_FOREVER); + k_stack_pop(&async_msg_free, (u32_t *)async, K_FOREVER); } /* free an asynchronous message descriptor */ static inline void _mbox_async_free(struct k_mbox_async *async) { - k_stack_push(&async_msg_free, (uint32_t)async); + k_stack_push(&async_msg_free, (u32_t)async); } #endif /* CONFIG_NUM_MBOX_ASYNC_MSGS > 0 */ @@ -79,7 +79,7 @@ static int init_mbox_module(struct device *dev) for (i = 0; i < CONFIG_NUM_MBOX_ASYNC_MSGS; i++) { _init_thread_base(&async_msg[i].thread, 0, _THREAD_DUMMY, 0); - k_stack_push(&async_msg_free, (uint32_t)&async_msg[i]); + k_stack_push(&async_msg_free, (u32_t)&async_msg[i]); } #endif /* CONFIG_NUM_MBOX_ASYNC_MSGS > 0 */ @@ -122,7 +122,7 @@ void k_mbox_init(struct k_mbox *mbox_ptr) static int _mbox_message_match(struct k_mbox_msg *tx_msg, struct k_mbox_msg *rx_msg) { - uint32_t temp_info; + u32_t temp_info; if (((tx_msg->tx_target_thread == (k_tid_t)K_ANY) || (tx_msg->tx_target_thread == rx_msg->tx_target_thread)) && @@ -235,7 +235,7 @@ static void _mbox_message_dispose(struct k_mbox_msg *rx_msg) * @return 0 if successful, -ENOMSG if failed immediately, -EAGAIN if timed out */ static int _mbox_message_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, - int32_t timeout) + s32_t timeout) { struct k_thread *sending_thread; struct k_thread *receiving_thread; @@ -312,7 +312,7 @@ static int _mbox_message_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, return _Swap(key); } -int k_mbox_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, int32_t timeout) +int k_mbox_put(struct k_mbox *mbox, struct k_mbox_msg *tx_msg, s32_t timeout) { /* configure things for a synchronous send, then send the message */ tx_msg->_syncing_thread = _current; @@ -359,7 +359,7 @@ void k_mbox_data_get(struct k_mbox_msg *rx_msg, void *buffer) } int k_mbox_data_block_get(struct k_mbox_msg *rx_msg, struct k_mem_pool *pool, - struct k_mem_block *block, int32_t timeout) + struct k_mem_block *block, s32_t timeout) { int result; @@ -424,7 +424,7 @@ static int _mbox_message_data_check(struct k_mbox_msg *rx_msg, void *buffer) } int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *rx_msg, void *buffer, - int32_t timeout) + s32_t timeout) { struct k_thread *sending_thread; struct k_mbox_msg *tx_msg; diff --git a/kernel/mem_pool.c b/kernel/mem_pool.c index a0ffb3c2e34..f5222b9da15 100644 --- a/kernel/mem_pool.c +++ b/kernel/mem_pool.c @@ -137,7 +137,7 @@ static void free_existing_block(char *ptr, struct k_mem_pool *pool, int index) struct k_mem_pool_quad_block *quad_block = pool->block_set[index].quad_block; char *block_ptr; - uint32_t i, j; + u32_t i, j; /* * search block set's quad-blocks until the block is located, @@ -180,8 +180,8 @@ static void free_existing_block(char *ptr, struct k_mem_pool *pool, int index) static void defrag(struct k_mem_pool *pool, int start_block_set_index, int last_block_set_index) { - uint32_t i; - uint32_t k; + u32_t i; + u32_t k; int j; struct k_mem_pool_quad_block *quad_block; @@ -260,7 +260,7 @@ static char *get_existing_block(struct k_mem_pool_block_set *block_set, int *unused_block_index) { char *found = NULL; - uint32_t i = 0; + u32_t i = 0; int status; int free_bit; @@ -421,7 +421,7 @@ static void block_waiters_check(struct k_mem_pool *pool) /* loop all waiters */ while (waiter != NULL) { - uint32_t req_size = (uint32_t)(waiter->base.swap_data); + u32_t req_size = (u32_t)(waiter->base.swap_data); /* locate block set to try allocating from */ offset = compute_block_set_index(pool, req_size); @@ -465,7 +465,7 @@ void k_mem_pool_defrag(struct k_mem_pool *pool) } int k_mem_pool_alloc(struct k_mem_pool *pool, struct k_mem_block *block, - size_t size, int32_t timeout) + size_t size, s32_t timeout) { char *found_block; int offset; diff --git a/kernel/mem_slab.c b/kernel/mem_slab.c index 3d5d0ad05d1..bac69eda098 100644 --- a/kernel/mem_slab.c +++ b/kernel/mem_slab.c @@ -29,7 +29,7 @@ struct k_mem_slab *_trace_list_k_mem_slab; */ static void create_free_list(struct k_mem_slab *slab) { - uint32_t j; + u32_t j; char *p; slab->free_list = NULL; @@ -68,7 +68,7 @@ SYS_INIT(init_mem_slab_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS); void k_mem_slab_init(struct k_mem_slab *slab, void *buffer, - size_t block_size, uint32_t num_blocks) + size_t block_size, u32_t num_blocks) { slab->num_blocks = num_blocks; slab->block_size = block_size; @@ -79,7 +79,7 @@ void k_mem_slab_init(struct k_mem_slab *slab, void *buffer, SYS_TRACING_OBJ_INIT(k_mem_slab, slab); } -int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, int32_t timeout) +int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, s32_t timeout) { unsigned int key = irq_lock(); int result; diff --git a/kernel/msg_q.c b/kernel/msg_q.c index 2c95b73e0a7..d5a24815b50 100644 --- a/kernel/msg_q.c +++ b/kernel/msg_q.c @@ -47,7 +47,7 @@ SYS_INIT(init_msgq_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS); #endif /* CONFIG_OBJECT_TRACING */ void k_msgq_init(struct k_msgq *q, char *buffer, - size_t msg_size, uint32_t max_msgs) + size_t msg_size, u32_t max_msgs) { q->msg_size = msg_size; q->max_msgs = max_msgs; @@ -60,7 +60,7 @@ void k_msgq_init(struct k_msgq *q, char *buffer, SYS_TRACING_OBJ_INIT(k_msgq, q); } -int k_msgq_put(struct k_msgq *q, void *data, int32_t timeout) +int k_msgq_put(struct k_msgq *q, void *data, s32_t timeout) { __ASSERT(!_is_in_isr() || timeout == K_NO_WAIT, ""); @@ -108,7 +108,7 @@ int k_msgq_put(struct k_msgq *q, void *data, int32_t timeout) return result; } -int k_msgq_get(struct k_msgq *q, void *data, int32_t timeout) +int k_msgq_get(struct k_msgq *q, void *data, s32_t timeout) { __ASSERT(!_is_in_isr() || timeout == K_NO_WAIT, ""); diff --git a/kernel/mutex.c b/kernel/mutex.c index cb510fc71e2..ff9ce087a76 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c @@ -101,7 +101,7 @@ static void adjust_owner_prio(struct k_mutex *mutex, int new_prio) } } -int k_mutex_lock(struct k_mutex *mutex, int32_t timeout) +int k_mutex_lock(struct k_mutex *mutex, s32_t timeout) { int new_prio, key; diff --git a/kernel/pipes.c b/kernel/pipes.c index e174ccac495..ac068c98e1d 100644 --- a/kernel/pipes.c +++ b/kernel/pipes.c @@ -50,13 +50,13 @@ K_STACK_DEFINE(pipe_async_msgs, CONFIG_NUM_PIPE_ASYNC_MSGS); /* Allocate an asynchronous message descriptor */ static void _pipe_async_alloc(struct k_pipe_async **async) { - k_stack_pop(&pipe_async_msgs, (uint32_t *)async, K_FOREVER); + k_stack_pop(&pipe_async_msgs, (u32_t *)async, K_FOREVER); } /* Free an asynchronous message descriptor */ static void _pipe_async_free(struct k_pipe_async *async) { - k_stack_push(&pipe_async_msgs, (uint32_t)async); + k_stack_push(&pipe_async_msgs, (u32_t)async); } /* Finish an asynchronous operation */ @@ -103,7 +103,7 @@ static int init_pipes_module(struct device *dev) for (int i = 0; i < CONFIG_NUM_PIPE_ASYNC_MSGS; i++) { async_msg[i].thread.thread_state = _THREAD_DUMMY; async_msg[i].thread.swap_data = &async_msg[i].desc; - k_stack_push(&pipe_async_msgs, (uint32_t)&async_msg[i]); + k_stack_push(&pipe_async_msgs, (u32_t)&async_msg[i]); } #endif /* CONFIG_NUM_PIPE_ASYNC_MSGS > 0 */ @@ -265,7 +265,7 @@ static bool _pipe_xfer_prepare(sys_dlist_t *xfer_list, size_t pipe_space, size_t bytes_to_xfer, size_t min_xfer, - int32_t timeout) + s32_t timeout) { sys_dnode_t *node; struct k_thread *thread; @@ -384,7 +384,7 @@ static void _pipe_thread_ready(struct k_thread *thread) int _k_pipe_put_internal(struct k_pipe *pipe, struct k_pipe_async *async_desc, unsigned char *data, size_t bytes_to_write, size_t *bytes_written, size_t min_xfer, - int32_t timeout) + s32_t timeout) { struct k_thread *reader; struct k_pipe_desc *desc; @@ -525,7 +525,7 @@ int _k_pipe_put_internal(struct k_pipe *pipe, struct k_pipe_async *async_desc, } int k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, - size_t *bytes_read, size_t min_xfer, int32_t timeout) + size_t *bytes_read, size_t min_xfer, s32_t timeout) { struct k_thread *writer; struct k_pipe_desc *desc; @@ -668,7 +668,7 @@ int k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read, } int k_pipe_put(struct k_pipe *pipe, void *data, size_t bytes_to_write, - size_t *bytes_written, size_t min_xfer, int32_t timeout) + size_t *bytes_written, size_t min_xfer, s32_t timeout) { __ASSERT(min_xfer <= bytes_to_write, ""); __ASSERT(bytes_written != NULL, ""); diff --git a/kernel/poll.c b/kernel/poll.c index 5386cc6c408..47881e56e22 100644 --- a/kernel/poll.c +++ b/kernel/poll.c @@ -22,7 +22,7 @@ #include #include -void k_poll_event_init(struct k_poll_event *event, uint32_t type, +void k_poll_event_init(struct k_poll_event *event, u32_t type, int mode, void *obj) { __ASSERT(mode == K_POLL_MODE_NOTIFY_ONLY, @@ -58,7 +58,7 @@ static inline int is_polling(void) } /* must be called with interrupts locked */ -static inline int is_condition_met(struct k_poll_event *event, uint32_t *state) +static inline int is_condition_met(struct k_poll_event *event, u32_t *state) { switch (event->type) { case K_POLL_TYPE_SEM_AVAILABLE: @@ -164,13 +164,13 @@ static inline void clear_event_registrations(struct k_poll_event *events, } } -static inline void set_event_ready(struct k_poll_event *event, uint32_t state) +static inline void set_event_ready(struct k_poll_event *event, u32_t state) { event->poller = NULL; event->state |= state; } -int k_poll(struct k_poll_event *events, int num_events, int32_t timeout) +int k_poll(struct k_poll_event *events, int num_events, s32_t timeout) { __ASSERT(!_is_in_isr(), ""); __ASSERT(events, "NULL events\n"); @@ -192,7 +192,7 @@ int k_poll(struct k_poll_event *events, int num_events, int32_t timeout) /* find events whose condition is already fulfilled */ for (int ii = 0; ii < num_events; ii++) { - uint32_t state; + u32_t state; key = irq_lock(); if (is_condition_met(&events[ii], &state)) { @@ -266,7 +266,7 @@ int k_poll(struct k_poll_event *events, int num_events, int32_t timeout) } /* must be called with interrupts locked */ -static int _signal_poll_event(struct k_poll_event *event, uint32_t state, +static int _signal_poll_event(struct k_poll_event *event, u32_t state, int *must_reschedule) { *must_reschedule = 0; @@ -307,7 +307,7 @@ ready_event: /* returns 1 if a reschedule must take place, 0 otherwise */ /* *obj_poll_event is guaranteed to not be NULL */ -int _handle_obj_poll_event(struct k_poll_event **obj_poll_event, uint32_t state) +int _handle_obj_poll_event(struct k_poll_event **obj_poll_event, u32_t state) { struct k_poll_event *poll_event = *obj_poll_event; int must_reschedule; diff --git a/kernel/queue.c b/kernel/queue.c index 7f6e2876136..ff024adc911 100644 --- a/kernel/queue.c +++ b/kernel/queue.c @@ -68,7 +68,7 @@ static void prepare_thread_to_run(struct k_thread *thread, void *data) static inline int handle_poll_event(struct k_queue *queue) { #ifdef CONFIG_POLL - uint32_t state = K_POLL_STATE_DATA_AVAILABLE; + u32_t state = K_POLL_STATE_DATA_AVAILABLE; return queue->poll_event ? _handle_obj_poll_event(&queue->poll_event, state) : 0; @@ -161,7 +161,7 @@ void k_queue_merge_slist(struct k_queue *queue, sys_slist_t *list) sys_slist_init(list); } -void *k_queue_get(struct k_queue *queue, int32_t timeout) +void *k_queue_get(struct k_queue *queue, s32_t timeout) { unsigned int key; void *data; diff --git a/kernel/sched.c b/kernel/sched.c index e2da289975c..c405d4bbc81 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -19,7 +19,7 @@ struct _kernel _kernel = {0}; static void _set_ready_q_prio_bit(int prio) { int bmap_index = _get_ready_q_prio_bmap_index(prio); - uint32_t *bmap = &_ready_q.prio_bmap[bmap_index]; + u32_t *bmap = &_ready_q.prio_bmap[bmap_index]; *bmap |= _get_ready_q_prio_bit(prio); } @@ -30,7 +30,7 @@ static void _set_ready_q_prio_bit(int prio) static void _clear_ready_q_prio_bit(int prio) { int bmap_index = _get_ready_q_prio_bmap_index(prio); - uint32_t *bmap = &_ready_q.prio_bmap[bmap_index]; + u32_t *bmap = &_ready_q.prio_bmap[bmap_index]; *bmap &= ~_get_ready_q_prio_bit(prio); } @@ -174,17 +174,17 @@ void k_sched_unlock(void) /* convert milliseconds to ticks */ #ifdef _NON_OPTIMIZED_TICKS_PER_SEC -int32_t _ms_to_ticks(int32_t ms) +s32_t _ms_to_ticks(s32_t ms) { - int64_t ms_ticks_per_sec = (int64_t)ms * sys_clock_ticks_per_sec; + s64_t ms_ticks_per_sec = (s64_t)ms * sys_clock_ticks_per_sec; - return (int32_t)ceiling_fraction(ms_ticks_per_sec, MSEC_PER_SEC); + return (s32_t)ceiling_fraction(ms_ticks_per_sec, MSEC_PER_SEC); } #endif /* pend the specified thread: it must *not* be in the ready queue */ /* must be called with interrupts locked */ -void _pend_thread(struct k_thread *thread, _wait_q_t *wait_q, int32_t timeout) +void _pend_thread(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout) { #ifdef CONFIG_MULTITHREADING sys_dlist_t *wait_q_list = (sys_dlist_t *)wait_q; @@ -206,7 +206,7 @@ inserted: _mark_thread_as_pending(thread); if (timeout != K_FOREVER) { - int32_t ticks = _TICK_ALIGN + _ms_to_ticks(timeout); + s32_t ticks = _TICK_ALIGN + _ms_to_ticks(timeout); _add_thread_timeout(thread, wait_q, ticks); } @@ -215,7 +215,7 @@ inserted: /* pend the current thread */ /* must be called with interrupts locked */ -void _pend_current_thread(_wait_q_t *wait_q, int32_t timeout) +void _pend_current_thread(_wait_q_t *wait_q, s32_t timeout) { _remove_thread_from_ready_q(_current); _pend_thread(_current, wait_q, timeout); @@ -302,13 +302,13 @@ void k_yield(void) } } -void k_sleep(int32_t duration) +void k_sleep(s32_t duration) { #ifdef CONFIG_MULTITHREADING /* volatile to guarantee that irq_lock() is executed after ticks is * populated */ - volatile int32_t ticks; + volatile s32_t ticks; unsigned int key; __ASSERT(!_is_in_isr(), ""); @@ -377,11 +377,11 @@ void _dump_ready_q(void) } #ifdef CONFIG_TIMESLICING -extern int32_t _time_slice_duration; /* Measured in ms */ -extern int32_t _time_slice_elapsed; /* Measured in ms */ +extern s32_t _time_slice_duration; /* Measured in ms */ +extern s32_t _time_slice_elapsed; /* Measured in ms */ extern int _time_slice_prio_ceiling; -void k_sched_time_slice_set(int32_t duration_in_ms, int prio) +void k_sched_time_slice_set(s32_t duration_in_ms, int prio) { __ASSERT(duration_in_ms >= 0, ""); __ASSERT((prio >= 0) && (prio < CONFIG_NUM_PREEMPT_PRIORITIES), ""); diff --git a/kernel/sem.c b/kernel/sem.c index d9a55a9c97a..949e2564995 100644 --- a/kernel/sem.c +++ b/kernel/sem.c @@ -71,7 +71,7 @@ void k_sem_init(struct k_sem *sem, unsigned int initial_count, static inline int handle_poll_event(struct k_sem *sem) { #ifdef CONFIG_POLL - uint32_t state = K_POLL_STATE_SEM_AVAILABLE; + u32_t state = K_POLL_STATE_SEM_AVAILABLE; return sem->poll_event ? _handle_obj_poll_event(&sem->poll_event, state) : 0; @@ -140,7 +140,7 @@ void k_sem_give(struct k_sem *sem) } } -int k_sem_take(struct k_sem *sem, int32_t timeout) +int k_sem_take(struct k_sem *sem, s32_t timeout) { __ASSERT(!_is_in_isr() || timeout == K_NO_WAIT, ""); diff --git a/kernel/stack.c b/kernel/stack.c index ecf7c3b416e..f39b2a03d68 100644 --- a/kernel/stack.c +++ b/kernel/stack.c @@ -44,7 +44,7 @@ SYS_INIT(init_stack_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS); #endif /* CONFIG_OBJECT_TRACING */ -void k_stack_init(struct k_stack *stack, uint32_t *buffer, int num_entries) +void k_stack_init(struct k_stack *stack, u32_t *buffer, int num_entries) { sys_dlist_init(&stack->wait_q); stack->next = stack->base = buffer; @@ -53,7 +53,7 @@ void k_stack_init(struct k_stack *stack, uint32_t *buffer, int num_entries) SYS_TRACING_OBJ_INIT(k_stack, stack); } -void k_stack_push(struct k_stack *stack, uint32_t data) +void k_stack_push(struct k_stack *stack, u32_t data) { struct k_thread *first_pending_thread; unsigned int key; @@ -83,7 +83,7 @@ void k_stack_push(struct k_stack *stack, uint32_t data) irq_unlock(key); } -int k_stack_pop(struct k_stack *stack, uint32_t *data, int32_t timeout) +int k_stack_pop(struct k_stack *stack, u32_t *data, s32_t timeout) { unsigned int key; int result; @@ -106,7 +106,7 @@ int k_stack_pop(struct k_stack *stack, uint32_t *data, int32_t timeout) result = _Swap(key); if (result == 0) { - *data = (uint32_t)_current->base.swap_data; + *data = (u32_t)_current->base.swap_data; } return result; } diff --git a/kernel/sys_clock.c b/kernel/sys_clock.c index fd70324ecdd..243deccca20 100644 --- a/kernel/sys_clock.c +++ b/kernel/sys_clock.c @@ -36,9 +36,9 @@ int sys_clock_hw_cycles_per_sec; #endif /* updated by timer driver for tickless, stays at 1 for non-tickless */ -int32_t _sys_idle_elapsed_ticks = 1; +s32_t _sys_idle_elapsed_ticks = 1; -int64_t _sys_clock_tick_count; +s64_t _sys_clock_tick_count; /** * @@ -47,13 +47,13 @@ int64_t _sys_clock_tick_count; * @return the current system tick count * */ -uint32_t _tick_get_32(void) +u32_t _tick_get_32(void) { - return (uint32_t)_sys_clock_tick_count; + return (u32_t)_sys_clock_tick_count; } -FUNC_ALIAS(_tick_get_32, sys_tick_get_32, uint32_t); +FUNC_ALIAS(_tick_get_32, sys_tick_get_32, u32_t); -uint32_t k_uptime_get_32(void) +u32_t k_uptime_get_32(void) { return __ticks_to_ms(_tick_get_32()); } @@ -65,9 +65,9 @@ uint32_t k_uptime_get_32(void) * @return the current system tick count * */ -int64_t _tick_get(void) +s64_t _tick_get(void) { - int64_t tmp_sys_clock_tick_count; + s64_t tmp_sys_clock_tick_count; /* * Lock the interrupts when reading _sys_clock_tick_count 64-bit * variable. Some architectures (x86) do not handle 64-bit atomically, @@ -80,9 +80,9 @@ int64_t _tick_get(void) irq_unlock(imask); return tmp_sys_clock_tick_count; } -FUNC_ALIAS(_tick_get, sys_tick_get, int64_t); +FUNC_ALIAS(_tick_get, sys_tick_get, s64_t); -int64_t k_uptime_get(void) +s64_t k_uptime_get(void) { return __ticks_to_ms(_tick_get()); } @@ -103,7 +103,7 @@ int64_t k_uptime_get(void) * function concurrently. * * e.g. - * uint64_t reftime; + * u64_t reftime; * (void) sys_tick_delta(&reftime); /# prime it #/ * [do stuff] * x = sys_tick_delta(&reftime); /# how long since priming #/ @@ -115,10 +115,10 @@ int64_t k_uptime_get(void) * NOTE: We use inline function for both 64-bit and 32-bit functions. * Compiler optimizes out 64-bit result handling in 32-bit version. */ -static ALWAYS_INLINE int64_t _nano_tick_delta(int64_t *reftime) +static ALWAYS_INLINE s64_t _nano_tick_delta(s64_t *reftime) { - int64_t delta; - int64_t saved; + s64_t delta; + s64_t saved; /* * Lock the interrupts when reading _sys_clock_tick_count 64-bit @@ -142,20 +142,20 @@ static ALWAYS_INLINE int64_t _nano_tick_delta(int64_t *reftime) * * @return tick count since reference time; undefined for first invocation */ -int64_t sys_tick_delta(int64_t *reftime) +s64_t sys_tick_delta(s64_t *reftime) { return _nano_tick_delta(reftime); } -uint32_t sys_tick_delta_32(int64_t *reftime) +u32_t sys_tick_delta_32(s64_t *reftime) { - return (uint32_t)_nano_tick_delta(reftime); + return (u32_t)_nano_tick_delta(reftime); } -int64_t k_uptime_delta(int64_t *reftime) +s64_t k_uptime_delta(s64_t *reftime) { - int64_t uptime, delta; + s64_t uptime, delta; uptime = k_uptime_get(); delta = uptime - *reftime; @@ -164,9 +164,9 @@ int64_t k_uptime_delta(int64_t *reftime) return delta; } -uint32_t k_uptime_delta_32(int64_t *reftime) +u32_t k_uptime_delta_32(s64_t *reftime) { - return (uint32_t)k_uptime_delta(reftime); + return (u32_t)k_uptime_delta(reftime); } /* handle the expired timeouts in the nano timeout queue */ @@ -188,7 +188,7 @@ uint32_t k_uptime_delta_32(int64_t *reftime) volatile int _handling_timeouts; -static inline void handle_timeouts(int32_t ticks) +static inline void handle_timeouts(s32_t ticks) { sys_dlist_t expired; unsigned int key; @@ -258,8 +258,8 @@ static inline void handle_timeouts(int32_t ticks) #endif #ifdef CONFIG_TIMESLICING -int32_t _time_slice_elapsed; -int32_t _time_slice_duration = CONFIG_TIMESLICE_SIZE; +s32_t _time_slice_elapsed; +s32_t _time_slice_duration = CONFIG_TIMESLICE_SIZE; int _time_slice_prio_ceiling = CONFIG_TIMESLICE_PRIORITY; /* @@ -272,7 +272,7 @@ int _time_slice_prio_ceiling = CONFIG_TIMESLICE_PRIORITY; * - _time_slice_duration does not have to be protected, since it can only * change at thread level */ -static void handle_time_slicing(int32_t ticks) +static void handle_time_slicing(s32_t ticks) { if (_time_slice_duration == 0) { return; @@ -307,7 +307,7 @@ static void handle_time_slicing(int32_t ticks) * * @return N/A */ -void _nano_sys_clock_tick_announce(int32_t ticks) +void _nano_sys_clock_tick_announce(s32_t ticks) { unsigned int key; diff --git a/kernel/thread.c b/kernel/thread.c index a61836b91ff..473ee9afa32 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -67,18 +67,18 @@ int _is_thread_essential(void) return _current->base.user_options & K_ESSENTIAL; } -void k_busy_wait(uint32_t usec_to_wait) +void k_busy_wait(u32_t usec_to_wait) { /* use 64-bit math to prevent overflow when multiplying */ - uint32_t cycles_to_wait = (uint32_t)( - (uint64_t)usec_to_wait * - (uint64_t)sys_clock_hw_cycles_per_sec / - (uint64_t)USEC_PER_SEC + u32_t cycles_to_wait = (u32_t)( + (u64_t)usec_to_wait * + (u64_t)sys_clock_hw_cycles_per_sec / + (u64_t)USEC_PER_SEC ); - uint32_t start_cycles = k_cycle_get_32(); + u32_t start_cycles = k_cycle_get_32(); for (;;) { - uint32_t current_cycles = k_cycle_get_32(); + u32_t current_cycles = k_cycle_get_32(); /* this handles the rollover on an unsigned 32-bit value */ if ((current_cycles - start_cycles) >= cycles_to_wait) { @@ -181,13 +181,13 @@ static void start_thread(struct k_thread *thread) #endif #ifdef CONFIG_MULTITHREADING -static void schedule_new_thread(struct k_thread *thread, int32_t delay) +static void schedule_new_thread(struct k_thread *thread, s32_t delay) { #ifdef CONFIG_SYS_CLOCK_EXISTS if (delay == 0) { start_thread(thread); } else { - int32_t ticks = _TICK_ALIGN + _ms_to_ticks(delay); + s32_t ticks = _TICK_ALIGN + _ms_to_ticks(delay); int key = irq_lock(); _add_thread_timeout(thread, NULL, ticks); @@ -204,7 +204,7 @@ static void schedule_new_thread(struct k_thread *thread, int32_t delay) k_tid_t k_thread_spawn(char *stack, size_t stack_size, void (*entry)(void *, void *, void*), void *p1, void *p2, void *p3, - int prio, uint32_t options, int32_t delay) + int prio, u32_t options, s32_t delay) { __ASSERT(!_is_in_isr(), ""); @@ -239,12 +239,12 @@ int k_thread_cancel(k_tid_t tid) } static inline int is_in_any_group(struct _static_thread_data *thread_data, - uint32_t groups) + u32_t groups) { return !!(thread_data->init_groups & groups); } -void _k_thread_group_op(uint32_t groups, void (*func)(struct k_thread *)) +void _k_thread_group_op(u32_t groups, void (*func)(struct k_thread *)) { unsigned int key; @@ -388,12 +388,12 @@ void _init_static_threads(void) #endif void _init_thread_base(struct _thread_base *thread_base, int priority, - uint32_t initial_state, unsigned int options) + u32_t initial_state, unsigned int options) { /* k_q_node is initialized upon first insertion in a list */ - thread_base->user_options = (uint8_t)options; - thread_base->thread_state = (uint8_t)initial_state; + thread_base->user_options = (u8_t)options; + thread_base->thread_state = (u8_t)initial_state; thread_base->prio = priority; @@ -404,21 +404,21 @@ void _init_thread_base(struct _thread_base *thread_base, int priority, _init_thread_timeout(thread_base); } -uint32_t _k_thread_group_mask_get(struct k_thread *thread) +u32_t _k_thread_group_mask_get(struct k_thread *thread) { struct _static_thread_data *thread_data = thread->init_data; return thread_data->init_groups; } -void _k_thread_group_join(uint32_t groups, struct k_thread *thread) +void _k_thread_group_join(u32_t groups, struct k_thread *thread) { struct _static_thread_data *thread_data = thread->init_data; thread_data->init_groups |= groups; } -void _k_thread_group_leave(uint32_t groups, struct k_thread *thread) +void _k_thread_group_leave(u32_t groups, struct k_thread *thread) { struct _static_thread_data *thread_data = thread->init_data; diff --git a/kernel/timer.c b/kernel/timer.c index 2f0c8218eb9..308bc82a03a 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -106,12 +106,12 @@ void k_timer_init(struct k_timer *timer, } -void k_timer_start(struct k_timer *timer, int32_t duration, int32_t period) +void k_timer_start(struct k_timer *timer, s32_t duration, s32_t period) { __ASSERT(duration >= 0 && period >= 0 && (duration != 0 || period != 0), "invalid parameters\n"); - volatile int32_t period_in_ticks, duration_in_ticks; + volatile s32_t period_in_ticks, duration_in_ticks; period_in_ticks = _ms_to_ticks(period); duration_in_ticks = _TICK_ALIGN + _ms_to_ticks(duration); @@ -159,10 +159,10 @@ void k_timer_stop(struct k_timer *timer) } -uint32_t k_timer_status_get(struct k_timer *timer) +u32_t k_timer_status_get(struct k_timer *timer) { unsigned int key = irq_lock(); - uint32_t result = timer->status; + u32_t result = timer->status; timer->status = 0; irq_unlock(key); @@ -171,12 +171,12 @@ uint32_t k_timer_status_get(struct k_timer *timer) } -uint32_t k_timer_status_sync(struct k_timer *timer) +u32_t k_timer_status_sync(struct k_timer *timer) { __ASSERT(!_is_in_isr(), ""); unsigned int key = irq_lock(); - uint32_t result = timer->status; + u32_t result = timer->status; if (result == 0) { if (timer->timeout.delta_ticks_from_prev != _INACTIVE) { @@ -200,10 +200,10 @@ uint32_t k_timer_status_sync(struct k_timer *timer) return result; } -int32_t _timeout_remaining_get(struct _timeout *timeout) +s32_t _timeout_remaining_get(struct _timeout *timeout) { unsigned int key = irq_lock(); - int32_t remaining_ticks; + s32_t remaining_ticks; if (timeout->delta_ticks_from_prev == _INACTIVE) { remaining_ticks = 0; diff --git a/kernel/version.c b/kernel/version.c index 954b91640cc..4af778d50a4 100644 --- a/kernel/version.c +++ b/kernel/version.c @@ -9,7 +9,7 @@ #include #include "version.h" /* generated by MAKE, at compile time */ -static uint32_t kernel_version = KERNELVERSION; +static u32_t kernel_version = KERNELVERSION; /** * @@ -20,7 +20,7 @@ static uint32_t kernel_version = KERNELVERSION; * * @return kernel version */ -uint32_t sys_kernel_version_get(void) +u32_t sys_kernel_version_get(void) { return kernel_version; } diff --git a/kernel/work_q.c b/kernel/work_q.c index cba0988ce21..4194702b70d 100644 --- a/kernel/work_q.c +++ b/kernel/work_q.c @@ -74,7 +74,7 @@ void k_delayed_work_init(struct k_delayed_work *work, k_work_handler_t handler) int k_delayed_work_submit_to_queue(struct k_work_q *work_q, struct k_delayed_work *work, - int32_t delay) + s32_t delay) { int key = irq_lock(); int err;