Subversion Repositories HelenOS-historic

Rev

Rev 341 | Rev 345 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 341 Rev 344
1
/*
1
/*
2
 * Copyright (C) 2005 Ondrej Palkovsky
2
 * Copyright (C) 2005 Ondrej Palkovsky
3
 * All rights reserved.
3
 * All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
7
 * are met:
7
 * are met:
8
 *
8
 *
9
 * - Redistributions of source code must retain the above copyright
9
 * - Redistributions of source code must retain the above copyright
10
 *   notice, this list of conditions and the following disclaimer.
10
 *   notice, this list of conditions and the following disclaimer.
11
 * - Redistributions in binary form must reproduce the above copyright
11
 * - Redistributions in binary form must reproduce the above copyright
12
 *   notice, this list of conditions and the following disclaimer in the
12
 *   notice, this list of conditions and the following disclaimer in the
13
 *   documentation and/or other materials provided with the distribution.
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
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.
15
 *   derived from this software without specific prior written permission.
16
 *
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
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
18
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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
23
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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
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.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
#ifndef __mips32_ARC_H_
29
#ifndef __mips_ARC_H_
30
#define __mips32_ARC_H_
30
#define __mips_ARC_H_
31
 
31
 
32
#include <arch/types.h>
32
#include <arch/types.h>
33
 
33
 
34
#define ARC_BASE_ADDR 0x1000;
34
#define ARC_BASE_ADDR 0x1000;
35
#define ARC_MAGIC 0x53435241
35
#define ARC_MAGIC 0x53435241
36
 
36
 
-
 
37
typedef enum {
-
 
38
    SystemClass = 0,
-
 
39
    ProcessorClass,
-
 
40
    CacheClass,
-
 
41
    AdapterClass,
-
 
42
    ControllerClass,
-
 
43
    PeripheralClass,
-
 
44
    MemoryClass
-
 
45
} arc_component_class;
-
 
46
 
-
 
47
typedef enum {
-
 
48
    ARC_type = 0,
-
 
49
    CPU_type,
-
 
50
    FPU_type,
-
 
51
    PrimaryICache,
-
 
52
    PrimaryDCache,
-
 
53
    SecondaryICache,
-
 
54
    SecondaryDCache,
-
 
55
    SecondaryCache,
-
 
56
    Memory, /* Not in NT PROM */
-
 
57
    EISAAdapter,
-
 
58
    TCAdapter,
-
 
59
    SCSIAdapter,
-
 
60
    DTIAdapter,
-
 
61
    MultiFunctionAdapter,
-
 
62
    DiskController,
-
 
63
    TapeController,
-
 
64
    CDROMController,
-
 
65
    WORMController,
-
 
66
    SerialController,
-
 
67
    NetworkController,
-
 
68
    DisplayController,
-
 
69
    ParallelController,
-
 
70
    PointerController,
-
 
71
    KeyboardController,
-
 
72
    AudioController,
-
 
73
    OtherController,
-
 
74
    DiskPeripheral,
-
 
75
    FloppyDiskPeripheral,
-
 
76
    TapePeripheral,
-
 
77
    ModemPeripheral,
-
 
78
    MonitorPeripheral,
-
 
79
    PrinterPeripheral,
-
 
80
    PointerPeripheral,
-
 
81
    KeyboardPeripheral,
-
 
82
    TerminalPeripheral,
-
 
83
    LinePeripheral,
-
 
84
    NetworkPeripheral,
-
 
85
    OtherPeripheral,
-
 
86
    XTalkAdapter,
-
 
87
    PCIAdapter,
-
 
88
    GIOAdapter,
-
 
89
    TPUAdapter,
-
 
90
    Anonymous
-
 
91
}arc_component_type;
-
 
92
 
-
 
93
typedef enum {
-
 
94
    Failed = 1,
-
 
95
    ReadOnly = 2,
-
 
96
    Removable = 4,
-
 
97
    ConsoleIn = 8,
-
 
98
    ConsoleOut = 16,
-
 
99
    Input = 32,
-
 
100
    Output = 64
-
 
101
}arc_component_flags;
-
 
102
 
