ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/thunks.cpp
(Generate patch)

Comparing SheepShaver/src/thunks.cpp (file contents):
Revision 1.6 by gbeauche, 2004-01-24T11:28:04Z vs.
Revision 1.13 by gbeauche, 2005-06-23T16:23:31Z

# Line 37 | Line 37
37  
38  
39   /*              NativeOp instruction format:
40 <                +------------+--------------------------+--+----------+------------+
41 <                |      6     |                          |FN|    OP    |      2     |
42 <                +------------+--------------------------+--+----------+------------+
43 <                 0         5 |6                       19 20 21      25 26        31
40 >                +------------+-------------------------+--+-----------+------------+
41 >                |      6     |                         |FN|    OP     |      2     |
42 >                +------------+-------------------------+--+-----------+------------+
43 >                 0         5 |6                      18 19 20      25 26        31
44   */
45  
46 < #define POWERPC_NATIVE_OP(LR, OP) \
47 <                (POWERPC_EMUL_OP | ((LR) << 11) | (((uint32)OP) << 6) | 2)
46 > #define POWERPC_NATIVE_OP(FN, OP) \
47 >                (POWERPC_EMUL_OP | ((FN) << 12) | (((uint32)OP) << 6) | 2)
48  
49   /*
50   *  Return the fake PowerPC opcode to handle specified native code
# Line 55 | Line 55 | uint32 NativeOpcode(int selector)
55   {
56          uint32 opcode;
57          switch (selector) {
58        case NATIVE_DISABLE_INTERRUPT:
59        case NATIVE_ENABLE_INTERRUPT:
58          case NATIVE_CHECK_LOAD_INVOC:
59                  opcode = POWERPC_NATIVE_OP(0, selector);
60                  break;
# Line 84 | Line 82 | uint32 NativeOpcode(int selector)
82          case NATIVE_GET_1_IND_RESOURCE:
83          case NATIVE_R_GET_RESOURCE:
84          case NATIVE_MAKE_EXECUTABLE:
85 +        case NATIVE_SYNC_HOOK:
86 +        case NATIVE_BITBLT_HOOK:
87 +        case NATIVE_FILLRECT_HOOK:
88 +        case NATIVE_BITBLT:
89 +        case NATIVE_INVRECT:
90 +        case NATIVE_FILLRECT:
91                  opcode = POWERPC_NATIVE_OP(1, selector);
92                  break;
93          default:
# Line 145 | Line 149 | static void generate_powerpc_thunks(void
149          assert(xlm_index != -1 && check_load_invoc_index != -1);
150  
151          uint32 check_load_invoc_opcode = NativeOpcode(NATIVE_CHECK_LOAD_INVOC);
152 <        uintptr base;
152 >        uint32 base;
153  
154          // GetResource()
155          get_resource_func = base = SheepMem::Reserve(get_resource_template_size);
# Line 211 | Line 215 | bool ThunksInit(void)
215          native_op[NATIVE_R_GET_RESOURCE].func = r_get_resource_func;
216   #endif
217   #else
218 < #if defined(__linux__) || (defined(__APPLE__) && defined(__MACH__))
218 > #if defined(__linux__) || defined(__NetBSD__) || (defined(__APPLE__) && defined(__MACH__))
219   #define DEFINE_NATIVE_OP(ID, FUNC) do {                         \
220                  uintptr base = SheepMem::Reserve(8);            \
221                  WriteMacInt32(base + 0, (uint32)FUNC);          \
222 <                WriteMacInt32(base + 4, 0); /*Fake TVECT*/      \
222 >                WriteMacInt32(base + 4, (uint32)TOC);           \
223                  native_op[ID].tvect = base;                                     \
224                  native_op[ID].func  = (uint32)FUNC;                     \
225          } while (0)
# Line 247 | Line 251 | bool ThunksInit(void)
251          DEFINE_NATIVE_OP(NATIVE_SERIAL_STATUS, SerialStatus);
252          DEFINE_NATIVE_OP(NATIVE_SERIAL_CLOSE, SerialClose);
253          DEFINE_NATIVE_OP(NATIVE_MAKE_EXECUTABLE, MakeExecutable);
254 +        DEFINE_NATIVE_OP(NATIVE_SYNC_HOOK, NQD_sync_hook);
255 +        DEFINE_NATIVE_OP(NATIVE_BITBLT_HOOK, NQD_bitblt_hook);
256 +        DEFINE_NATIVE_OP(NATIVE_FILLRECT_HOOK, NQD_fillrect_hook);
257 +        DEFINE_NATIVE_OP(NATIVE_BITBLT, NQD_bitblt);
258 +        DEFINE_NATIVE_OP(NATIVE_INVRECT, NQD_invrect);
259 +        DEFINE_NATIVE_OP(NATIVE_FILLRECT, NQD_fillrect);
260   #undef DEFINE_NATIVE_OP
261   #endif
262  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines