Host Interface (HIF) Specification Version 2.0
Total Page:16
File Type:pdf, Size:1020Kb
Host Interface (HIF) Specification Version 2.0 1 Host Interface (HIF) Specification, Version 2.0 E 1991, 1992, 1993 by Advanced Micro Devices, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Advanced Micro Devices, Inc. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subdivision (b)(3)(ii) of the Rights in Technical Data and Computer Software clause at 252.227–7013. Advanced Micro Devices, Inc., 5204 E. Ben White Blvd., Austin, TX 78741–7399. 29K, Am29000, Am29027, Am29030, Am29050, Am29200, Am29240, Am29243, Am29245, SA-29200, SA-29240, SD-29240, EB29K, EB29030 and MiniMON29K are trademarks of Advanced Micro Devices, Inc. High C is a registered trademark of MetaWare, Inc. MS-DOS is a registered trademark of Microsoft, Inc. UNIX is a registered trademark of AT&T Other product or brand names are used solely for identification and may be the trademarks or registered trademarks of their respective companies. The text pages of this document have been printed on recycled paper consisting of 50% recycled fiber and virgin fiber; the post-consumer waste content is 10%. These pages are recyclable. Advanced Micro Devices, Inc. 5204 E. Ben White Blvd. Austin, TX 78741–7399 2 Contents About This Specification How to Use This Documentation. vi About This Specification. vi Intended Audience. vi Reference Documents. vii Documentation Conventions. viii Chapter 1 Introduction HIF Applications. 1–3 HIF Users. 1–4 HIF Concepts. 1–5 Implementation Types. 1–7 Chapter 2 System Call Mechanism HIF Service Invocation. 2–3 User-Mode Traps. 2–6 Supervisor-Mode Traps. 2–7 Host Interface (HIF) Specification i 3 Chapter 3 HIF Service Routines Service 1 – exit: Terminate a Program. 3–7 Service 17 – open: Open a File. 3–8 Service 18 – close: Close a File. 3–14 Service 19 – read: Read a Buffer of Data from a File. 3–16 Service 20 – write: Write a Buffer of Data to a File. 3–19 Service 21 – lseek: Seek a File Byte. 3–22 Service 22 – remove: Remove a File. 3–25 Service 23 – rename: Rename a File. 3–26 Service 24 – ioctl: Input/Output Control. 3–28 Service 25 – iowait: Test and Wait I/O Complete. 3–32 Service 26 – iostat: Input/Output Status. 3–35 Service 33 – tmpnam: Return a Temporary Name. 3–37 Service 49 – time: Return Seconds Since 1970. 3–39 Service 65 – getenv: Get Environment. 3–41 Service 67 – gettz: Get Time Zone. 3–43 Service 257 – sysalloc: Allocate Memory Space. 3–45 Service 258 – sysfree: Free Memory Space. 3–46 Service 259 – getpsize: Return Memory Page Size. 3–48 Service 260 – getargs: Return Base Address. 3–49 Service 273 – clock: Return Time in Milliseconds. 3–51 Service 274 – cycles: Return Processor Cycles. 3–53 Service 289 – setvec: Set Trap Address. 3–55 Service 290 – settrap: Set Trap Vector. 3–57 Service 291 – setim: Set Interrupt Mask. 3–59 Service 305 – query: Return Version Information. 3–61 Service 321 – signal: Register Signal Handler. 3–64 Service 322 – sigdfl: Perform Default Signal Action. 3–68 Service 323 – sigret: Return From Signal Interrupt. 3–69 Service 324 – sigrep: Return From Signal Interrupt. 3–70 Service 325 – sigskp: Return From Signal Interrupt. 3–71 Service 326 – sendsig: Send Signal. 3–72 ii Host Interface (HIF) Specification 4 Chapter 4 Process Environment Startup Initialization. 4–2 Stack Allocation Sizes. 4–3 Program Termination. 4–3 Trap Handlers. 4–4 HIF-Conforming Application COFF Information. 4–5 Appendix A HIF Quick Reference HIF Quick Reference. A–1 Appendix B HIF Error Numbers HIF Error Numbers. B–1 Index Host Interface (HIF) Specification iii 5 Figures and Tables Figures Figure 1–1. HIF Interface. 1–2 Figure 3–1. HIF Register Preservation. 3–65 Tables Table 3–1. HIF Service Calls in Numerical Order. 3–3 Table 3–2. HIF Service Calls in Alphabetical Order. 3–4 Table 3–3. Service Call Parameters. 3–5 Table 3–4. Open Service Mode Parameters. 3–10 Table 3–5. Open Service Mode Parameters. 3–28 Table 3–6. Signals Handled. ..