arm: remove old GDB_INFO support

That module is not used anymore: it was introduced pre-Zephyr to add
some kind of awareness when debugging ARM Cortex-M3 code with GDB but
was never really used by anyone. It has bitrotted, and with the recent
move of the tTCS and tNANO data structures to common _kernel and
k_thread, it does not even compile anymore.

Jira: ZEP-1284, ZEP-951

Change-Id: Ic9afed00f4229324fe5d2aa97dc6f1c935953244
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2016-12-19 09:07:04 -05:00 committed by Anas Nashif
commit 5ad2905532
15 changed files with 4 additions and 376 deletions

View file

@ -8,7 +8,6 @@ obj-y = exc_exit.o irq_init.o \
fault_s.o isr_wrapper.o \
fatal.o sys_fatal_error_handler.o thread_abort.o
obj-$(CONFIG_GDB_INFO) += gdb_stub_irq_vector_table.o gdb_stub.o
obj-$(CONFIG_CPLUSPLUS) += __aeabi_atexit.o
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
obj-$(CONFIG_CPU_CORTEX_M) += cortex_m/

View file

@ -37,13 +37,6 @@ GTEXT(_ExcExit)
GTEXT(_IntExit)
GDATA(_kernel)
#if CONFIG_GDB_INFO
#define _EXIT_EXC_IF_FIBER_PREEMPTED beq _ExcExitWithGdbStub
#else
#define _EXIT_EXC_IF_FIBER_PREEMPTED beq _EXIT_EXC
#endif
#define _EXIT_EXC_IF_FIBER_NOT_READY _EXIT_EXC_IF_FIBER_PREEMPTED
/**
*
* @brief Kernel housekeeping when exiting interrupt handler installed
@ -113,8 +106,6 @@ SECTION_SUBSEC_FUNC(TEXT, _HandlerModeExit, _ExcExit)
_ExcExitWithGdbStub:
_GDB_STUB_EXC_EXIT
_EXIT_EXC:
#endif /* CONFIG_PREEMPT_ENABLED */

View file

@ -72,8 +72,6 @@ SECTION_SUBSEC_FUNC(TEXT,__fault,__debug_monitor)
#endif
SECTION_SUBSEC_FUNC(TEXT,__fault,__reserved)
_GDB_STUB_EXC_ENTRY
#if defined(CONFIG_CPU_CORTEX_M0_M0PLUS)
/* force unlock interrupts */
cpsie i
@ -109,8 +107,6 @@ _stack_frame_endif:
push {lr}
bl _Fault
_GDB_STUB_EXC_EXIT
pop {pc}
.end

View file

