qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] add resolutions via command-line


From: G 3
Subject: Re: [Qemu-devel] [PATCH v2] add resolutions via command-line
Date: Tue, 20 Sep 2016 09:07:01 -0400


On Sep 20, 2016, at 5:01 AM, Benjamin Herrenschmidt wrote:

On Tue, 2016-09-20 at 00:28 -0400, G 3 wrote:
+       RegEntryID *entry_id;
+       OSErr err;
+       OSStatus os_status = noErr;
+       Boolean is_done;
+       void *value;
+       RegPropertyValueSize property_size = -1;
+       int index, res_set_count;
+       char *set_str;
+
+       #define PROPERTY_NAME "resolutions"
+       #define NODE_PATH "Devices:device-tree:options"
+
+       /* init the entry variable */
+       err = RegistryEntryIDInit(entry_id);
+       if (err != noErr) {
+               lprintf("Error: Failed to init entry variable!
(Error: %d)\n", err);
+               return err;
+       }
+       is_done = false;
+

No, you need to allocate the RegistryEntryID on the stack otherwise
you are whacking at a random uninitialized pointer. IE:

        RegistryEntryID entry_id;

        RegistryEntryIDInit(&entry_id);
        .../...
See if that helps with your OS X problem.

Good catch. I missed that one. It didn't fix the problem. I think the options node isn't accessible for some reason in Mac OS X.


Also I don't like the
use of pow(), there must be a better way ...

What did you have in mind? Do you want atoi() rewritten to exclude it?

Check if there's anything
of value to be picked up from DSL, otherwise, put those utilities
somewhere in common, other drivers might want them.

What is DSL? Did you want me to put the pow() function in the MacDriverUtils.c file?


(What does our lprintf implementation do for example ?)

I think it prints to some virtual device. I'm not sure. I haven't figured out how to use it yet. If you could provide some directions I think I might be able to make it work.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]