arch/sparc: Add g_tcb_info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-07-25 21:26:14 +08:00 committed by Alin Jerpelea
parent 94f273130e
commit 7ca4c916eb
2 changed files with 93 additions and 1 deletions

View File

@ -25,7 +25,7 @@ CMN_CSRCS += sparc_getintstack.c sparc_idle.c sparc_initialize.c
CMN_CSRCS += sparc_lowputs.c sparc_mdelay.c sparc_modifyreg8.c
CMN_CSRCS += sparc_modifyreg16.c sparc_modifyreg32.c sparc_nputs.c
CMN_CSRCS += sparc_releasestack.c sparc_stackframe.c
CMN_CSRCS += sparc_udelay.c sparc_usestack.c
CMN_CSRCS += sparc_udelay.c sparc_usestack.c sparc_tcbinfo.c
# Configuration-dependent common files

View File

@ -0,0 +1,92 @@
/****************************************************************************
* arch/sparc/src/common/sparc_tcbinfo.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/sched.h>
#include <arch/irq.h>
/****************************************************************************
* Private Data
****************************************************************************/
static const uint16_t g_reg_offs[] =
{
UINT16_MAX, /* G0 */
TCB_REG_OFF(REG_G1), /* G1 */
TCB_REG_OFF(REG_G2), /* G2 */
TCB_REG_OFF(REG_G3), /* G3 */
TCB_REG_OFF(REG_G4), /* G4 */
TCB_REG_OFF(REG_G5), /* G5 */
TCB_REG_OFF(REG_G6), /* G6 */
TCB_REG_OFF(REG_G7), /* G7 */
TCB_REG_OFF(REG_O0), /* O0 */
TCB_REG_OFF(REG_O1), /* O1 */
TCB_REG_OFF(REG_O2), /* O2 */
TCB_REG_OFF(REG_O3), /* O3 */
TCB_REG_OFF(REG_O4), /* O4 */
TCB_REG_OFF(REG_O5), /* O5 */
TCB_REG_OFF(REG_O6), /* O6 */
TCB_REG_OFF(REG_O7), /* O7 */
TCB_REG_OFF(REG_L0), /* L0 */
TCB_REG_OFF(REG_L1), /* L1 */
TCB_REG_OFF(REG_L2), /* L2 */
TCB_REG_OFF(REG_L3), /* L3 */
TCB_REG_OFF(REG_L4), /* L4 */
TCB_REG_OFF(REG_L5), /* L5 */
TCB_REG_OFF(REG_L6), /* L6 */
TCB_REG_OFF(REG_L7), /* L7 */
TCB_REG_OFF(REG_I0), /* I0 */
TCB_REG_OFF(REG_I1), /* I1 */
TCB_REG_OFF(REG_I2), /* I2 */
TCB_REG_OFF(REG_I3), /* I3 */
TCB_REG_OFF(REG_I4), /* I4 */
TCB_REG_OFF(REG_I5), /* I5 */
TCB_REG_OFF(REG_I6), /* I6 */
TCB_REG_OFF(REG_I7), /* I7 */
};
/****************************************************************************
* Public Data
****************************************************************************/
const struct tcbinfo_s g_tcbinfo =
{
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
};
/****************************************************************************
* Public Functions
****************************************************************************/