PowerSurgeCPU Compiling Problem |
November, 04, 2002 4:31 AM |
twalter |
Hi Ryan, I would like to help you to get the PowerSurge SMP running. So, as a first step, I've tried to compile the PowerSurgeCPU kext. But I got the following error: converting from 'void (PowerSurgeCPU::*)(bool)' to 'void (*)(void*, int)' processor_info.time_base_enable = (time_base_enable_t) &PowerSurgeCPU::enableCPUTimeBase; Is this a syntax or a logical error? For me, it doesn't make sense to assign a member function pointer to a normal function pointer. Perhaps my compiler is just pickier then yours. I'm using the latest developer tools for Mac OS X 10.1.5 from April, gcc 2.95.2 Apple Version gcc 937.2. CU Thomas |
. |
RE: PowerSurgeCPU Compiling Problem |
November, 10, 2002 7:32 PM |
OSXGuru |
. |
Here's the compiler flags I have set in the project settings: -fpermissive -D_BIG_ENDIAN=1 The -fpermissive thing should turn the "converting" error into a warning. Whether it actually makes sense to set things up this way, I don't know. It should kind of work, if you look at the "conversion" error. The first parameter is a void*, so that would convert to the "this" parameter. The second parameter would convert from int to bool, which might work too. I suppose that the correct way to do this would be to set up a C function to work as glue. I.e. something like: static void EnableTimeBaseGlue (void *arg1, int arg2) { ((PowerSurgeCPU *) arg1)->enableCPUTimeBase (arg2); } or something like that. That is assuming that the first argument is in fact a pointer to the PowerSurgeCPU instance, which it probably is. But it would probably be a good idea to search through the kernel sources to see where the function pointer is actually used, and what arguments are supplied. (Or use the dynamic cast IOKit stuff to make sure that it is a PowerSurgeCPU *). |
. |
RE: PowerSurgeCPU Compiling Problem |
November, 04, 2002 1:15 PM |
mjoecups358 |
. |
Go Thomas Go! |
|
|