Rev 332 | Rev 344 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
332 | palkovsky | 1 | /* |
2 | * Copyright (C) 2005 Ondrej Palkovsky |
||
3 | * All rights reserved. |
||
4 | * |
||
5 | * Redistribution and use in source and binary forms, with or without |
||
6 | * modification, are permitted provided that the following conditions |
||
7 | * are met: |
||
8 | * |
||
9 | * - Redistributions of source code must retain the above copyright |
||
10 | * notice, this list of conditions and the following disclaimer. |
||
11 | * - Redistributions in binary form must reproduce the above copyright |
||
12 | * notice, this list of conditions and the following disclaimer in the |
||
13 | * documentation and/or other materials provided with the distribution. |
||
14 | * - The name of the author may not be used to endorse or promote products |
||
15 | * derived from this software without specific prior written permission. |
||
16 | * |
||
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
||
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
||
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
||
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
||
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
||
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||
27 | */ |
||
28 | |||
341 | jermar | 29 | #ifndef __mips32_ARC_H_ |
30 | #define __mips32_ARC_H_ |
||
332 | palkovsky | 31 | |
32 | #include <arch/types.h> |
||
33 | |||
34 | #define ARC_BASE_ADDR 0x1000; |
||
35 | #define ARC_MAGIC 0x53435241 |
||
36 | |||
37 | typedef struct { |
||
38 | } arc_component; |
||
39 | |||
40 | typedef struct { |
||
41 | __u16 year; |
||
42 | __u16 month; |
||
43 | __u16 day; |
||
44 | __u16 hour; |
||
45 | __u16 minutes; |
||
46 | __u16 seconds; |
||
47 | __u16 mseconds; |
||
48 | } arc_timeinfo ; |
||
49 | |||
50 | /* This is the SGI block structure, WinNT has it different */ |
||
51 | typedef enum { |
||
52 | ExceptionBlock, |
||
53 | SystemParameterBlock, |
||
54 | FreeContiguous, |
||
55 | FreeMemory, |
||
56 | BadMemory, |
||
57 | LoadedProgram, |
||
58 | FirmwareTemporary, |
||
59 | FirmwarePermanent |
||
60 | }arc_memorytype_t; |
||
61 | |||
62 | typedef struct { |
||
63 | arc_memorytype_t type; |
||
64 | __u32 basepage; /* *4096 = baseaddr */ |
||
65 | __u32 basecount; |
||
66 | }arc_memdescriptor_t; |
||
67 | |||
68 | typedef struct { |
||
69 | char vendorid[8]; |
||
70 | char prodid[8]; |
||
71 | }arc_sysid_t; |
||
72 | |||
73 | typedef struct { |
||
74 | long (*load)(void); /* ... */ |
||
75 | long (*invoke)(__u32 eaddr,__u32 saddr,__u32 argc,char **argv, |
||
76 | char **envp); |
||
77 | long (*execute)(char *path,__u32 argc,char **argv,char **envp); |
||
78 | void (*halt)(void); |
||
79 | void (*powerdown)(void); |
||
80 | void (*restart)(void); |
||
81 | void (*reboot)(void); |
||
82 | void (*enterinteractivemode)(void); |
||
83 | long (*reserved)(void); |
||
84 | /* 10 */ |
||
85 | arc_component * (*getpeer)(arc_component *c); |
||
86 | arc_component * (*getchild)(arc_component *c); |
||
87 | arc_component * (*getparent)(arc_component *c); |
||
88 | long (*getconfigurationdata)(void *configdata, arc_component *c); |
||
89 | long (*addchild)(arc_component *c, arc_component *template, |
||
90 | void *configdata); |
||
91 | long (*deletecomponet)(arc_component *current); |
||
92 | long (*getcomponent)(char *path); |
||
93 | long (*saveconfiguration)(void); |
||
94 | arc_sysid_t (*getsystemid)(void); |
||
95 | arc_memdescriptor_t * (*getmemorydescriptor)(arc_memdescriptor_t *cur); |
||
96 | /* 20 */ |
||
97 | long (*reserved2)(void); |
||
98 | arc_timeinfo * (*gettime)(void); |
||
99 | __u32 (*getrelativetime)(void); |
||
100 | long (*getdirectoryentry)(); |
||
101 | long (*open)(void); /* ... */ |
||
102 | long (*close)(__u32 fileid); |
||
103 | long (*read)(__u32 fileid,void *buf,__u32 n,__u32 *cnt); |
||
104 | long (*getreadstatus)(); |
||
105 | long (*write)(__u32 fileid, void *buf,__u32 n,__u32 *cnt); |
||
106 | long (*seek)(void); /* ... */ |
||
107 | /* 30 */ |
||
108 | long (*mount)(void); /* ... */ |
||
109 | char * (*getenvironmentvariable)(char *name); |
||
110 | char * (*setenvironmentvariable)(char *name, char *value); |
||
111 | long (*getfileinformation)(void); /* ... */ |
||
112 | long (*setfileinformation)(__u32 fileid,__u32 attflags,__u32 attmask); |
||
113 | void (*flushallcaches)(void); |
||
114 | long (*testunicodecharacter)(void); /* ... */ |
||
115 | long (*getdisplaystatus)(void); /* ... */ |
||
116 | } arc_func_vector_t; |
||
117 | |||
118 | typedef struct { |
||
119 | __u32 signature; |
||
120 | __u32 length; |
||
121 | __u16 version; |
||
122 | __u16 revision; |
||
123 | void *restartblock; |
||
124 | void *debugblock; |
||
125 | void *gevector; |
||
126 | void *utlbmissvector; |
||
127 | __u32 firmwarevectorlen; |
||
128 | arc_func_vector_t *firmwarevector; |
||
129 | __u32 privvectorlen; |
||
130 | void *privvector; |
||
131 | __u32 adaptercount; |
||
132 | }__attribute__ ((packed)) arc_sbp; |
||
133 | |||
134 | extern int init_arc(void); |
||
135 | extern void arc_print_memory_map(void); |
||
136 | extern int arc_enabled(void); |
||
137 | extern void arc_putchar(char ch); |
||
138 | |||
139 | #endif |