ExceptionandInterruptHandlinginARM.docx

上传人:b****2 文档编号:2744933 上传时间:2023-05-04 格式:DOCX 页数:19 大小:235.78KB
下载 相关 举报
ExceptionandInterruptHandlinginARM.docx_第1页
第1页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第2页
第2页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第3页
第3页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第4页
第4页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第5页
第5页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第6页
第6页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第7页
第7页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第8页
第8页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第9页
第9页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第10页
第10页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第11页
第11页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第12页
第12页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第13页
第13页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第14页
第14页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第15页
第15页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第16页
第16页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第17页
第17页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第18页
第18页 / 共19页
ExceptionandInterruptHandlinginARM.docx_第19页
第19页 / 共19页
亲,该文档总共19页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

ExceptionandInterruptHandlinginARM.docx

《ExceptionandInterruptHandlinginARM.docx》由会员分享,可在线阅读,更多相关《ExceptionandInterruptHandlinginARM.docx(19页珍藏版)》请在冰点文库上搜索。

ExceptionandInterruptHandlinginARM.docx

ExceptionandInterruptHandlinginARM

ExceptionandInterruptHandlinginARM

ArchitecturesandDesignMethodsforEmbeddedSystems

SummerSemester2006

Author:

AhmedFathyMohammedAbdelrazek

Advisor:

DominikLücke

Abstract

WediscussexceptionsandinterrupthandlingtechniquesinARMprocessorsandseehowtheARMarchitectureworksinthisareatoknowhowarethesetechniquessuitableforembeddedsystemstoachievethetimeconstraintsandsafetyrequirements.Exceptionandinterrupthandlingisacriticalissuesinceitaffectdirectlythespeedofthesystemandhowfastdoesthesystemrespondtoexternaleventsandhowdoesitdealwithmorethanoneexternaleventatthesametimebyassigningprioritiestotheseevents.

Tableofcontents

Abstract......................................................................................................................................2

Tableofcontents........................................................................................................................2

ListofFigures............................................................................................................................3

Abbreviations.............................................................................................................................3

1Introduction........................................................................................................................4

1.1ARMmodesofoperation......................................................................................4

1.2ARMRegisterset...................................................................................................5

................................................................................................................................................6

2ARMExceptions................................................................................................................6

2.1VectorTable..........................................................................................................7

2.2Exceptionpriorities................................................................................................8

2.3LinkRegisterOffset...............................................................................................8

2.4Enteringandexitinganexceptionhandler.............................................................9

3Interrupts............................................................................................................................9

3.1Howareinterruptsassigned?

.................................................................................9

3.2InterruptLatency..................................................................................................10

3.3IRQandFIQexceptions......................................................................................10

3.4Interruptstack......................................................................................................10

4Interrupthandlingschemes..............................................................................................11

4.1Non-nestedinterrupthandling.............................................................................11

4.1.1Non-nestedinterrupthandlingsummery:

....................................................................12

4.2Nestedinterrupthandling.....................................................................................12

4.2.1Nestedinterrupthandlingsummery:

...........................................................................13

4.3Prioritizedsimpleinterrupthandling...................................................................13

4.3.1Prioritizedsimpleinterrupthandlingsummery:

..........................................................14

4.4Otherschemes......................................................................................................15

5Finalremarks....................................................................................................................16

Whichinterrupthandlingschemetouse?

............................................................................16

References................................................................................................................................17

ListofFigures

Figure1:

RegisterOrganizationinARM[5]...............................................................................6

Figure2Anexactvectortablewiththebranchinginstruction[5]...............................................7

Figure3TypicalMemoryLayouts...........................................................................................11

Figure4Simplenonnestedinterrupthandlers.........................................................................12

Figure5NestedInterruptHandling.........................................................................................13

Figure6PriorityInterruptHandler[1].......................................................................................14

Abbreviations

ISRInterruptServiceRoutine

Interrupt

Request

FIQFastInterruptRequest

ARMAdvancedRISCMachines

RISCReducedInstructionSetComputers

CPSRCurrentProgramStatusRegister

SPSRSavedProgramStatusRegister

Register

Register

DMADirectMemoryAccess

1Introduction

Exceptionsaresoimportantinembeddedsystems,withoutexceptionthedevelopmentofsystemswouldbeaverycomplextask.Withexceptionswecandetectbugsintheapplication,errorsinmemoryaccessandfinallydebugitbyplacingbreakpointsandbuildingtheprogramwithdebugginginformation.

