From 0e95e546fd7a390c73b169f71342c122baa6a922 Mon Sep 17 00:00:00 2001 From: Alwin Joshy Date: Mon, 15 Jan 2024 16:52:37 +1100 Subject: [PATCH] reverted unnecessary changes --- apps/sel4test-tests/arch/x86/arch/debug.h | 16 +--------------- .../src/arch/arm/tests/breakpoints.c | 2 +- apps/sel4test-tests/src/tests/breakpoints.c | 10 ++++------ 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/apps/sel4test-tests/arch/x86/arch/debug.h b/apps/sel4test-tests/arch/x86/arch/debug.h index 6f59c7c8..3e56e09f 100644 --- a/apps/sel4test-tests/arch/x86/arch/debug.h +++ b/apps/sel4test-tests/arch/x86/arch/debug.h @@ -13,23 +13,9 @@ "int $3\n\t" \ "post_sbreak:\n\t") -#define TEST_SINGLE_STEP_ASM() \ - asm volatile( \ - ".att_syntax\n\t" \ - ".global label_one, label_two\n\t" \ - ".type label_one, @function\n\t" \ - ".type label_two, @function\n\t" \ - "label_one: \n\t" \ - "nop \n\t" \ - "label_two: \n\t" \ - "nop \n\t" \ - ) - /* Tell C about the symbols exported by the ASM above. */ -extern char post_sbreak, label_one, label_two; +extern char post_sbreak; #define TEST_SOFTWARE_BREAK_EXPECTED_FAULT_LABEL post_sbreak -#define TEST_SS_LABEL_ONE label_one -#define TEST_SS_LABEL_TWO label_two #define SINGLESTEP_EXPECTED_BP_CONSUMPTION_VALUE (false) #define TEST_NUM_DATA_WPS seL4_NumDualFunctionMonitors #define TEST_NUM_INSTR_BPS seL4_NumDualFunctionMonitors diff --git a/apps/sel4test-tests/src/arch/arm/tests/breakpoints.c b/apps/sel4test-tests/src/arch/arm/tests/breakpoints.c index ed5fcce5..6e15a005 100644 --- a/apps/sel4test-tests/src/arch/arm/tests/breakpoints.c +++ b/apps/sel4test-tests/src/arch/arm/tests/breakpoints.c @@ -105,4 +105,4 @@ static int test_single_step_one(struct env *env) { DEFINE_TEST(SINGLESTEP_001, "Test that single stepping 1 instruction works", test_single_step_one, config_set(CONFIG_HARDWARE_DEBUG_API)) -#endif /* CONFIG_HARDWARE_DEBUG_API */ \ No newline at end of file +#endif /* CONFIG_HARDWARE_DEBUG_API */ diff --git a/apps/sel4test-tests/src/tests/breakpoints.c b/apps/sel4test-tests/src/tests/breakpoints.c index da81d94b..93efe0eb 100644 --- a/apps/sel4test-tests/src/tests/breakpoints.c +++ b/apps/sel4test-tests/src/tests/breakpoints.c @@ -107,7 +107,8 @@ static volatile uint32_t bpd; * event may be the triggering of an instruction breakpoint, a data watchpoint, * or a software break request. */ -static int breakpoint_triggerer_main(seL4_Word type, seL4_Word size, seL4_Word rw, seL4_Word arg3) { +static int breakpoint_triggerer_main(seL4_Word type, seL4_Word size, seL4_Word rw, seL4_Word arg3) +{ if (type == seL4_InstructionBreakpoint) { breakpoint_code(); @@ -123,7 +124,7 @@ static int breakpoint_triggerer_main(seL4_Word type, seL4_Word size, seL4_Word r * by dereferencing null. The purpose of this is to ensure that if this * test fails, the other tests will be allowed to continue. */ - volatile int *pi = (volatile int *) BREAKPOINT_TEST_BAD_FAULT_MAGIC_ADDR; + volatile int *pi = (volatile int *)BREAKPOINT_TEST_BAD_FAULT_MAGIC_ADDR; *pi = 1; } else if (type == seL4_SoftwareBreakRequest) { TEST_SOFTWARE_BREAK_ASM(); @@ -160,7 +161,7 @@ static int breakpoint_handler_main(seL4_Word _fault_ep_cspath, seL4_Word a1, seL case seL4_Fault_DebugException: return 0; default: - ZF_LOGE("Fault of type %zd received. Vaddr 0x%zx\n", label, fault_data.vaddr); + ZF_LOGE("Fault of type %zd received. Vaddr %zu\n", label, fault_data.vaddr); fault_data.bp_num = 0; return -1; } @@ -176,8 +177,6 @@ static void setup_handler_thread_for_test(struct env *env, helper_thread_t *hand 0, 0, 0); } - - static void cleanup_breakpoints_from_test(struct env *env) { for (int i = TEST_FIRST_INSTR_BP; i < TEST_FIRST_INSTR_BP + TEST_NUM_INSTR_BPS; i++) { @@ -483,5 +482,4 @@ DEFINE_TEST(BREAK_REQUEST_001, "Use an INT3/BKPT instruction to trigger a " "listening handler.", test_debug_api_software_break_request, config_set(CONFIG_HARDWARE_DEBUG_API)) - #endif /* CONFIG_HARDWARE_DEBUG_API */