37
typedef struct  {
103
typedef struct  {
-
 
104
    arc_component_class class;
38
} arc_component;
105
    arc_component_type type;
-
 
106
    arc_component_flags flags;
-
 
107
    __u16 revision;
-
 
108
    __u16 version;
-
 
109
    __u32 key;
-
 
110
    __u32 affinitymask;
-
 
111
    __u32 configdatasize;
-
 
112
    __u32 identifier_len;
-
 
113
    char *identifier;
-
 
114
} __attribute__ ((packed)) arc_component;
39
 
115
 
40
typedef struct {
116
typedef struct {
41
    __u16 year;
117
    __u16 year;
42
    __u16 month;
118
    __u16 month;
43
    __u16 day;
119
    __u16 day;
44
    __u16 hour;
120
    __u16 hour;
45
    __u16 minutes;
121
    __u16 minutes;
46
    __u16 seconds;
122
    __u16 seconds;
47
    __u16 mseconds;
123
    __u16 mseconds;
48
} arc_timeinfo ;
124
} __attribute__ ((packed)) arc_timeinfo;
49
 
125
 
50
/* This is the SGI block structure, WinNT has it different */
126
/* This is the SGI block structure, WinNT has it different */
51
typedef enum {
127
typedef enum {
52
    ExceptionBlock,
128
    ExceptionBlock,
53
    SystemParameterBlock,
129
    SystemParameterBlock,
54
    FreeContiguous,
130
    FreeContiguous,
55
    FreeMemory,
131
    FreeMemory,
56
    BadMemory,
132
    BadMemory,
57
    LoadedProgram,
133
    LoadedProgram,
58
    FirmwareTemporary,
134
    FirmwareTemporary,
59
    FirmwarePermanent
135
    FirmwarePermanent
60
}arc_memorytype_t;
136
}arc_memorytype_t;
61
 
137
 
62
typedef struct  {
138
typedef struct  {
63
    arc_memorytype_t type;
139
    arc_memorytype_t type;
64
    __u32 basepage;  /* *4096 = baseaddr */
140
    __u32 basepage;  /* *4096 = baseaddr */
65
    __u32 basecount;
141
    __u32 basecount;
66
}arc_memdescriptor_t;
142
}arc_memdescriptor_t;
67
 
143
 
68
typedef struct {
144
typedef struct {
69
    char vendorid[8];
145
    char vendorid[8];
70
    char prodid[8];
146
    char prodid[8];
71
}arc_sysid_t;
147
}arc_sysid_t;
72
 
148
 
