j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: mcayland Date: Mon Jan 4 13:03:32 2016 New Revision: 1368 URL: http://tracker.coreboot.org/trac/openbios/changeset/1368
Log: libopenbios: introduce new get_path_from_ph() helper function
This helper function returns the full device path for the device with the given phandle as a string.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk Reviewed-by: Alexander Graf agraf@suse.de Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/include/libopenbios/bindings.h trunk/openbios-devel/libopenbios/bindings.c
Modified: trunk/openbios-devel/include/libopenbios/bindings.h ============================================================================== --- trunk/openbios-devel/include/libopenbios/bindings.h Mon Jan 4 13:03:29 2016 (r1367) +++ trunk/openbios-devel/include/libopenbios/bindings.h Mon Jan 4 13:03:32 2016 (r1368) @@ -56,6 +56,7 @@ extern ihandle_t open_dev( const char *spec ); extern void close_package( ihandle_t ih ); extern void close_dev( ihandle_t ih ); +extern char *get_path_from_ph( phandle_t ph );
/* property access */ extern void set_property( phandle_t ph, const char *name,
Modified: trunk/openbios-devel/libopenbios/bindings.c ============================================================================== --- trunk/openbios-devel/libopenbios/bindings.c Mon Jan 4 13:03:29 2016 (r1367) +++ trunk/openbios-devel/libopenbios/bindings.c Mon Jan 4 13:03:32 2016 (r1368) @@ -366,6 +366,14 @@ return ret; }
+char * +get_path_from_ph( phandle_t ph ) +{ + PUSH(ph); + fword("get-package-path"); + return pop_fstr_copy(); +} + phandle_t dt_iter_begin( void ) {