10.07.2015 Views

PDF version - ARM Information Center

PDF version - ARM Information Center

PDF version - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

프로세서 예외 처리PCBpointerr14r13r12r11r10r9r8r7r6r5r4r3r2r1r0lrspsrUser moderegisters그림 6-2 PCB 레이아웃R12는 실행할 다음 프로세스의 PCB에 대한 포인터를 가리키며 목록의 끝에는 0포인터가 있습니다. 레지스터 R13은 PCB에 대한 포인터로, 일정 시간마다 저장되므로 진입 시점에서는 현재 실행하고 있는 프로세스의 PCB를 가리킵니다.예제 6-7 사용자 모드 프로세스에 대한 컨텍스트 전환STM sp,{R0-lr}^ ; Dump user registers above R13.MRS R0, SPSR ; Pick up the user statusSTMDB sp, {R0, lr} ; and dump with return address below.LDR sp, [R12], #4 ; Load next process info pointer.CMP sp, #0 ; If it is zero, it is invalidLDMDBNE sp, {R0, lr}; Pick up status and return address.MSRNE SPSR_cxsf, R0 ; Restore the status.LDMNE sp, {R0 - lr}^ ; Get the rest of the registersNOPSUBSNE pc, lr, #4; and return and restore CPSR.; Insert "no next process code" here.6.2.8 SVC 처리기예외 처리기에서는 예외가 발생할 때 프로세서가 <strong>ARM</strong> 상태에 있었는지 아니면Thumb 상태에 있었는지를 확인해야 할 수 있습니다.<strong>ARM</strong> DUI 0203IK Copyright © 2002-2008 <strong>ARM</strong> Limited. All rights reserved. 6-19Unrestricted AccessNon-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!