Interruptswhicharekindsofexceptionsareessentialinembeddedsystems.ItenablesthesystemtodealwithexternaleventsbyreceivinginterruptsignalstellingtheCPUthatthereissomethingtobedoneinsteadofthealternativewayofdoingthesameoperationbythepoolingmechanismwhichwastestheCPUtimeinloopingforevercheckingsomeflagstoknowthattheeventoccurred.

Duetothefactthatsystemsaregoingmorecomplexdayafterday,wehavenowadayssystemswithmorethanoneinterruptsource.Thatiswhyaninterrupthandlingschemeisneededtodefinehowdifferentcaseswillbehandled.Wemayneedprioritiestobeassignedtodifferentinterruptsandinsomeothercaseswemayneednestedhandlingcapabilities.

WeintroducetheARMprocessoritselftoseeitsdifferentmodesofoperationandthenwehaveanoverviewoftheregisterset.ThisisbecausedealingwithinterruptsandexceptionscausestheARMcoretoswitchbetweenthesemodesandcopysomeoftheregistersintootherregisterstosafethecorestatebeforeswitchingtothenewmode.InthenextchapterweintroduceexceptionsandseehowtheARMprocessorhandlesexceptions.InthethirdchapterwedefineinterruptsanddiscussmechanismsofinterrupthandlingonARM.Intheforthchapterweprovideasetofstandardinterrupthandlingschemes.Andfinallysomeremarksregardingtheseschemesandwhichoneissuitabletowhichapplication.

Themainsourceofinformationprovidedinthispaperismainlythebook“ARMSystemDeveloper’sGuide”[1].

1.1ARMmodesofoperation

TheARMprocessorinternallyhas7differentmodesofoperation,theyareasfollows;Usermode:

Itisusedfornormalprogramexecutionstate,FIQmode:

ThismodeisusedforinterruptsrequiringfastresponseandlowlatencylikeforexampledatatransferwithDMA,IRQmode:

Thismodeisusedforgeneralinterruptservices,Supervisormode:

Thismodeisusedwhenoperatingsystemsupportisneededwhereitworksasprotectedmode,Abortmode:

selectedwhendataorinstructionfetchisaborted,systemmode:

Operatingsystemprivilegemodeforusersandundefinedmode:

Whenundefinedinstructionisfetched.Thefollowingtablesummarizesthe7modes:

ProcessorMode

User(usr)

FIQ(fiq)

IRQ(irq)

Supervisor(svc)

Abort(abt)

Undefined(und)

System(sys)

DescriptionNormalprogramexecutionmodeFastdataprocessingmodeForgeneralpurposeinterruptsAprotectedmodefortheoperatingsystemWhendataorinstructionfetchisabortedForundefinedinstructionsOperatingsystemprivilegedmode

1.2ARMRegisterset

RegisterstructureinARMdependsonthemodeofoperation.Forexamplewehave16(32-bit)registersnamedfromR0toR15inARMmode(usr).

RegistersR0toR12aregeneralpurposeregisters,R13isstackpointer(SP),R14issubroutinelinkregisterandR15isprogramcounter(PC).

R16isthecurrentprogramstatusregister(CPSR)thisregisterissharedbetweenallmodesanditisusedbytheARMcoreallthetimeanditplaysamainroleintheprocessofswitchingbetweenmodes.

Inothermodessomeofthese16registersarevisibleandcanbeaccessedandsomeothersarenotvisibleandcan’tbeaccessed.Alsosomeregistersareavailablewiththesamenamebutasanotherphysicalregisterinmemorywhichiscalled(banked),existenceofsuchbankedregistersdecreasestheeffortneededwhencontextswitchingisrequiredsincethenewmodehasitsownphysicalregisterspaceandnoneedtostoretheoldmode’sregistervalues.

SoinARM7wehaveatotalof37physicalregistersandthefollowingfigureshowstheARM7registerset.

Morebanked

registers,so

isfaster

Figure1:

RegisterOrganizationinARM[5]

Aswecanseethebankedregistersaremarkedwiththegraycolour.WecannoticethatintheFIQmodetherearemorebankedregisters,thisistospeedupthecontextswitchingsincetherewillbenoneedtostoremanyregisterswhenswitchingtotheFIQmode.Wemayneedonlytostorethevaluesofregistersr0tor7iftheFIQhandlerneedstousethoseregisters,butregistersr8_fiqtor14_fiqarespecificregistersfortheFIQmodeand

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 设计艺术

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2