⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tc10gp.h

📁 UCOS II源码 内含SOURCE 解压后使用
💻 H
字号:
/* 
**
**	Created by Andre Gompel for uCOS-II port to Tricore
**	10/99 Updated for TC10GP
**	The same file is used for assembly and C
** Each register is described in 3 places:
**		C definition: as a C type and as an equate for asm statments from C
**	   	(work around C preprocessor discrepancy)
**		Assembly equate.
**
*/

#ifdef ACODE
.macro  LD_AREG	reg  addr
    movh.a   reg,%hi(addr)
    lea  reg,[reg]%lo(addr)
.endm

.macro  LD_DREG	reg, value
	movh 	reg,%hi(value)
	addi 	reg, reg,%lo(value)
.endm

;
; Warning the following macro always uses d15 (implicit for 16 bits load/store)
; 

.macro 	LD_IOREG16	reg, value16
	mov.u	d15, value16
	st.w	reg, d15
.endm



.macro	LD_IOREG32	reg, value32
	LD_DREG	d15, value32
	st.w	reg, d15
.endm



	.macro intvec isr,pty
	.globl	int_vect_><pty
int_vect_><pty:
	.type	int_vect_><pty,@function 
	svlcx32
	calla OSIntEnter					; This could be "inlined" here, as OSINtNesting++
	calla	isr							
	calla	OSIntExit
	rslcx32
	ld32.w	d15,%zdaoff(flg_sw)		; get flag word 
	jnz32.t	d15,0,OSCtxSw			; flag is bit zero 
	rfe32
	.endm


	.macro trapvec class, tsr
	.globl	trap_vect_><class
trap_vect_><class:
	.type	trap_vect_><class,@function 
	j32 tsr
	nop32
	nop32
	nop32
	nop32
	nop32
	nop32
	nop32
	.endm


	.macro trapdbg class
	.globl	trap_dbg_><class
trap_dbg_><class:
	.type	trap_dbg_><class,@function 
	debug32
	j32 	trap_dbg_><class
	nop32
	nop32
	nop32
	nop32
	nop32
	nop32
	.endm

	.macro trapend
	.word 0x7263694d
	.word 0x4f2f436f
	.word 0x43542053
	.word 0x50473031
	.word 0x726f7020
	.word 0x79622074
	.word 0x646e4120
	.word 0x47206572
	.word 0x65706d6f
	.word 0x000006c
	.endm
	

psw_prs	.equ	0x000000000		; PRS : Protection Register Set Selection
psw_io	.equ	0x000000800		; IO : I/O Access Permission Mode: 2=Supervisor mode.
psw_is	.equ	0x000000200		; IS : interrupt stak. 1=USe interrupt stack
psw_gw  	.equ	0x000000100		; GW : Global Register Write 1=permitted
psw_cde	.equ	0x000000080		; CDE : Call Depth Enable
psw_cdc	.equ	0x000000000		; CDC note 7F equ disabled
start_ctxts .equ 0xd0000000 	; DMU, 32kbytes


#endif	// ACODE



#ifdef __LANGUAGE_C
 								/* 
								**			Work around compiler bug: 
								**			does not reconize registers name in __asm statments
								*/
	#ifndef	C_ASM_EQ
		# define	C_ASM_EQ
		__asm("ICR	.equ	0xfffffe2c");
		__asm("PSW	.equ	0xfffffe04");
	#endif


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -