ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/BeOS/sysdeps.h
Revision: 1.7
Committed: 2005-02-27T21:52:06Z (19 years, 8 months ago) by gbeauche
Content type: text/plain
Branch: MAIN
Changes since 1.6: +1 -0 lines
Log Message:
Fix native Linux/ppc with recent enough glibc that supports TLS; r2 is used
in that case. Tell me if I broke other arches, e.g. r13 is no longer saved
in Video and Ethernet stubs, though it seems to be OK.

Colateral feature: SheepShaver should now run on Linux/ppc64 with relevant
32-bit runtime. Native Linux/ppc64 support is harder as low mem globals are
32-bit in mind and e.g. the TLS register there is %r13, %r2 is the TOC
(PowerOpen/AIX ABI)

File Contents

# User Rev Content
1 cebix 1.1 /*
2     * sysdeps.h - System dependent definitions for BeOS
3     *
4 gbeauche 1.6 * SheepShaver (C) 1997-2005 Christian Bauer and Marc Hellwig
5 cebix 1.1 *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19     */
20    
21     #ifndef SYSDEPS_H
22     #define SYSDEPS_H
23    
24 cebix 1.2 // Do we have std namespace?
25     #ifdef __POWERPC__
26     #define NO_STD_NAMESPACE
27     #endif
28    
29 cebix 1.1 #include <assert.h>
30     #include <sys/types.h>
31     #include <KernelKit.h>
32    
33     #include "user_strings_beos.h"
34    
35     // Are we using a PPC emulator or the real thing?
36     #ifdef __POWERPC__
37     #define EMULATED_PPC 0
38 gbeauche 1.3 #define WORDS_BIGENDIAN 1
39 gbeauche 1.7 #define SYSTEM_CLOBBERS_R2 1
40 cebix 1.1 #else
41     #define EMULATED_PPC 1
42 gbeauche 1.3 #undef WORDS_BIGENDIAN
43 cebix 1.1 #endif
44    
45     #define POWERPC_ROM 1
46    
47     // Time data type for Time Manager emulation
48     typedef bigtime_t tm_time_t;
49    
50     // 64 bit file offsets
51     typedef off_t loff_t;
52 cebix 1.2
53     // Data types
54     typedef uint32 uintptr;
55     typedef int32 intptr;
56 cebix 1.1
57 gbeauche 1.5 // Timing functions
58     extern void Delay_usec(uint32 usec);
59    
60 cebix 1.1 // Macro for calling MacOS routines
61     #define CallMacOS(type, proc) (*(type)proc)()
62     #define CallMacOS1(type, proc, arg1) (*(type)proc)(arg1)
63     #define CallMacOS2(type, proc, arg1, arg2) (*(type)proc)(arg1, arg2)
64     #define CallMacOS3(type, proc, arg1, arg2, arg3) (*(type)proc)(arg1, arg2, arg3)
65     #define CallMacOS4(type, proc, arg1, arg2, arg3, arg4) (*(type)proc)(arg1, arg2, arg3, arg4)
66     #define CallMacOS5(type, proc, arg1, arg2, arg3, arg4, arg5) (*(type)proc)(arg1, arg2, arg3, arg4, arg5)
67     #define CallMacOS6(type, proc, arg1, arg2, arg3, arg4, arg5, arg6) (*(type)proc)(arg1, arg2, arg3, arg4, arg5, arg6)
68     #define CallMacOS7(type, proc, arg1, arg2, arg3, arg4, arg5, arg6, arg7) (*(type)proc)(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
69    
70     #endif