Osekturbo OS/MGT5100 V.2.2.1
Total Page:16
File Type:pdf, Size:1020Kb
Freescale Semiconductor, Inc. OSEKturbo OS/MGT5100 v.2.2.1 Technical Reference Because of last-minute software changes, some information in this manual may be inaccurate. Please read the readme.txt file for the latest information. Revised: July 2002 For More Information: www.freescale.com Freescale Semiconductor, Inc. © 2002 MOTOROLA, ALL RIGHTS RESERVED Motorola reserves the right to make changes without further notice to any products herein to improve reliability, function or design. Motorola does not assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and ÿ are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Employment Opportunity/Affirmative Action Employer. Legal Notices The information in this document has been carefully checked and is believed to be entirely reliable, however, no responsibility is assumed for inaccuracies. Furthermore, Motorola reserves the right to make changes to any products herein to improve reliability, function or design. Motorola does not assume liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights or the rights of others. The software described in this document is furnished under a license agreement. The software may be used or copied only in accordance with the terms of the agreement. No part of this publication may be reproduced or transmitted in any form or by any means - graphic, electronic, electrical, mechanical, chemical, including photocopying, recording in any medium, taping, by any computer or information storage retrieval systems, etc., without prior permissions in writing from Motorola Inc. Permission is granted to reproduce and transmit the Problem Report Form, the Customer Satisfaction Survey, and the Registration Form to Motorola. Important Notice to Users While every effort has been made to ensure the accuracy of all information in this document, Motorola assumes no liability to any party for any loss or damage caused by errors or omissions or by statements of any kind in this document, its updates, supplements, or special editions, whether such errors are omissions or statements resulting from negligence, accident, or any other cause. Motorola further assumes no liability arising out of the application or use of any product or system described herein; nor any liability for incidental or consequential damages arising from the use of this document. Motorola disclaims all warranties regarding the information contained herein, whether expressed, implied or statutory, including implied warranties of merchantability or fitness for a particular purpose. Trademarks OSEK/VDX is a registered trademark of Siemens AG. Microsoft, MS-DOS and Windows are trademarks of Microsoft. UNIX is a trademark of AT&T Bell Laboratories. Diab Data, alone and in combination with D-AS, D-CC++, D-CC, D-F77 and D-LD are trademarks of Diab Data, Inc. SingleStep is a trademark of Software Development Systems, Inc. Metrowerks, the Metrowerks logo, CodeWarrior, and Software at Work are registered trademarks of Metrowerks Inc. PowerPlant and PowerPlant Constructor are trademarks of Metrowerks Inc. For More Information: www.freescale.com Freescale Semiconductor, Inc. Contents 1 Introduction 13 OSEKOSOverview.......................15 TypographicalConventions...................17 References...........................17 Definitions,AcronymsandAbbreviations.............18 TechnicalSupportInformation..................19 2 Operating System Architecture 21 ProcessingLevels........................21 ConformanceClasses......................22 OSEKOSOverallArchitecture..................24 Application Program Interface ..................26 3 Task Management 27 TaskConcept..........................27 ExtendedTasks.......................28 BasicTasks.........................30 TaskPriorities.........................31 TasksStacks..........................32 StackAllocation.......................32 SingleStack.........................32 ProgrammingIssues......................33 ConfigurationOptions....................33 DataTypes.........................33 TaskDefinition.......................33 Run-timeServices......................35 Constants..........................36 Conventions........................36 4 Scheduler 39 General............................39 SchedulingPolicy........................40 Non-preemptiveScheduling.................40 Full-preemptiveScheduling..................41 Mixed-preemptiveScheduling.................42 GroupsofTasks.......................43 ProgrammingIssues......................43 ConfigurationOptions....................43 OSEKturbo OS/MGT5100 TR–3 For More Information: www.freescale.com Freescale Semiconductor, Inc. Contents Run-timeServices......................44 5 Interrupt Processing 45 General............................45 ISRCategories.........................46 ISRCategory1.......................46 ISRCategory2.......................47 InterruptLevelManipulation..................48 ISRStack...........................48 InterruptDispatcher......................49 ProgrammingIssues......................49 ConfigurationOptions....................49 Run-timeServices......................49 Conventions........................51 ISRDefinition........................51 InterruptVectorDefinition..................52 6 Resource Management 53 General............................53 AccesstoResources.......................54 Restrictionswhenusingresources...............55 Priority Ceiling Protocol . .................55 SchedulerasaResource...................57 Internalresources........................57 ProgrammingIssues......................58 ConfigurationOption....................58 DataTypes.........................59 Run-timeServices......................59 ResourceDefinition.....................59 7 Counters and Alarms 61 General............................61 Counters...........................62 Alarms............................64 AlarmCallback.........................66 TimeScale...........................67 ProgrammingIssues......................67 ConfigurationOptions....................67 TR–4 OSEKturbo OS/MGT5100 For More Information: www.freescale.com Freescale Semiconductor, Inc. Contents DataTypes.........................67 CountersandAlarmGeneration................69 Run-timeServices......................71 Constants..........................71 8Events 73 General............................73 EventsandScheduling.....................74 ProgrammingIssues......................76 ConfigurationOptions....................76 DataTypes.........................76 EventsDefinition......................76 Run-timeServices......................77 9 Communication 79 MessageConcept........................79 UnqueuedMessages......................80 QueuedMessages.......................82 DataConsistency........................83 ProgrammingIssues......................83 ConfigurationOptions....................83 Identifiers.........................83 MessageDefinition.....................84 Run-timeServices......................84 CallbackFunction......................85 UsageofMessages......................85 10 Error Handling and Special Routines 87 General............................87 HookRoutines.........................87 ErrorHandling.........................92 ErrorInterface........................92 MacrosforErrorHook...................93 ExtendedStatus.......................94 PossibleErrorReasons....................94 Start-upRoutine........................94 Application Modes . ....................95 SystemShutdown.......................95 OSEKturbo OS/MGT5100 TR–5 For More Information: www.freescale.com Freescale Semiconductor, Inc. Contents ProgrammingIssues......................96 ConfigurationOptions....................96 11 System Configuration 97 General............................97 Application Configuration File . .................98 OILConcept..........................98 OILFile..........................98 OILFormat.........................99 ImplementationDefinition..................99 ImplementationDefinitionGrammar............99 Application Definition . .................102 ObjectDefinition.....................102 IncludeDirective.....................103 Comments........................103 FileStructure.......................103 ConfigurationFileRules...................104 12 System Objects Definition 105 General............................105 OSDefinition.........................106 GlobalSystemAttributes...................106 CPURelatedAttributes....................108