73
typedef struct {
149
typedef struct {
74
    long (*load)(void); /* ... */
150
    long (*load)(void); /* ... */
75
    long (*invoke)(__u32 eaddr,__u32 saddr,__u32 argc,char **argv,
151
    long (*invoke)(__u32 eaddr,__u32 saddr,__u32 argc,char **argv,
76
               char **envp);
152
               char **envp);
77
    long (*execute)(char *path,__u32 argc,char **argv,char **envp);
153
    long (*execute)(char *path,__u32 argc,char **argv,char **envp);
78
    void (*halt)(void);
154
    void (*halt)(void);
79
    void (*powerdown)(void);
155
    void (*powerdown)(void);
80
    void (*restart)(void);
156
    void (*restart)(void);
81
    void (*reboot)(void);
157
    void (*reboot)(void);
82
    void (*enterinteractivemode)(void);
158
    void (*enterinteractivemode)(void);
83
    long (*reserved)(void);
159
    long (*reserved)(void);
84
/* 10 */   
160
/* 10 */   
85
    arc_component * (*getpeer)(arc_component *c);
161
    arc_component * (*getpeer)(arc_component *c);
86
    arc_component * (*getchild)(arc_component *c);
162
    arc_component * (*getchild)(arc_component *c);
87
    arc_component * (*getparent)(arc_component *c);
163
    arc_component * (*getparent)(arc_component *c);
88
    long (*getconfigurationdata)(void *configdata, arc_component *c);
164
    long (*getconfigurationdata)(void *configdata, arc_component *c);
89
    long (*addchild)(arc_component *c, arc_component *template,
165
    long (*addchild)(arc_component *c, arc_component *template,
90
             void *configdata);
166
             void *configdata);
91
    long (*deletecomponet)(arc_component *current);
167
    long (*deletecomponet)(arc_component *current);
92
    long (*getcomponent)(char *path);
168
    long (*getcomponent)(char *path);
93
    long (*saveconfiguration)(void);
169
    long (*saveconfiguration)(void);
94
    arc_sysid_t (*getsystemid)(void);
170
    arc_sysid_t (*getsystemid)(void);
95
    arc_memdescriptor_t * (*getmemorydescriptor)(arc_memdescriptor_t *cur);
171
    arc_memdescriptor_t * (*getmemorydescriptor)(arc_memdescriptor_t *cur);
96
/* 20 */
172
/* 20 */
97
    long (*reserved2)(void);
173
    long (*reserved2)(void);
98
    arc_timeinfo * (*gettime)(void);
174
    arc_timeinfo * (*gettime)(void);
99
    __u32 (*getrelativetime)(void);
175
    __u32 (*getrelativetime)(void);
100
    long (*getdirectoryentry)();
176
    long (*getdirectoryentry)();
101
    long (*open)(void); /* ... */
177
    long (*open)(void); /* ... */
102
    long (*close)(__u32 fileid);
178
    long (*close)(__u32 fileid);
103
    long (*read)(__u32 fileid,void *buf,__u32 n,__u32 *cnt);
179
    long (*read)(__u32 fileid,void *buf,__u32 n,__u32 *cnt);
104
    long (*getreadstatus)();
180
    long (*getreadstatus)();
105
    long (*write)(__u32 fileid, void *buf,__u32 n,__u32 *cnt);
181
    long (*write)(__u32 fileid, void *buf,__u32 n,__u32 *cnt);
106
    long (*seek)(void); /* ... */
182
    long (*seek)(void); /* ... */
107
/* 30 */
183
/* 30 */
108
    long (*mount)(void); /* ... */
184
    long (*mount)(void); /* ... */
109
    char * (*getenvironmentvariable)(char *name);
185
    char * (*getenvironmentvariable)(char *name);
110
    char * (*setenvironmentvariable)(char *name, char *value);
186
    char * (*setenvironmentvariable)(char *name, char *value);
111
    long (*getfileinformation)(void); /* ... */
187
    long (*getfileinformation)(void); /* ... */
112
    long (*setfileinformation)(__u32 fileid,__u32 attflags,__u32 attmask);
188
    long (*setfileinformation)(__u32 fileid,__u32 attflags,__u32 attmask);
113
    void (*flushallcaches)(void);
189
    void (*flushallcaches)(void);
114
    long (*testunicodecharacter)(void); /* ... */
190
    long (*testunicodecharacter)(void); /* ... */
115
    long (*getdisplaystatus)(void); /* ... */
191
    long (*getdisplaystatus)(void); /* ... */
116
} arc_func_vector_t;
192
} arc_func_vector_t;
117
 
193
 
118
typedef struct {
194
typedef struct {
119
    __u32 signature;
195
    __u32 signature;
120
    __u32 length;
196
    __u32 length;
121
    __u16 version;
197
    __u16 version;
122
    __u16 revision;
198
    __u16 revision;
123
    void *restartblock;
199
    void *restartblock;
124
    void *debugblock;
200
    void *debugblock;
125
    void *gevector;
201
    void *gevector;
126
    void *utlbmissvector;
202
    void *utlbmissvector;
127
    __u32 firmwarevectorlen;
203
    __u32 firmwarevectorlen;
128
    arc_func_vector_t *firmwarevector;
204
    arc_func_vector_t *firmwarevector;
129
    __u32 privvectorlen;
205
    __u32 privvectorlen;
130
    void *privvector;
206
    void *privvector;
131
    __u32 adaptercount;
207
    __u32 adaptercount;
132
}__attribute__ ((packed)) arc_sbp;
208
}__attribute__ ((packed)) arc_sbp;
133
 
209
 
134
extern int init_arc(void);
210
extern int init_arc(void);
135
extern void arc_print_memory_map(void);
211
extern void arc_print_memory_map(void);
136
extern int arc_enabled(void);
212
extern int arc_enabled(void);
137
extern void arc_putchar(char ch);
213
extern void arc_putchar(char ch);
-
 
214
extern void arc_print_devices(void);
138
 
215
 
139
#endif
216
#endif
140
 
217