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

Comparing SheepShaver/src/include/thunks.h (file contents):
Revision 1.3 by gbeauche, 2004-01-07T18:24:42Z vs.
Revision 1.9 by gbeauche, 2004-11-13T14:09:16Z

# Line 51 | Line 51 | enum {
51    NATIVE_GET_IND_RESOURCE,
52    NATIVE_GET_1_IND_RESOURCE,
53    NATIVE_R_GET_RESOURCE,
54  NATIVE_DISABLE_INTERRUPT,
55  NATIVE_ENABLE_INTERRUPT,
54    NATIVE_MAKE_EXECUTABLE,
55 +  NATIVE_CHECK_LOAD_INVOC,
56 +  NATIVE_SYNC_HOOK,
57 +  NATIVE_BITBLT_HOOK,
58 +  NATIVE_FILLRECT_HOOK,
59 +  NATIVE_BITBLT,
60 +  NATIVE_INVRECT,
61 +  NATIVE_FILLRECT,
62    NATIVE_OP_MAX
63   };
64  
# Line 85 | Line 90 | extern uint32 NativeRoutineDescriptor(in
90   class SheepMem {
91          static uint32 align(uint32 size);
92   protected:
93 +        static uint32  page_size;
94          static uintptr zero_page;
95          static uintptr base;
96          static uintptr top;
# Line 92 | Line 98 | protected:
98   public:
99          static bool Init(void);
100          static void Exit(void);
101 <        static uintptr ZeroPage();
102 <        static uintptr Reserve(uint32 size);
101 >        static uint32 PageSize();
102 >        static uint32 ZeroPage();
103 >        static uint32 Reserve(uint32 size);
104          static void Release(uint32 size);
105          friend class SheepVar;
106   };
# Line 104 | Line 111 | inline uint32 SheepMem::align(uint32 siz
111          return (size + 3) & -4;
112   }
113  
114 < inline uintptr SheepMem::ZeroPage()
114 > inline uint32 SheepMem::PageSize()
115 > {
116 >  return page_size;
117 > }
118 >
119 > inline uint32 SheepMem::ZeroPage()
120   {
121    return zero_page;
122   }
123  
124 < inline uintptr SheepMem::Reserve(uint32 size)
124 > inline uint32 SheepMem::Reserve(uint32 size)
125   {
126          top -= align(size);
127          assert(top >= base);
# Line 123 | Line 135 | inline void SheepMem::Release(uint32 siz
135  
136   class SheepVar
137   {
138 <        uintptr m_base;
139 <        uint32  m_size;
138 >        uint32 m_base;
139 >        uint32 m_size;
140   public:
141          SheepVar(uint32 requested_size);
142          ~SheepVar() { SheepMem::Release(m_size); }
143 <        uintptr addr() const { return m_base; }
132 <        void *ptr() const { return (void *)addr(); }
143 >        uint32 addr() const { return m_base; }
144   };
145  
146   inline SheepVar::SheepVar(uint32 requested_size)
# Line 140 | Line 151 | inline SheepVar::SheepVar(uint32 request
151  
152   // TODO: optimize for 32-bit platforms
153  
154 < template< int size >
154 > template< int requested_size >
155   struct SheepArray : public SheepVar
156   {
157 <        SheepArray() : SheepVar(size) { }
147 <        uint8 *ptr() const { return (uint8 *)addr(); }
157 >        SheepArray() : SheepVar(requested_size) { }
158   };
159  
160   struct SheepVar32 : public SheepVar
# Line 153 | Line 163 | struct SheepVar32 : public SheepVar
163          SheepVar32(uint32 value) : SheepVar(4) { set_value(value); }
164          uint32 value() const { return ReadMacInt32(addr()); }
165          void set_value(uint32 v) { WriteMacInt32(addr(), v); }
156        uint32 *ptr() const { return (uint32 *)addr(); }
166   };
167  
168   struct SheepString : public SheepVar
169   {
170          SheepString(const char *str) : SheepVar(strlen(str) + 1)
171 <                { if (str) strcpy((char *)addr(), str); else WriteMacInt8(addr(), 0); }
171 >                { if (str) strcpy(value(), str); else WriteMacInt8(addr(), 0); }
172          char *value() const
173 <                { return (char *)addr(); }
165 <        char *ptr() const
166 <                { return (char *)addr(); }
173 >                { return (char *)Mac2HostAddr(addr()); }
174   };
175  
176   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines