zephyr: replace zephyr integer types with C99 types

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

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

View file

@ -10,11 +10,11 @@
#include <drivers/hwinfo.h>
#include <string.h>
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
u32_t rdata1 = sys_read32(EFUSE_BLK0_RDATA1_REG);
u32_t rdata2 = sys_read32(EFUSE_BLK0_RDATA2_REG);
u8_t id[6];
uint32_t rdata1 = sys_read32(EFUSE_BLK0_RDATA1_REG);
uint32_t rdata2 = sys_read32(EFUSE_BLK0_RDATA2_REG);
uint8_t id[6];
/* The first word provides the lower 32 bits of the MAC
* address; the low 16 bits of the second word provide the
@ -22,12 +22,12 @@ ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
* (apparently) a checksum, and reserved. See ESP32 Technical
* Reference Manual V4.1 section 20.5.
*/
id[0] = (u8_t)(rdata2 >> 8);
id[1] = (u8_t)(rdata2 >> 0);
id[2] = (u8_t)(rdata1 >> 24);
id[3] = (u8_t)(rdata1 >> 16);
id[4] = (u8_t)(rdata1 >> 8);
id[5] = (u8_t)(rdata1 >> 0);
id[0] = (uint8_t)(rdata2 >> 8);
id[1] = (uint8_t)(rdata2 >> 0);
id[2] = (uint8_t)(rdata1 >> 24);
id[3] = (uint8_t)(rdata1 >> 16);
id[4] = (uint8_t)(rdata1 >> 8);
id[5] = (uint8_t)(rdata1 >> 0);
if (length > sizeof(id)) {
length = sizeof(id);

View file

@ -7,10 +7,10 @@
#include <syscall_handler.h>
#include <drivers/hwinfo.h>
ssize_t z_vrfy_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_vrfy_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, length));
return z_impl_hwinfo_get_device_id((u8_t *)buffer, (size_t)length);
return z_impl_hwinfo_get_device_id((uint8_t *)buffer, (size_t)length);
}
#include <syscalls/hwinfo_get_device_id_mrsh.c>

View file

@ -10,10 +10,10 @@
#include <sys/byteorder.h>
struct imxrt_uid {
u32_t id[2];
uint32_t id[2];
};
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
struct imxrt_uid dev_id;

View file

@ -12,15 +12,15 @@
#include <device.h>
#include <sys/util.h>
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
u32_t volatile *ptr = (u32_t volatile *)(DT_INST_REG_ADDR(0));
ssize_t end = MIN(length, (DT_INST_REG_SIZE(0) / sizeof(u32_t)));
uint32_t volatile *ptr = (uint32_t volatile *)(DT_INST_REG_ADDR(0));
ssize_t end = MIN(length, (DT_INST_REG_SIZE(0) / sizeof(uint32_t)));
for (int i = 0; i < end; i++) {
/* In LiteX even though registers are 32-bit wide, each one
contains meaningful data only in the lowest 8 bits */
buffer[i] = (u8_t)(ptr[i] & 0xff);
buffer[i] = (uint8_t)(ptr[i] & 0xff);
}
return end;

View file

@ -25,10 +25,10 @@
HWINFO_DEVICE_ID_LENGTH_M + \
HWINFO_DEVICE_ID_LENGTH_H)
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
u32_t id[HWINFO_DEVICE_ID_LENGTH_TOTAL];
u32_t *idp = id;
uint32_t id[HWINFO_DEVICE_ID_LENGTH_TOTAL];
uint32_t *idp = id;
#if defined(SIM_UIDH)
*idp++ = sys_cpu_to_be32(SIM->UIDH);

View file

@ -11,10 +11,10 @@
#include <sys/byteorder.h>
struct nrf_uid {
u32_t id[2];
uint32_t id[2];
};
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
struct nrf_uid dev_id;

View file

@ -10,9 +10,9 @@
#include <soc.h>
#include <string.h>
static u8_t sam_uid[16];
static uint8_t sam_uid[16];
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
if (length > sizeof(sam_uid)) {
length = sizeof(sam_uid);
@ -34,7 +34,7 @@ ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
__ramfunc static void hwinfo_sam_read_device_id(void)
{
Efc *efc = (Efc *)DT_REG_ADDR(DT_INST(0, atmel_sam_flash_controller));
u8_t *flash = (u8_t *)CONFIG_FLASH_BASE_ADDRESS;
uint8_t *flash = (uint8_t *)CONFIG_FLASH_BASE_ADDRESS;
int i;
/* Switch the flash controller to the unique identifier area. The flash
@ -65,7 +65,7 @@ __ramfunc static void hwinfo_sam_read_device_id(void)
static int hwinfo_sam_init(struct device *arg)
{
Efc *efc = (Efc *)DT_REG_ADDR(DT_INST(0, atmel_sam_flash_controller));
u32_t fmr;
uint32_t fmr;
int key;
/* Disable interrupts. */

View file

@ -12,20 +12,20 @@
#include <sys/byteorder.h>
struct sam0_uid {
u32_t id[4];
uint32_t id[4];
};
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
struct sam0_uid dev_id;
dev_id.id[0] = sys_cpu_to_be32(*(const u32_t *)
dev_id.id[0] = sys_cpu_to_be32(*(const uint32_t *)
DT_INST_REG_ADDR_BY_IDX(0, 0));
dev_id.id[1] = sys_cpu_to_be32(*(const u32_t *)
dev_id.id[1] = sys_cpu_to_be32(*(const uint32_t *)
DT_INST_REG_ADDR_BY_IDX(0, 1));
dev_id.id[2] = sys_cpu_to_be32(*(const u32_t *)
dev_id.id[2] = sys_cpu_to_be32(*(const uint32_t *)
DT_INST_REG_ADDR_BY_IDX(0, 2));
dev_id.id[3] = sys_cpu_to_be32(*(const u32_t *)
dev_id.id[3] = sys_cpu_to_be32(*(const uint32_t *)
DT_INST_REG_ADDR_BY_IDX(0, 3));
if (length > sizeof(dev_id.id)) {

View file

@ -12,7 +12,7 @@
static int cmd_get_device_id(const struct shell *shell, size_t argc, char **argv)
{
u8_t dev_id[16];
uint8_t dev_id[16];
ssize_t length;
int i;

View file

@ -10,10 +10,10 @@
#include <sys/byteorder.h>
struct stm32_uid {
u32_t id[3];
uint32_t id[3];
};
ssize_t z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
struct stm32_uid dev_id;

View file

@ -6,7 +6,7 @@
#include <drivers/hwinfo.h>
ssize_t __weak z_impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
ssize_t __weak z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
{
return -ENOTSUP;
}