trivial: run style formatter

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
This commit is contained in:
Gerwin Klein 2020-12-06 20:21:17 +11:00
parent 1d81cf6e6a
commit 31c597c8ca
6 changed files with 62 additions and 55 deletions

View File

@ -12,8 +12,7 @@
#define IO_PORT_MIN 0xcf8
#define IO_PORT_MAX 0xcff
/* copy the caps required to set up the sel4platsupport default timer */
void
arch_copy_IOPort_cap(init_data_t *init, rump_env_t *env, sel4utils_process_t *test_process)
void arch_copy_IOPort_cap(init_data_t *init, rump_env_t *env, sel4utils_process_t *test_process)
{
cspacepath_t path;
seL4_Error error = vka_cspace_alloc_path(&env->vka, &path);
@ -53,6 +52,6 @@ void __attribute__((optimize("O0"))) hog_thread(void *_arg1, void *_arg2, void *
{
while (true) {
COMPILER_MEMORY_FENCE();
asm volatile ("nop");
asm volatile("nop");
}
}

View File

@ -11,13 +11,16 @@
struct mmio mmio0s[] = {{0xf7f00000, 17}, {0xf7f39000, 12}};
struct mmio mmio1s[] = {{0xf7dc0000, 17}};
static device_t devices[] = {{"wm0", 20, ARRAY_SIZE(mmio0s), mmio0s, {0,25,0}},
{"wm1", 16, ARRAY_SIZE(mmio1s), mmio1s, {3,0,0}}};
static device_t devices[] = {{"wm0", 20, ARRAY_SIZE(mmio0s), mmio0s, {0, 25, 0}},
{"wm1", 16, ARRAY_SIZE(mmio1s), mmio1s, {3, 0, 0}}
};
device_t *get_devices(void) {
device_t *get_devices(void)
{
return devices;
}
int get_num_devices(void) {
int get_num_devices(void)
{
return ARRAY_SIZE(devices);
}

View File

@ -10,12 +10,14 @@
struct mmio mmio0s[] = {{0xfebc0000, 17}};
static device_t devices[] = {{"wm0", 11, ARRAY_SIZE(mmio0s), mmio0s, {0,3,0}}};
static device_t devices[] = {{"wm0", 11, ARRAY_SIZE(mmio0s), mmio0s, {0, 3, 0}}};
device_t *get_devices(void) {
device_t *get_devices(void)
{
return devices;
}
int get_num_devices(void) {
int get_num_devices(void)
{
return ARRAY_SIZE(devices);
}

View File

@ -18,8 +18,7 @@
/* Print out a summary of what has been tracked */
#ifdef CONFIG_BENCHMARK_USE_KERNEL_LOG_BUFFER
static inline void
seL4_BenchmarkTrackDumpSummary_pri(benchmark_track_kernel_entry_t *logBuffer, uint32_t logSize)
static inline void seL4_BenchmarkTrackDumpSummary_pri(benchmark_track_kernel_entry_t *logBuffer, uint32_t logSize)
{
uint32_t index = 0;
uint32_t syscall_entries[8];
@ -50,7 +49,7 @@ seL4_BenchmarkTrackDumpSummary_pri(benchmark_track_kernel_entry_t *logBuffer, ui
}
if (logBuffer[index].entry.path == Entry_Syscall) {
int syscall_no = logBuffer[index].entry.syscall_no;
if (syscall_no == 7 ) {
if (syscall_no == 7) {
cap_entries[logBuffer[index].entry.cap_type]++;
cap_time[logBuffer[index].entry.cap_type] += logBuffer[index].duration;
if (logBuffer[index].entry.cap_type == 2) {
@ -135,7 +134,7 @@ void handle_char(rump_env_t *env, int c)
/* Stop recording kernel entries */
logIndexFinalized = seL4_BenchmarkFinalizeLog();
#endif /* CONFIG_BENCHMARK_USE_KERNEL_LOG_BUFFER */
printf("tot: %"PRIu64"\n idle: %"PRIu64"\n", cpucount2 - cpucount, ccount-start_idle_count);
printf("tot: %"PRIu64"\n idle: %"PRIu64"\n", cpucount2 - cpucount, ccount - start_idle_count);
break;
case 'c':
#ifdef CONFIG_BENCHMARK_USE_KERNEL_LOG_BUFFER

View File

@ -13,7 +13,8 @@
int num_cores;
int set_thread_affinity(int thread_id) {
int set_thread_affinity(int thread_id)
{
int core_id = thread_id % num_cores;
/* Create NetBSD cpuset */
@ -27,7 +28,8 @@ int set_thread_affinity(int thread_id) {
/* A task that takes some time to complete. The id identifies distinct
tasks for printed messages. */
double task(int id) {
double task(int id)
{
printf("Task %d started\n", id);
int i;
double result = 0.0;
@ -38,7 +40,8 @@ double task(int id) {
}
/* Same as 'task', but meant to be called from different threads. */
void *start_thread(void *t) {
void *start_thread(void *t)
{
int id = (int) t;
set_thread_affinity(id);
printf("Thread %ld started\n", id);
@ -47,7 +50,8 @@ void *start_thread(void *t) {
pthread_exit(0);
}
int main(int argc, char *argv[]) {
int main(int argc, char *argv[])
{
if (argc != 3) {
return -1;
}