On 29.06.2010, at 20:38, Blue Swirl wrote:

> On Tue, Jun 29, 2010 at 2:35 PM, Alexander Graf <ag...@suse.de> wrote:
>> Intel Macs have a chip called the "AppleSMC" which they use to control
>> certain Apple specific parts of the hardware, like the keyboard background
>> light.
>> 
>> That chip is also used to store a key that Mac OS X uses to decrypt binaries.
>> 
>> This patch adds emulation for that chip, so we're getting one step further
>> to having Mac OS X run natively on Qemu.
>> 
>> Signed-off-by: Alexander Graf <ag...@suse.de>
>> ---
>>  Makefile.target |    2 +-
>>  hw/applesmc.c   |  225 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 226 insertions(+), 1 deletions(-)
>>  create mode 100644 hw/applesmc.c
>> 
>> 

[...]

>> 
>> +#ifdef DEBUG_SMC
>> +#define smc_debug(...) printf(__VA_ARGS__)
> 
> How about:
> #define smc_debug(fmt, ...) printf("APPLESMC: " fmt, ## __VA_ARGS__)

Well, I went with smc_debug(...) fprintf(stderr, "APPLESMC: " __VA_ARGS__). 
That way you can do fun things like smc_debug("Hello World");

:)

[...]

>> 
>> +
>> +    applesmc_add_key(s, "REV ", 6, "\0x01\0x13\0x0f\0x00\0x00\0x03");
>> +    applesmc_add_key(s, "OSK0", 32, s->osk);
>> +    applesmc_add_key(s, "OSK1", 32, s->osk + 32);
>> +    applesmc_add_key(s, "NATJ", 1, "\0");
>> +    applesmc_add_key(s, "MSSP", 1, "\0");
>> +    applesmc_add_key(s, "MSSD", 1, "\0x3");
> 
> Please add a reset function which sets these, possibly freeing the old
> keys. That is, if it is the correct action in reset.

Hrm. I guess it's the closest thing to "correct".

Alex

Reply via email to