亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nios_isrmanager.s

?? 基于fpga和sopc的用VHDL語言編寫的EDA的32位Nios CPU嵌入式系統(tǒng)及其DMA設(shè)計俄羅斯方塊游戲機
?? S
字號:

	.include "nios_macros.s"
	.text
	.global nr_installuserisr
	.global nr_installuserisr2

;-------------------------------
; void nr_installuserisr(int trapNumber, nios_isrhandlerproc *trapProc, int context);
; void nr_installuserisr2(int trapNumber, nios_isrhandlerproc2 *trapProc, int context);
;
; Definition: "System ISR" -- the routine pointed to in
;             the vector table. It cannot easily call other routines,
;             and traps are disabled.
;
;             "User ISR" -- A normal routine with normal
;             facilities; the only difference from a normal (noninterrupt)
;             routine is that it can only be itself interrupted by
;             a higher priority (lower numbered) interrupt.
;
; This installs a trap handler for a particular trap number, and
; ensures that the trap handler (trapProc) is called with
; interrupts reenabled (for interrupts of higher priority only),
; and passed its necessary "context" value, which can be anything.
;
; The two names are synonyms for the same routine -- but one
; is typed to accept a nios_isrhandlerproc2, which has additional
; arguments. The arguments are always passed, but would be ignored
; by original nios_isrhandlerproc-prototype routines.
;
;----------------------------------------
;         Name: nr_installuserisr
;  Description: Install a trap routine
;        Input: %o0 = trap number
;               %o1 = trap handler routine
;               %o2 = context to be passed to handler
;       Output: none
; Side Effects: %g0 & %g1 altered
;    CWP Depth: 0
;

.ifdef __nios32__
	.equ nmul,2
.else
	.equ nmul,1
.endif

.equ _ISRManagerDebugging_,0

nr_installuserisr:
nr_installuserisr2:
	MOV	%g0,%o0			; %g0 = Trap Number
	LSLI	%g0,nmul		; (2 on n32, 1 on n16) %g0 = offset into vector table

	MOVIA	%g1,_ns_userisrfunnel@h	; %g1 = funnel for the user trap handlers
	MOVIA	%g2,nasys_vector_table	; %g2 -> vector table
	ADD	%g2,%g0			; %g2 -> entry for this trap in vector table
	LSLI	%g0,1			; our info table is 2 words per trap...
	MOVIA	%g3,_nr_userisrtable
	ADD	%g3,%g0			; %g3 -> entry in our User ISR Table

	ST	[%g3],%o1		; Store the handler routine...
	PFX	1
	ST	[%g3],%o2		; Store the handler routine's context.

	ST	[%g2],%g1		; install the funnel proc last, of course, safety.

	JMP	%o7
	NOP

	.comm	_nr_userisrtable,64*2*2*nmul,4	; two words per 64 ISR's: proc & context

.equ __nios_flat__, 1	; comment this line out to use the normal register windowed isr manager

.if __nios_flat__

;  
; ISR funnel handler for non-flat systems running flat and/or non-flat code.  
;
; THIS IS NOT FULLY TESTED
;
.equ FLAT_STACK_SPACE, 	((24+19)*2*nmul)

_ns_userisrfunnel:

	SUBIP	%fp,FLAT_STACK_SPACE	; space to save the %g registers, ISTATUS, %o0, & return
	MOV	%sp,%fp			; let %sp=%fp, till we RESTORE.

	;
	; Save the globals: ISR may use them.
	;
	STS	[%sp,24+0],%g0
	STS	[%sp,24+1],%g1
	STS	[%sp,24+2],%g2
	STS	[%sp,24+3],%g3
	STS	[%sp,24+4],%g4
	STS	[%sp,24+5],%g5
	STS	[%sp,24+6],%g6
	STS	[%sp,24+7],%g7

	;
	; Save the return address to the interruptee, across the RESTORE
	;
	MOV	%g4,%o7

	RESTORE
	;
	; Save trap return address: calling
	; the user ISR will alter it.
	;
	STS	[%sp,24+8],%g4			; save the trap return address

	;
	; Save CTL1, ISTATUS, so we can later TRET
	;
	PFX	1				; CTL1 = ISTATUS
	RDCTL	%g0
	STS	[%sp,24+9],%g0			; save ISTATUS
	
        ; Save %o's, except %sp (%o6)
        STS    	[%sp,24+10],%o0
        STS    	[%sp,24+11],%o1
        STS    	[%sp,24+12],%o2
        STS    	[%sp,24+13],%o3
        STS    	[%sp,24+14],%o4
        STS    	[%sp,24+15],%o5
        STS    	[%sp,24+16],%o7
        
        ; Save %i7 and %fp
	STS	[%sp,24+17],%i7
        STS    	[%sp,24+18],%fp
        
	;
	; Find the user ISR in our table, and its context
	;

	RDCTL	%g5
	LSRI	%g5,9
	ANDIP	%g5,0x003f			; %g5 = irq number now

	MOV	%g0,%g5
