summaryrefslogtreecommitdiff
path: root/chip/host
diff options
context:
space:
mode:
Diffstat (limited to 'chip/host')
-rw-r--r--chip/host/flash.c4
-rw-r--r--chip/host/gpio.c2
-rw-r--r--chip/host/persistence.c9
-rw-r--r--chip/host/reboot.c7
-rw-r--r--chip/host/spi_controller.c5
-rw-r--r--chip/host/trng.c4
-rw-r--r--chip/host/uart.c13
7 files changed, 22 insertions, 22 deletions
diff --git a/chip/host/flash.c b/chip/host/flash.c
index 03a5fc777b..209489162c 100644
--- a/chip/host/flash.c
+++ b/chip/host/flash.c
@@ -5,6 +5,8 @@
/* Flash module for emulator */
+#include <stdio.h>
+
#include "builtin/assert.h"
#include "common.h"
#include "config_chip.h"
@@ -12,8 +14,6 @@
#include "persistence.h"
#include "util.h"
-#include <stdio.h>
-
/* This needs to be aligned to the erase bank size for NVCTR. */
__aligned(CONFIG_FLASH_ERASE_SIZE) char __host_flash[CONFIG_FLASH_SIZE_BYTES];
uint8_t __host_flash_protect[PHYSICAL_BANKS];
diff --git a/chip/host/gpio.c b/chip/host/gpio.c
index d80d93dcf7..b74bec52a1 100644
--- a/chip/host/gpio.c
+++ b/chip/host/gpio.c
@@ -5,6 +5,8 @@
/* GPIO module for emulator */
+#include "console.h"
+
#include "common.h"
#include "console.h"
#include "gpio.h"
diff --git a/chip/host/persistence.c b/chip/host/persistence.c
index 369f58034b..4d8ef09df1 100644
--- a/chip/host/persistence.c
+++ b/chip/host/persistence.c
@@ -18,14 +18,13 @@
* this homegrown implementation of something similar-yet-different.
*/
-#include "builtin/assert.h"
-#include "util.h"
-
+#include <linux/limits.h>
+#include <unistd.h>
#include <stdio.h>
#include <string.h>
-#include <linux/limits.h>
-#include <unistd.h>
+#include "builtin/assert.h"
+#include "util.h"
/* The longest path in a chroot seems to be about 280 characters (as of
* April 2021) so define a cut-off instead of just hoping for the best:
diff --git a/chip/host/reboot.c b/chip/host/reboot.c
index 59e15ee81d..24d90d943d 100644
--- a/chip/host/reboot.c
+++ b/chip/host/reboot.c
@@ -5,15 +5,14 @@
/* Emulator self-reboot procedure */
+#include <string.h>
+#include <unistd.h>
+
#include "console.h"
#include "host_test.h"
#include "reboot.h"
#include "test_util.h"
-#include <string.h>
-
-#include <unistd.h>
-
#ifdef TEST_FUZZ
/* reboot breaks fuzzing, let's just not do it. */
void emulator_reboot(void)
diff --git a/chip/host/spi_controller.c b/chip/host/spi_controller.c
index ae6e2c9346..a1df53d935 100644
--- a/chip/host/spi_controller.c
+++ b/chip/host/spi_controller.c
@@ -5,11 +5,12 @@
* Mock SPI Controller driver for unit test.
*/
+#include <stdint.h>
+
#include "common.h"
#include "gpio.h"
-#include "spi.h"
-#include <stdint.h>
+#include "spi.h"
test_mockable int spi_enable(const struct spi_device_t *spi_device, int enable)
{
diff --git a/chip/host/trng.c b/chip/host/trng.c
index d0def66277..ef3df1ad5f 100644
--- a/chip/host/trng.c
+++ b/chip/host/trng.c
@@ -14,11 +14,11 @@
#error "This fake trng driver must not be used in non-test builds."
#endif
-#include "common.h"
-
#include <stdint.h>
#include <stdlib.h> /* Only valid for host */
+#include "common.h"
+
static unsigned int seed;
test_mockable void trng_init(void)
diff --git a/chip/host/uart.c b/chip/host/uart.c
index 71e8345196..9e70a6005c 100644
--- a/chip/host/uart.c
+++ b/chip/host/uart.c
@@ -5,6 +5,12 @@
/* UART driver for emulator */
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <termio.h>
+#include <unistd.h>
+
#include "builtin/assert.h"
#include "common.h"
#include "queue.h"
@@ -13,13 +19,6 @@
#include "uart.h"
#include "util.h"
-#include <signal.h>
-#include <stdio.h>
-
-#include <pthread.h>
-#include <termio.h>
-#include <unistd.h>
-
static int stopped = 1;
static int init_done;