@ -1,168 +0,0 @@
/*
* Copyright (c) 2014 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @brief Extra work performed upon exception entry/exit for GDB
*
*
* Prep work done when entering exceptions consists of saving the callee-saved
* registers before they get used by exception handlers, and recording the fact
* that we are running in an exception.
*
* Upon exception exit, it must be recorded that the task is not in an exception
* anymore.
*/
#define _ASMLANGUAGE
#include <offsets_short.h>
#include <toolchain.h>
#include <sections.h>
#include <kernel_structs.h>
#include <arch/cpu.h>
_ASM_FILE_PROLOGUE
/**
*
* @brief Exception entry extra work when GDB_INFO is enabled
*
* During normal system operation, the callee-saved registers are saved lazily
* only when a context switch is required. To allow looking at the current
* threads registers while debugging an exception/interrupt, they must be saved
* upon entry since the handler could be using them: thus, looking at the CPU
* registers would show the current system state and not the current *thread*'s
* state.
*
* Also, record the fact that the thread is currently interrupted so that VQEMU
* looks into the TCS and not the CPU registers to obtain the current thread's
* register values.
*
* NOTE:
* - must be called with interrupts locked
* - cannot use r0 without saving it first
*
* @return N/A
*/
SECTION_FUNC(TEXT, _GdbStubExcEntry)
ldr r1, =_kernel
ldr r2, [r1, #__tNANO_flags_OFFSET]
/* already in an exception, do not update the registers */
ldr r3, =EXC_ACTIVE
ands r3, r2
beq _GdbStubEditReg
bx lr
_GdbStubEditReg:
ldr r3, =EXC_ACTIVE
orrs r2, r3
str r2, [r1, #__tNANO_flags_OFFSET]
ldr r1, [r1, #__tNANO_current_OFFSET]
str r2, [r1, #__tTCS_flags_OFFSET]
/* save callee-saved + psp in TCS */
adds r1, #__tTCS_preempReg_OFFSET
mrs ip, PSP
#if defined(CONFIG_CPU_CORTEX_M0_M0PLUS)
/* Store current r4-r7 */
stmea r1!, {r4-r7}
/* copy r8-r12 into r3-r7 */
mov r3, r8
mov r4, r9
mov r5, r10
mov r6, r11
mov r7, ip
/* store r8-12 */
stmea r1!, {r3-r7}
#else /* CONFIG_CPU_CORTEX_M0_M0PLUS */
stmia r1, {v1-v8, ip}
#endif
bx lr
/**
*
* @brief Exception exit extra clean up when GDB_INFO is enabled
*
* Record the fact that the thread is not interrupted anymore so that VQEMU
* looks at the CPU registers and not into the TCS to obtain the current
* thread's register values. Only do this if this is not a nested exception.
*
* NOTE:
* - must be called with interrupts locked
* - cannot use r0 without saving it first
*
* @return N/A
*/
SECTION_FUNC(TEXT, _GdbStubExcExit)
#if !defined(CONFIG_CPU_CORTEX_M0_M0PLUS)
/* if we're nested (ie. !RETTOBASE), do not reset EXC_ACTIVE */
ldr r1, =_SCS_ICSR
ldr r1, [r1]
ands r1, #_SCS_ICSR_RETTOBASE
it eq
bxeq lr
#endif
ldr r1, =_kernel
ldr r2, [r1, #__tNANO_flags_OFFSET]
ldr r3, =EXC_ACTIVE
bics r2, r3
str r2, [r1, #__tNANO_flags_OFFSET]
ldr r1, [r1, #__tNANO_current_OFFSET]
str r2, [r1, #__tTCS_flags_OFFSET]
bx lr
/**
*
* @brief Stub for ISRs installed directly in vector table
*
* The kernel on Cortex-M3/4 can be configured so that ISRs
* are installed directly in the vector table for maximum efficiency.
*
* When OS-awareness is enabled, a stub must be inserted to invoke
* _GdbStubExcEntry() before the user ISR runs, to save the current task's
* registers. This stub thus gets inserted in the vector table instead of the
* user's ISR. The user's IRQ vector table gets pushed after the vector table
* automatically by the linker script: this is all transparent to the user.
* This stub must also act as a demuxer that find the running exception and
* invoke the user's real ISR.
*
* @return N/A
*/
SECTION_FUNC(TEXT, _irq_vector_table_entry_with_gdb_stub)
_GDB_STUB_EXC_ENTRY
mrs r0, IPSR /* get exception number */
subs r0, #16 /* get IRQ number */
ldr r1, =_irq_vector_table
/* grab real ISR at address: r1 + (r0 << 2) (table is 4-byte wide) */
lsls r3, r0, #2
ldr r1, [r1, r3]
/* jump to ISR, no return: ISR is responsible for calling _IntExit */
bx r1

View file

@ -1,38 +0,0 @@
/*
* Copyright (c) 2014 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @brief Stubs for IRQ part of vector table
*
* When GDB is enabled, the static IRQ vector table needs to install the
* _irq_vector_table_entry_with_gdb_stub stub to do some work before calling the
* user-installed ISRs.
*/
#include <toolchain.h>
#include <sections.h>
#include <arch/cpu.h>
typedef void (*vth)(void); /* Vector Table Handler */
#if defined(CONFIG_GDB_INFO) && !defined(CONFIG_SW_ISR_TABLE)
vth __gdb_stub_irq_vector_table _irq_vector_table_with_gdb_stub[CONFIG_NUM_IRQS] = {
[0 ...(CONFIG_NUM_IRQS - 1)] = _irq_vector_table_entry_with_gdb_stub
};
#endif /* CONFIG_GDB_INFO && !CONFIG_SW_ISR_TABLE */

View file

@ -53,8 +53,6 @@ GTEXT(_IntExit)
*/
SECTION_FUNC(TEXT, _isr_wrapper)
_GDB_STUB_EXC_ENTRY
push {lr} /* lr is now the first item on the stack */
#ifdef CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT
@ -124,5 +122,5 @@ _idle_state_cleared:
pop {lr}
#endif /* CONFIG_CPU_CORTEX_M0_M0PLUS */
/* exception return is done in _IntExit(), including _GDB_STUB_EXC_EXIT */
/* exception return is done in _IntExit() */
b _IntExit

View file

@ -55,8 +55,6 @@ GDATA(_kernel)
SECTION_FUNC(TEXT, __pendsv)
_GDB_STUB_EXC_ENTRY
#ifdef CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
/* Register the context switch */
push {lr}
@ -181,8 +179,6 @@ _thread_irq_disabled:
msr PSP, ip
_GDB_STUB_EXC_EXIT
/* exc return */
bx lr
@ -199,8 +195,6 @@ _thread_irq_disabled:
SECTION_FUNC(TEXT, __svc)
_GDB_STUB_EXC_ENTRY
#if CONFIG_IRQ_OFFLOAD
tst lr, #0x4 /* did we come from thread mode ? */
ite eq /* if zero (equal), came from handler mode */
@ -222,7 +216,7 @@ SECTION_FUNC(TEXT, __svc)
blx _irq_do_offload /* call C routine which executes the offload */
pop {lr}
/* exception return is done in _IntExit(), including _GDB_STUB_EXC_EXIT */
/* exception return is done in _IntExit() */
b _IntExit
_context_switch:
@ -241,8 +235,6 @@ _context_switch:
ldr r2, =_SCS_ICSR_PENDSV
str r2, [r1, #0]
_GDB_STUB_EXC_EXIT
/* handler mode exit, to PendSV */
bx lr
#endif /* !CONFIG_CPU_CORTEX_M0_M0PLUS */