ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/BeOS/sysdeps.h
Revision: 1.5
Committed: 1999-10-25T08:07:50Z (24 years, 8 months ago) by cebix
Content type: text/plain
Branch: MAIN
Changes since 1.4: +3 -0 lines
Log Message:
- now uses "mon" if present (currently on breakpoints only)

File Contents

# Content
1 /*
2 * sysdeps.h - System dependent definitions for BeOS
3 *
4 * Basilisk II (C) 1997-1999 Christian Bauer
5 *
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 #include <assert.h>
25 #include <support/SupportDefs.h>
26 #include <support/ByteOrder.h>
27
28 #include "user_strings_beos.h"
29
30 // Are the Mac and the host address space the same?
31 #ifdef __i386__
32 #define REAL_ADDRESSING 0
33 #else
34 #define REAL_ADDRESSING 1
35 #endif
36
37 // Are we using a 68k emulator or the real thing?
38 #define EMULATED_68K 1
39
40 // Is the Mac ROM write protected?
41 #define ROM_IS_WRITE_PROTECTED 1
42
43 // ExtFS is supported
44 #define SUPPORTS_EXTFS 1
45
46 // mon is not supported
47 #define ENABLE_MON 0
48
49 // Time data type for Time Manager emulation
50 typedef bigtime_t tm_time_t;
51
52 // Offset Mac->BeOS time in seconds
53 #define TIME_OFFSET 0x7c25b080
54
55 // 64 bit file offsets
56 typedef off_t loff_t;
57
58 // UAE CPU data types
59 #define uae_s8 int8
60 #define uae_u8 uint8
61 #define uae_s16 int16
62 #define uae_u16 uint16
63 #define uae_s32 int32
64 #define uae_u32 uint32
65 typedef uae_u32 uaecptr;
66
67 // UAE CPU defines
68 #ifdef __i386__
69
70 // Intel x86 assembler optimizations
71 #define X86_PPRO_OPT
72 static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;}
73 #ifdef X86_PPRO_OPT
74 static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswap %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
75 #else
76 static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("xorl %k0,%k0\n\tmovw %w1,%w0\n\trolw $8,%w0" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
77 #endif
78 #define HAVE_GET_WORD_UNSWAPPED
79 #define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a)))
80 static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
81 #ifdef X86_PPRO_OPT
82 static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswap %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;}
83 #else
84 static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
85 #endif
86
87 #define X86_ASSEMBLY
88 #define ASM_SYM_FOR_FUNC(a) __asm__(a)
89 #define REGPARAM __attribute__((regparm(3)))
90
91 #else
92
93 // PowerPC (memory.cpp not used, so no optimization neccessary)
94 static inline uae_u32 do_get_mem_long(uae_u32 *a) {return *a;}
95 static inline uae_u32 do_get_mem_word(uae_u16 *a) {return *a;}
96 static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {*a = v;}
97 static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {*a = v;}
98
99 #undef X86_ASSEMBLY
100 #define ASM_SYM_FOR_FUNC(a)
101 #define REGPARAM
102 #endif
103
104 #define do_get_mem_byte(a) ((uae_u32)*((uae_u8 *)(a)))
105 #define do_put_mem_byte(a, v) (*(uae_u8 *)(a) = (v))
106
107 #define call_mem_get_func(func, addr) ((*func)(addr))
108 #define call_mem_put_func(func, addr, v) ((*func)(addr, v))
109 #define __inline__ inline
110 #define CPU_EMU_SIZE 0
111 #undef USE_MAPPED_MEMORY
112 #undef CAN_MAP_MEMORY
113 #undef NO_INLINE_MEMORY_ACCESS
114 #undef MD_HAVE_MEM_1_FUNCS
115 #undef USE_COMPILER
116 #define REGPARAM2
117 #define ENUMDECL typedef enum
118 #define ENUMNAME(name) name
119 #define write_log printf
120
121 #endif