.ifdef __nios32__
	LSLI	%g0,3
.else
	LSLI	%g0,2				; %g0 = offset into user isr table
.endif

	MOVIA	%g1,_nr_userisrtable
	ADD	%g0,%g1				; %g1 -> (proc,context) for this trap...
	LD	%g2,[%g0]			; %g2 = proc to call
	PFX	1
	LD	%o0,[%g0]			; %o0 = context for that proc

	;
	; Enable Interrupts
	;

	PFX 9
	WRCTL	%g0				; (value doesn't matter)

	;
	; And call the user ISR
	; user_isr_proc(context, irq_number, interruptee_pc)
	;

	MOV	%o1,%g5
	CALL	%g2
	MOV	%o2,%g4

	;
	; Disable interrupts.
	;

	PFX	8
	WRCTL	%g0			   

	; Assume %sp is not clobbered.  Flat code restores it, non-flat
        ; code uses it as %fp.

        ; Save %o's, except %sp (%o6)
        LDS    	%o0,[%sp,24+10]
        LDS    	%o1,[%sp,24+11]
        LDS    	%o2,[%sp,24+12]
        LDS    	%o3,[%sp,24+13]
        LDS    	%o4,[%sp,24+14]
        LDS    	%o5,[%sp,24+15]
        LDS    	%o7,[%sp,24+16]
        
        ; Save %i7 and %fp
	LDS	%i7,[%sp,24+17]
        LDS    	%fp,[%sp,24+18]

	;
	; To return from the interrupt, we must
	; restore all registers (%g's, ISTATUS, %i0)
	;
	; And, we have to bump the CWP down, for
	; only one reason: we need a register to load
	; with the address to return to from the
	; interrupt via TRET.
	;

	RDCTL	%g0
	SUBIP	%g0,0x0010		; CWP = what it was when we arrived at system ISR here.
	WRCTL	%g0			; (virtual SAVE: CWP -= 1)
	NOP				; curious WRCTL delay slot

	;
	; Restore some registers
	;

	MOV	%sp,%fp
	ADDIP	%fp,FLAT_STACK_SPACE		; Set interruptee's stack pointer to what it was.

	LDS	%o7,[%sp,24+8]			; restore the trap return address

	LDS	%g0,[%sp,24+9]			; get old ISTATUS
	PFX	1				; CTL1 = ISTATUS
	WRCTL	%g0				; and put it in.

	LDS	%g0,[%sp,24+0]			; restore all them %g registers
	LDS	%g1,[%sp,24+1]
	LDS	%g2,[%sp,24+2]
	LDS	%g3,[%sp,24+3]
	LDS	%g4,[%sp,24+4]
	LDS	%g5,[%sp,24+5]
	LDS	%g6,[%sp,24+6]
	LDS	%g7,[%sp,24+7]

	TRET	%o7

	NOP

.else

; NON-FLAT CPU
;
; This "user ISR funnel" code is a sort
; of tricky. A trap or interrupt bumps
; the CWP down one, and stores the old
; PC value in (new CWP's) %o7, the old
; processor STATUS into ISTATUS, and
; transfers control here.
;
; What we'll do is:
;   Preserve the %g registers on the stack,
;   Preserve ISTATUS on the stack,
;   Preserve the return address on the stack
;
;   Bump CWP up one
;   Reenable interrupts (for anything higher
;   priority than we're handling)
;
;   Execute a normal CALL to the user ISR
;
;   (Do the opposite of the above)
;   TRET %o7.
;
; Stack frame looks like:
;
;      sp[24+13] = %i7		(we alter %i7 when we CALL -- it's the ISR's return addr!)
;      sp[24+12] = %i0		(we alter %i0 to pass context to ISR.)
;      sp[24+11] = %i0		(we alter %i0 to pass context to ISR.)
;      sp[24+10] = %i0		(we alter %i0 to pass context to ISR.)
;      sp[24+9] = ISTATUS
;      sp[24+8] = RETURN ADDRESS
;      sp[24+7] = %g7
;      sp[24+...] = ...
;      sp[24+0] = %g0
;      sp[0..15] = space for CWP Underflow, as usual.
;                  there's already space for it, of course, but second-guessing where
;                  the C-compiler put stuff and offsetting more is too tedious, so we
;                  just bump further down.
;      ----sp----

_ns_userisrfunnel:

	SUBIP	%fp,(24+14)*2*nmul	; space to save the %g registers, ISTATUS, %o0, & return
	MOV	%sp,%fp			; let %sp=%fp, till we RESTORE.

	;
	; Save the globals: ISR may use them.
	;
	STS	[%sp,24+0],%g0
	STS	[%sp,24+1],%g1
	STS	[%sp,24+2],%g2
	STS	[%sp,24+3],%g3
	STS	[%sp,24+4],%g4
	STS	[%sp,24+5],%g5
	STS	[%sp,24+6],%g6
	STS	[%sp,24+7],%g7

	;
	; Save the return address to the interruptee, across the RESTORE
	;
	MOV	%g4,%o7

	RESTORE
	;
	; CWP is now in the interruptee's level.
	; Tread lightly.
	;

	;
	; Save trap return address: calling
	; the user ISR will alter it.
	;
	STS	[%sp,24+8],%g4			; save the trap return address

	;
	; Save CTL1, ISTATUS, so we can later TRET
	;
	PFX	1				; CTL1 = ISTATUS
	RDCTL	%g0
	STS	[%sp,24+9],%g0			; save ISTATUS

	;
	; Save %o0, since we pass an argument there.
	;
	STS	[%sp,24+10],%o0			; save %o0, which we use to pass context.
	STS	[%sp,24+11],%o1			; save %o1, which we use to pass context.
	STS	[%sp,24+12],%o2			; save %o2, which we use to pass context.

	;
	; Save %o7, since it's not ours, yet we're
	; doing a CALL, which puts return address
	; into %o7.
	;
	STS	[%sp,24+13],%o7

	;
	; Reenable interrupts: this is the earliest opportunity.
	;

	;PFX	9
	;WRCTL	%g0				; (value doesn't matter)

	;
	; Find the user ISR in our table, and its context
	;

	RDCTL	%g5

	LSRI	%g5,9
	ANDIP	%g5,0x003f			; %g5 = irq number now

	MOV	%g0,%g5
.ifdef __nios32__
	LSLI	%g0,3
.else
	LSLI	%g0,2				; %g0 = offset into user isr table
.endif

	MOVIA	%g1,_nr_userisrtable
	ADD	%g0,%g1				; %g1 -> (proc,context) for this trap...
	LD	%g2,[%g0]			; %g2 = proc to call
	PFX	1
	LD	%o0,[%g0]			; %o0 = context for that proc

	;
	; Enable Interrupts
	;

	PFX 9
	WRCTL	%g0				; (value doesn't matter)

	;
	; And call the user ISR
	; user_isr_proc(context, irq_number, interruptee_pc)
	;

	MOV	%o1,%g5
	CALL	%g2
	MOV	%o2,%g4

	;
	; Disable interrupts.
	;

	PFX	8
	WRCTL	%g0				; (value doesn't matter)

	;
	; To return from the interrupt, we must
	; restore all registers (%g's, ISTATUS, %i0)
	;
	; And, we have to bump the CWP down, for
	; only one reason: we need a register to load
	; with the address to return to from the
	; interrupt via TRET.
	;

	RDCTL	%g0
	SUBIP	%g0,0x0010		; CWP = what it was when we arrived at system ISR here.
	WRCTL	%g0			; (virtual SAVE: CWP -= 1)
	NOP				; curious WRCTL delay slot

	;
	; Restore some registers
	;

	MOV	%sp,%fp
	ADDIP	%fp,(24+14)*2*nmul		; Set interruptee's stack pointer to what it was.

	LDS	%o7,[%sp,24+8]			; restore the trap return address

	LDS	%g0,[%sp,24+9]			; get old ISTATUS
	PFX	1				; CTL1 = ISTATUS
	WRCTL	%g0				; and put it in.

	LDS	%i0,[%sp,24+10]			; restore %i0, which we corrupted passing context.
	LDS	%i1,[%sp,24+11]			; restore %i1, which we corrupted passing context.
	LDS	%i2,[%sp,24+12]			; restore %i2, which we corrupted passing context.
	LDS	%i7,[%sp,24+13]			; restore %i7, which we corrupted passing context.

	LDS	%g0,[%sp,24+0]			; restore all them %g registers
	LDS	%g1,[%sp,24+1]
	LDS	%g2,[%sp,24+2]
	LDS	%g3,[%sp,24+3]
	LDS	%g4,[%sp,24+4]
	LDS	%g5,[%sp,24+5]
	LDS	%g6,[%sp,24+6]
	LDS	%g7,[%sp,24+7]

	TRET	%o7

	NOP
        
.endif ; __nios_flat__

; end of file

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人网在线免费视频| 亚洲成人一区在线| 国产精品一区一区三区| 久久日韩精品一区二区五区| 秋霞午夜av一区二区三区| 日韩一二三四区| 国产一区二区女| 国产精品视频线看| 99国产精品久久久久| 一区二区三区四区高清精品免费观看| 在线观看日产精品| 蜜桃精品在线观看| 国产午夜一区二区三区| 91在线免费播放| 日韩va亚洲va欧美va久久| 2024国产精品视频| 99久久er热在这里只有精品15| 一个色综合av| 精品99999| 色综合久久久久综合体| 日本女优在线视频一区二区| 久久一夜天堂av一区二区三区| 成人av电影免费观看| 亚洲国产日韩一级| 久久久久久9999| 在线观看91视频| 国产资源精品在线观看| 亚洲精品成人在线| 日韩无一区二区| 色综合久久综合网欧美综合网| 免播放器亚洲一区| 亚洲日本免费电影| 久久综合狠狠综合久久综合88| 91福利在线播放| 国产一区二区伦理片| 一区二区三区中文免费| 久久久无码精品亚洲日韩按摩| 色诱亚洲精品久久久久久| 老司机精品视频在线| 亚洲裸体xxx| 国产校园另类小说区| 欧美精品丝袜久久久中文字幕| 成人免费视频视频| 蜜臀av国产精品久久久久 | 国产福利91精品一区二区三区| 亚洲毛片av在线| 国产午夜精品福利| 91精品一区二区三区在线观看| 99精品1区2区| 国产成人午夜电影网| 人人超碰91尤物精品国产| 亚洲自拍另类综合| 国产精品福利一区| 久久久无码精品亚洲日韩按摩| 欧美精品精品一区| 91久久精品一区二区三区| 国产91精品一区二区| 麻豆精品在线看| 天天av天天翘天天综合网色鬼国产| 国产精品乱码妇女bbbb| 久久人人97超碰com| 欧美一级二级在线观看| 欧美日韩成人在线一区| 欧美午夜电影网| 色老汉一区二区三区| 白白色 亚洲乱淫| 国产a久久麻豆| 国产美女视频一区| 国产制服丝袜一区| 六月丁香婷婷久久| 久久精品国产精品亚洲精品| 日本女人一区二区三区| 丝袜美腿亚洲一区| 日本欧美韩国一区三区| 高清不卡在线观看| 国产一区在线视频| 国产在线观看一区二区| 国产乱国产乱300精品| 国产一区二区三区在线观看免费视频| 久久99国产精品久久99| 久久不见久久见免费视频7 | 国产成人h网站| 国产一区二区91| 国精产品一区一区三区mba桃花| 美女精品一区二区| 激情综合色播五月| 国产乱码一区二区三区| 国产91精品露脸国语对白| 成人在线综合网| 91丨porny丨在线| 91久久精品日日躁夜夜躁欧美| 色哟哟在线观看一区二区三区| 在线精品视频一区二区| 91麻豆精品国产91久久久久久久久| 91精品国产手机| 久久久三级国产网站| 中文字幕一区在线| 亚洲第一在线综合网站| 日本不卡视频在线观看| 国产又黄又大久久| 99精品欧美一区二区蜜桃免费 | 亚洲精品成人天堂一二三| 亚洲高清免费视频| 久久99精品视频| www.日韩大片| 欧美日韩你懂得| 久久亚洲精华国产精华液| 国产精品护士白丝一区av| 亚洲综合一区二区三区| 久久精品国内一区二区三区| 成人综合婷婷国产精品久久蜜臀| 色婷婷亚洲婷婷| 日韩一级免费观看| 1024成人网色www| 秋霞成人午夜伦在线观看| 成人免费视频视频| 777精品伊人久久久久大香线蕉| 国产亚洲成av人在线观看导航 | 天天影视色香欲综合网老头| 韩国一区二区在线观看| 91久久精品国产91性色tv | 久久婷婷久久一区二区三区| 国产精品久久久久一区| 奇米亚洲午夜久久精品| a4yy欧美一区二区三区| 日韩欧美国产电影| 亚洲欧美另类综合偷拍| 国内一区二区视频| 在线亚洲免费视频| 美女网站视频久久| 91免费视频网址| 2024国产精品| 日本系列欧美系列| 色妞www精品视频| 国产视频一区二区三区在线观看| 亚欧色一区w666天堂| 波多野结衣欧美| 精品国产a毛片| 日韩国产成人精品| 91久久精品一区二区二区| 久久精品无码一区二区三区| 日韩专区中文字幕一区二区| 91日韩一区二区三区| 久久精品一二三| 久久99精品久久久| 8x8x8国产精品| 亚洲大片一区二区三区| 97久久超碰国产精品电影| 久久久久久久久久久久久久久99| 五月婷婷综合激情| 欧美艳星brazzers| 亚洲精品少妇30p| 99久久精品免费| 国产精品久久久久三级| 国产成人免费视频网站高清观看视频 | 石原莉奈在线亚洲三区| 91网站视频在线观看| 中文字幕免费一区| 国产精品综合一区二区三区| 欧美成人午夜电影| 蜜桃视频在线观看一区| 欧美一区二区视频免费观看| 午夜精品久久久久影视| 欧美日韩国产精选| 亚洲成人tv网| 欧美老女人第四色| 三级影片在线观看欧美日韩一区二区| 欧美在线观看一区二区| 亚洲自拍另类综合| 欧美日韩国产123区| 亚洲国产精品久久久久秋霞影院| 欧洲av一区二区嗯嗯嗯啊| 久久精品国产成人一区二区三区 | 日韩一区二区精品| 久99久精品视频免费观看| 精品三级在线看| 国内精品免费在线观看| 国产午夜久久久久| 成人国产免费视频| 一区二区三区中文在线观看| 欧美色男人天堂| 美女视频网站黄色亚洲| 久久综合九色综合欧美亚洲| 成人免费毛片片v| 亚洲精品老司机| 欧美日本国产视频| 精品一区二区三区蜜桃| 中文字幕精品在线不卡| 91日韩在线专区| 亚洲不卡在线观看| 精品国产乱子伦一区| 成人综合婷婷国产精品久久免费| 亚洲日本免费电影| 911精品产国品一二三产区| 激情亚洲综合在线| 亚洲欧洲韩国日本视频| 欧美日韩中文一区| 国产一区二区h| 亚洲一区二区三区四区的| 日韩欧美的一区|