Files
ThreadX4TGFS/port/threadx_smp/src/trap_entry.S
T
alex 054251f810 Test upstream RISC-V SMP candidates on HERE VP
Build the SMP library and Moonlight board support against a selectable ThreadX source tree. Keep the pinned regression matrix and add RV32GC and RV64GC context tests. Adapt the direct timeout fixture to the RV64 timer extension and give timing-sensitive cases more phase coverage on HERE VP.
2026-11-27 11:13:06 +01:00

83 lines
4.3 KiB
ArmAsm

/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
.section .text
.align 4
#include "tx_port.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* trap_entry RISC-V64/GNU */
/* 6.2.1 */
/* AUTHOR */
/* */
/* Jer6y , luojun@oerv.isrc.iscas.ac.cn */
/* */
/* DESCRIPTION */
/* */
/* This function is responsible for riscv processor trap handle */
/* It will do the contex save and call c trap_handler and do contex */
/* load */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* trap_handler */
/* */
/* CALLED BY */
/* */
/* hardware exception */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 10-25-2024 Jerry Luo */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Initialize */
/** */
/**************************************************************************/
/**************************************************************************/
.balign 4
.global trap_entry
.type trap_entry, @function
trap_entry:
addi sp, sp, -TX_RISCV_TRAP_FRAME_SIZE
#if __riscv_xlen == 64
sd ra, 28*8(sp)
#else
sw ra, 28*4(sp)
#endif
call _tx_thread_context_save
csrr a0, mcause
csrr a1, mepc
csrr a2, mtval
call trap_handler
tail _tx_thread_context_restore
.weak trap_handler
trap_handler:
j trap_handler