From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmGvf-0004c6-2d for qemu-devel@nongnu.org; Tue, 20 Sep 2016 05:01:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmGva-0000q7-7u for qemu-devel@nongnu.org; Tue, 20 Sep 2016 05:01:26 -0400 Message-ID: <1474362073.2857.59.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Tue, 20 Sep 2016 19:01:13 +1000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] add resolutions via command-line List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: G 3 Cc: "list@suse.de:PowerPC list:PowerPC" , qemu-devel qemu-devel 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. Also I don't like the use of pow(), there must be a better way ... 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 does our lprintf implementation do for example ?) Cheers, Ben.