From c1012ae99118bdef4e8ce6b4a4730c2f94deb541 Mon Sep 17 00:00:00 2001 From: Thomas Benz Date: Mon, 7 Aug 2023 11:19:46 +0200 Subject: [PATCH] sw: Format c files --- sw/future/axirt.c | 42 ++++++++++++++++-------------------------- sw/future/axirt.h | 5 +---- sw/tests/helloaxirt.c | 2 +- 3 files changed, 18 insertions(+), 31 deletions(-) diff --git a/sw/future/axirt.c b/sw/future/axirt.c index 9aa14e784..df238df5a 100644 --- a/sw/future/axirt.c +++ b/sw/future/axirt.c @@ -19,49 +19,39 @@ void __axirt_release() { *reg32(&__base_axirtgrd, 0) = 0; } - // setter functions -void __axirt_set_len_limit(uint8_t limit, uint8_t mgr_id){ +void __axirt_set_len_limit(uint8_t limit, uint8_t mgr_id) { *reg8(&__base_axirt, AXI_RT_LEN_LIMIT_0_REG_OFFSET + mgr_id) = limit; } -void __axirt_set_region(uint64_t start_addr, uint64_t end_addr, - uint8_t region_id, uint8_t mgr_id) { +void __axirt_set_region(uint64_t start_addr, uint64_t end_addr, uint8_t region_id, uint8_t mgr_id) { *reg32(&__base_axirt, AXI_RT_END_ADDR_SUB_HIGH_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = end_addr >> 32; - *reg32(&__base_axirt, AXI_RT_END_ADDR_SUB_LOW_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = end_addr & 0xffffffff; + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + region_id * 4) = end_addr >> 32; + *reg32(&__base_axirt, AXI_RT_END_ADDR_SUB_LOW_0_REG_OFFSET + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + + region_id * 4) = end_addr & 0xffffffff; *reg32(&__base_axirt, AXI_RT_START_ADDR_SUB_LOW_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = start_addr & 0xffffffff; + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + region_id * 4) = + start_addr & 0xffffffff; *reg32(&__base_axirt, AXI_RT_START_ADDR_SUB_HIGH_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = start_addr >> 32; + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + region_id * 4) = start_addr >> 32; } void __axirt_set_period(uint32_t period, uint8_t region_id, uint8_t mgr_id) { - *reg32(&__base_axirt, AXI_RT_WRITE_PERIOD_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = period; - *reg32(&__base_axirt, AXI_RT_READ_PERIOD_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = period; + *reg32(&__base_axirt, AXI_RT_WRITE_PERIOD_0_REG_OFFSET + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + + region_id * 4) = period; + *reg32(&__base_axirt, AXI_RT_READ_PERIOD_0_REG_OFFSET + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + + region_id * 4) = period; } void __axirt_set_budget(uint32_t budget, uint8_t region_id, uint8_t mgr_id) { - *reg32(&__base_axirt, AXI_RT_WRITE_BUDGET_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = budget; - *reg32(&__base_axirt, AXI_RT_READ_BUDGET_0_REG_OFFSET + - AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + - region_id * 4) = budget; + *reg32(&__base_axirt, AXI_RT_WRITE_BUDGET_0_REG_OFFSET + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + + region_id * 4) = budget; + *reg32(&__base_axirt, AXI_RT_READ_BUDGET_0_REG_OFFSET + AXI_RT_PARAM_NUM_SUB * mgr_id * 4 + + region_id * 4) = budget; } - // config functions void __axirt_enable(uint32_t enable) { *reg32(&__base_axirt, AXI_RT_RT_ENABLE_REG_OFFSET) = enable; diff --git a/sw/future/axirt.h b/sw/future/axirt.h index d532089bf..126f0330b 100644 --- a/sw/future/axirt.h +++ b/sw/future/axirt.h @@ -16,18 +16,15 @@ void __axirt_claim(bool read_excl, bool write_excl); void __axirt_release(); - // setter functions void __axirt_set_len_limit(uint8_t limit, uint8_t mgr_id); -void __axirt_set_region(uint64_t start_addr, uint64_t end_addr, - uint8_t region_id, uint8_t mgr_id); +void __axirt_set_region(uint64_t start_addr, uint64_t end_addr, uint8_t region_id, uint8_t mgr_id); void __axirt_set_period(uint32_t period, uint8_t region_id, uint8_t mgr_id); void __axirt_set_budget(uint32_t budget, uint8_t region_id, uint8_t mgr_id); - // config functions void __axirt_enable(uint32_t enable); diff --git a/sw/tests/helloaxirt.c b/sw/tests/helloaxirt.c index 8157fb2c1..bc67fc9e0 100644 --- a/sw/tests/helloaxirt.c +++ b/sw/tests/helloaxirt.c @@ -25,7 +25,7 @@ int main(void) { __axirt_claim(1, 1); for (int m = 0; m < AXI_RT_PARAM_NUM_MRG; m++) { __axirt_set_len_limit(8, m); - __axirt_set_region(0, 0xffffffff, 0, m); + __axirt_set_region(0, 0xffffffff, 0, m); __axirt_set_region(0x100000000, 0xffffffffffffffff, 1, m); __axirt_set_budget(0x10000000, 0, m); __axirt_set_budget(0x10000000, 1, m);