source: trunk/libs/newlib/src/libgloss/bfin/include/sys/excause.h @ 524

Last change on this file since 524 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.3 KB
Line 
1/*
2 * The authors hereby grant permission to use, copy, modify, distribute,
3 * and license this software and its documentation for any purpose, provided
4 * that existing copyright notices are retained in all copies and that this
5 * notice is included verbatim in any distributions. No written agreement,
6 * license, or royalty fee is required for any of the authorized uses.
7 * Modifications to this software may be copyrighted by their authors
8 * and need not follow the licensing terms described here, provided that
9 * the new terms are clearly indicated on the first page of each file where
10 * they apply.
11 */
12
13/************************************************************************
14 *
15 * excause.h
16 *
17 * (c) Copyright 2001-2003 Analog Devices, Inc.  All rights reserved.
18 *
19 ************************************************************************/
20
21/*
22** Definitions of constants for the four user-level bits in EXCAUSE,
23** the field from SYSSTAT that is set when the EXCPT instruction is
24** invoked.
25*/
26
27#ifndef _EXCAUSE_H
28#define _EXCAUSE_H
29
30/*
31** Value 0x0 - exit program. (halt)
32** R0 => exit status.
33*/
34
35#define EX_EXIT_PROG    0x0
36
37/*
38** Value 0x1 - abnormal exit (abort)
39*/
40
41#define EX_ABORT_PROG   0x1
42
43/*
44** Value 0x2 - invoke system service.
45** R0 => command.
46** R1 => first arg
47** R2 => second arg
48*/
49
50#define EX_SYS_REQ      0x2
51
52/*
53** Available commands:
54*/
55
56#define EX_SYSREQ_NONE          0x00    /* Do nothing */
57#define EX_SYSREQ_REG_ISR       0x01    /* Register an interrupt handler.
58                                           R1==EVT entry, R2==func ptr
59                                           Returns previous entry in R0. */
60#define EX_SYSREQ_RAISE_INT     0x02    /* Cause an interrupt
61                                           R1 = int number */
62/*
63** Values 0x3 to 0x4 currently undefined.
64*/
65
66/*
67** Value 0x5 - File I/O
68** R0 => first arg
69** R1 => second arg
70** R2 => third arg
71** R4 => command
72** result => R0
73*/
74
75#define EX_FILE_IO 0x5
76
77/*
78** Available commands:
79** XXX stdout/stderr are handled separately for writing.
80*/
81
82#define EX_FILEIO_OPEN          0x00    /* R0 => dev, R1=> path, R2=>mode */
83#define EX_FILEIO_CLOSE         0x01    /* R0=> fid */
84#define EX_FILEIO_WRITE         0x02    /* R0=>fid, R1=>data, R2=>length */
85#define EX_FILEIO_READ          0x03    /* R0=>fid, R1=>data, R2=>length */
86#define EX_FILEIO_SEEK          0x04    /* R0=>fid, R1=>offset, R2=>mode */
87#define EX_FILEIO_DUP           0x05    /* R0=>fid */
88
89/*
90** Values 0x6 to 0xF currently undefined.
91*/
92
93#endif /*  _EXCAUSE_H */
Note: See TracBrowser for help on using the repository browser.