Hello community, here is the log from the commit of package hwinfo for openSUSE:Factory checked in at Fri May 15 22:46:24 CEST 2009. -------- --- hwinfo/hwinfo.changes 2009-01-22 12:42:56.000000000 +0100 +++ hwinfo/hwinfo.changes 2009-05-14 17:37:18.000000000 +0200 @@ -1,0 +2,9 @@ +Thu May 14 17:36:41 CEST 2009 - snwint@suse.de + +- setup dummy int 0x15 for BIOS emulation (bnc #469863) +- fix memory size detection (bnc #500410) +- 'hwprobe' variables can now have values (int, string, list) instead of + being just flags +- fix some compiler warnings + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- hwinfo-15.26.tar.bz2 New: ---- hwinfo-16.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hwinfo.spec ++++++ --- /var/tmp/diff_new_pack.t28434/_old 2009-05-15 22:44:04.000000000 +0200 +++ /var/tmp/diff_new_pack.t28434/_new 2009-05-15 22:44:04.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package hwinfo (Version 15.26) +# spec file for package hwinfo (Version 16.0) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -28,9 +28,9 @@ PreReq: /sbin/ldconfig %insserv_prereq %fillup_prereq AutoReqProv: on Summary: Hardware Library -Version: 15.26 +Version: 16.0 Release: 1 -Source: hwinfo-15.26.tar.bz2 +Source: hwinfo-16.0.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -102,6 +102,12 @@ %doc doc/libhd/html %changelog +* Thu May 14 2009 snwint@suse.de +- setup dummy int 0x15 for BIOS emulation (bnc #469863) +- fix memory size detection (bnc #500410) +- 'hwprobe' variables can now have values (int, string, list) instead of + being just flags +- fix some compiler warnings * Thu Jan 22 2009 snwint@suse.de - make ehea look more ordinary (bnc #467033) * Fri Jan 16 2009 snwint@suse.de @@ -153,7 +159,7 @@ we know what devices support it; fate #304080) * Mon Sep 15 2008 snwint@suse.de - use udevadm instead of udevinfo -* Mon Sep 08 2008 ro@suse.de +* Tue Sep 09 2008 ro@suse.de - fix build on x86 with 2.6.67 kernel includes * Fri Aug 08 2008 olh@suse.de - add inital POWER6 ibmebus support for ehea network (bnc#394602 -LTC44938) @@ -990,7 +996,7 @@ * Tue Feb 24 2004 snwint@suse.de - include x86emu into libhd.so - don't segfault if we couldn't get a shared memory segment -* Mon Feb 23 2004 kkaempf@suse.de +* Tue Feb 24 2004 kkaempf@suse.de - try to include x86emu library in libhd * Mon Feb 23 2004 snwint@suse.de - fixed Makefile @@ -1271,7 +1277,7 @@ - dmfe instead of tulip (#19271) - convert_hd now understands XML properly - removed outdated docs -* Sun Sep 08 2002 kkeil@suse.de +* Mon Sep 09 2002 kkeil@suse.de - probe ISDN USB too (#18830) * Sat Sep 07 2002 snwint@suse.de - make sure usb floppies are reported as such (#12262) ++++++ hwinfo-15.26.tar.bz2 -> hwinfo-16.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/Changelog new/hwinfo-16.0/Changelog --- old/hwinfo-15.26/Changelog 2009-01-22 12:34:09.000000000 +0100 +++ new/hwinfo-16.0/Changelog 2009-05-14 17:35:54.000000000 +0200 @@ -1,3 +1,12 @@ +14/5/2009: v16.0 + - 'hwprobe' variables can now have values (int, string, list) instead of + being just flags + - fix some compiler warnings + +11/5/2009: v15.27 + - setup dummy int 0x15 for BIOS emulation (bnc #469863) + - fix memory size detection (bnc #500410) + 22/1/2009: v15.26 - make ehea look more ordinary (bnc #467033) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/hd/block.c new/hwinfo-16.0/src/hd/block.c --- old/hwinfo-15.26/src/hd/block.c 2008-10-01 15:35:23.000000000 +0200 +++ new/hwinfo-16.0/src/hd/block.c 2009-05-12 12:28:26.000000000 +0200 @@ -809,7 +809,7 @@ sscanf(sl->str, "[%15[^]]] %*s fc:%"SCNx64" , %x ", buf, &ul0, &u0) == 3 && !strcmp(hd->sysfs_bus_id, buf) ) { - ADD2LOG(" lsscsi: wwpn = 0x%llx, port_id = 0x%x\n", ul0, u0); + ADD2LOG(" lsscsi: wwpn = 0x%"PRIx64", port_id = 0x%x\n", ul0, u0); res->fc.wwpn = ul0; res->fc.wwpn_ok = 1; res->fc.port_id = u0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/hd/hal.c new/hwinfo-16.0/src/hd/hal.c --- old/hwinfo-15.26/src/hd/hal.c 2008-03-03 15:23:47.000000000 +0100 +++ new/hwinfo-16.0/src/hd/hal.c 2009-05-12 17:44:56.000000000 +0200 @@ -337,6 +337,16 @@ } +hal_prop_t *hal_add_new(hal_prop_t **prop) +{ + while(*prop) prop = &(*prop)->next; + *prop = new_mem(sizeof **prop); + hal_invalidate(*prop); + + return *prop; +} + + void add_pci(hd_data_t *hd_data) { hd_t *hd; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/hd/hd.c new/hwinfo-16.0/src/hd/hd.c --- old/hwinfo-15.26/src/hd/hd.c 2009-01-12 14:43:34.000000000 +0100 +++ new/hwinfo-16.0/src/hd/hd.c 2009-05-12 17:49:52.000000000 +0200 @@ -151,7 +151,15 @@ unsigned char *data; } disk_t; -static struct s_pr_flags *get_pr_flags(enum probe_feature feature); +typedef struct { + enum probe_feature val, parent; + unsigned mask; /* bit 0: default, bit 1: all, bit 2: max, bit 3: linuxrc */ + char *name; + hal_prop_type_t type; +} pr_flags_t; + +static pr_flags_t *pr_flags_by_name(char *name); +static pr_flags_t *pr_flags_by_id(enum probe_feature feature); static void fix_probe_features(hd_data_t *hd_data); static void set_probe_feature(hd_data_t *hd_data, enum probe_feature feature, unsigned val); static void free_old_hd_entries(hd_data_t *hd_data); @@ -240,124 +248,180 @@ * Names for the probe flags. Used for debugging and command line parsing in * hw.c. Cf. enum probe_feature, hd_data_t.probe. */ -static struct s_pr_flags { - enum probe_feature val, parent; - unsigned mask; /* bit 0: default, bit 1: all, bit 2: max, bit 3: linuxrc */ - char *name; -} pr_flags[] = { - { pr_default, -1, 1, "default" }, - { pr_all, -1, 2 , "all" }, - { pr_max, -1, 4 , "max" }, - { pr_lxrc, -1, 8 , "lxrc" }, - { pr_memory, 0, 8|4|2|1, "memory" }, - { pr_pci, 0, 8|4|2|1, "pci" }, - { pr_s390, 0, 8|4|2|1, "s390" }, - { pr_s390disks, 0, 0, "s390disks" }, - { pr_isapnp, 0, 4|2|1, "isapnp" }, - { pr_isapnp_old, pr_isapnp, 0, "isapnp.old" }, - { pr_isapnp_new, pr_isapnp, 0, "isapnp.new" }, - { pr_isapnp_mod, 0, 4 , "isapnp.mod" }, - { pr_isapnp, 0, 0, "pnpdump" }, /* alias for isapnp */ - { pr_net, 0, 8|4|2|1, "net" }, - { pr_net_eeprom, 0, 0, "net.eeprom" }, - { pr_floppy, 0, 8|4|2|1, "floppy" }, - { pr_misc, pr_bios, 8|4|2|1, "misc" }, // ugly hack! - { pr_misc_serial, pr_misc, 8|4|2|1, "misc.serial" }, - { pr_misc_par, pr_misc, 4|2|1, "misc.par" }, - { pr_misc_floppy, pr_misc, 8|4|2|1, "misc.floppy" }, - { pr_bios, 0, 8|4|2|1, "bios" }, - { pr_bios_vesa, pr_bios, 4|2|1, "bios.vesa" }, - { pr_bios_ddc, pr_bios_vesa, 0, "bios.ddc" }, - { pr_bios_ddc_ports_1, pr_bios_ddc, 0, "bios.ddc.ports=1" }, // probe 1 ddc port - { pr_bios_ddc_ports_2, pr_bios_ddc, 0, "bios.ddc.ports=2" }, // probe 2 ddc ports - { pr_bios_ddc_ports_3, pr_bios_ddc, 0, "bios.ddc.ports=3" }, // probe 3 ddc ports - { pr_bios_ddc_ports_4, pr_bios_ddc, 0, "bios.ddc.ports=4" }, // probe 4 ddc ports - { pr_bios_fb, pr_bios_vesa, 0, "bios.fb" }, - { pr_bios_mode, pr_bios_vesa, 0, "bios.mode" }, - { pr_bios_vbe, pr_bios_mode, 0, "bios.vbe" }, // just an alias - { pr_bios_crc, 0, 0, "bios.crc" }, // require bios crc check to succeed - { pr_bios_vram, 0, 0, "bios.vram" }, // map video bios ram - { pr_bios_acpi, 0, 0, "bios.acpi" }, // dump acpi data - { pr_cpu, 0, 8|4|2|1, "cpu" }, - { pr_monitor, 0, 8|4|2|1, "monitor" }, - { pr_serial, 0, 4|2|1, "serial" }, -#if defined(__sparc__) - /* Probe for mouse on SPARC */ - { pr_mouse, 0, 8|4|2|1, "mouse" }, -#else - { pr_mouse, 0, 4|2|1, "mouse" }, -#endif - { pr_scsi, 0, 8|4|2|1, "scsi" }, - { pr_scsi_noserial, 0, 0, "scsi.noserial" }, - { pr_usb, 0, 8|4|2|1, "usb" }, - { pr_usb_mods, 0, 4 , "usb.mods" }, - { pr_modem, 0, 4|2|1, "modem" }, - { pr_modem_usb, pr_modem, 4|2|1, "modem.usb" }, - { pr_parallel, 0, 4|2|1, "parallel" }, - { pr_parallel_lp, pr_parallel, 4|2|1, "parallel.lp" }, - { pr_parallel_zip, pr_parallel, 4|2|1, "parallel.zip" }, - { pr_parallel_imm, 0, 0, "parallel.imm" }, - { pr_isa, 0, 0, "isa" }, - { pr_isa_isdn, pr_isa, 0, "isa.isdn" }, - { pr_isdn, 0, 4|2|1, "isdn" }, - { pr_kbd, 0, 8|4|2|1, "kbd" }, - { pr_prom, 0, 8|4|2|1, "prom" }, - { pr_sbus, 0, 8|4|2|1, "sbus" }, - { pr_int, 0, 8|4|2|1, "int" }, + +static pr_flags_t pr_flags[] = { + { pr_default, -1, 1, "default", p_bool }, + { pr_all, -1, 2 , "all", p_bool }, + { pr_max, -1, 4 , "max", p_bool }, + { pr_lxrc, -1, 8 , "lxrc", p_bool }, + { pr_memory, 0, 8|4|2|1, "memory", p_bool }, + { pr_pci, 0, 8|4|2|1, "pci", p_bool }, + { pr_s390, 0, 8|4|2|1, "s390", p_bool }, + { pr_s390disks, 0, 0, "s390disks", p_bool }, + { pr_isapnp, 0, 4|2|1, "isapnp", p_bool }, + { pr_isapnp_old, pr_isapnp, 0, "isapnp.old", p_bool }, + { pr_isapnp_new, pr_isapnp, 0, "isapnp.new", p_bool }, + { pr_isapnp_mod, 0, 4 , "isapnp.mod", p_bool }, + { pr_isapnp, 0, 0, "pnpdump", p_bool }, /* alias for isapnp */ + { pr_net, 0, 8|4|2|1, "net", p_bool }, + { pr_net_eeprom, 0, 0, "net.eeprom", p_bool }, + { pr_floppy, 0, 8|4|2|1, "floppy", p_bool }, + { pr_misc, pr_bios, 8|4|2|1, "misc", p_bool }, // ugly hack! + { pr_misc_serial, pr_misc, 8|4|2|1, "misc.serial", p_bool }, + { pr_misc_par, pr_misc, 4|2|1, "misc.par", p_bool }, + { pr_misc_floppy, pr_misc, 8|4|2|1, "misc.floppy", p_bool }, + { pr_bios, 0, 8|4|2|1, "bios", p_bool }, + { pr_bios_vesa, pr_bios, 4|2|1, "bios.vesa", p_bool }, + { pr_bios_ddc, pr_bios_vesa, 0, "bios.ddc", p_bool }, + { pr_bios_ddc_ports, pr_bios_ddc, 0, "bios.ddc.ports", p_int32 }, + { pr_bios_fb, pr_bios_vesa, 0, "bios.fb", p_bool }, + { pr_bios_mode, pr_bios_vesa, 0, "bios.mode", p_bool }, + { pr_bios_vbe, pr_bios_mode, 0, "bios.vbe", p_bool }, // just an alias + { pr_bios_crc, 0, 0, "bios.crc", p_bool }, // require bios crc check to succeed + { pr_bios_vram, 0, 0, "bios.vram", p_bool }, // map video bios ram + { pr_bios_acpi, 0, 0, "bios.acpi", p_bool }, // dump acpi data + { pr_cpu, 0, 8|4|2|1, "cpu", p_bool }, + { pr_monitor, 0, 8|4|2|1, "monitor", p_bool }, + { pr_serial, 0, 4|2|1, "serial", p_bool }, + { pr_mouse, 0, 4|2|1, "mouse", p_bool }, + { pr_scsi, 0, 8|4|2|1, "scsi", p_bool }, + { pr_scsi_noserial, 0, 0, "scsi.noserial", p_bool }, + { pr_usb, 0, 8|4|2|1, "usb", p_bool }, + { pr_usb_mods, 0, 4 , "usb.mods", p_bool }, + { pr_modem, 0, 4|2|1, "modem", p_bool }, + { pr_modem_usb, pr_modem, 4|2|1, "modem.usb", p_bool }, + { pr_parallel, 0, 4|2|1, "parallel", p_bool }, + { pr_parallel_lp, pr_parallel, 4|2|1, "parallel.lp", p_bool }, + { pr_parallel_zip, pr_parallel, 4|2|1, "parallel.zip", p_bool }, + { pr_parallel_imm, 0, 0, "parallel.imm", p_bool }, + { pr_isa, 0, 0, "isa", p_bool }, + { pr_isa_isdn, pr_isa, 0, "isa.isdn", p_bool }, + { pr_isdn, 0, 4|2|1, "isdn", p_bool }, + { pr_kbd, 0, 8|4|2|1, "kbd", p_bool }, + { pr_prom, 0, 8|4|2|1, "prom", p_bool }, + { pr_sbus, 0, 8|4|2|1, "sbus", p_bool }, + { pr_int, 0, 8|4|2|1, "int", p_bool }, #if defined(__i386__) || defined (__x86_64__) - { pr_braille, 0, 4|2|1, "braille" }, - { pr_braille_alva, pr_braille, 4|2|1, "braille.alva" }, - { pr_braille_fhp, pr_braille, 4|2|1, "braille.fhp" }, - { pr_braille_ht, pr_braille, 4|2|1, "braille.ht" }, - { pr_braille_baum, pr_braille, 4|2|1, "braille.baum" }, + { pr_braille, 0, 4|2|1, "braille", p_bool }, + { pr_braille_alva, pr_braille, 4|2|1, "braille.alva", p_bool }, + { pr_braille_fhp, pr_braille, 4|2|1, "braille.fhp", p_bool }, + { pr_braille_ht, pr_braille, 4|2|1, "braille.ht", p_bool }, + { pr_braille_baum, pr_braille, 4|2|1, "braille.baum", p_bool }, #else - { pr_braille, 0, 4|2 , "braille" }, - { pr_braille_alva, pr_braille, 0, "braille.alva" }, - { pr_braille_fhp, pr_braille, 4|2 , "braille.fhp" }, - { pr_braille_ht, pr_braille, 4|2 , "braille.ht" }, - { pr_braille_baum, pr_braille, 4|2 , "braille.baum" }, -#endif - { pr_ignx11, 0, 0, "ignx11" }, - { pr_sys, 0, 8|4|2|1, "sys" }, - { pr_manual, 0, 0, "manual" }, - { pr_fb, 0, 8|4|2|1, "fb" }, - { pr_pppoe, 0, 8|4|2|1, "pppoe" }, + { pr_braille, 0, 4|2 , "braille", p_bool }, + { pr_braille_alva, pr_braille, 0, "braille.alva", p_bool }, + { pr_braille_fhp, pr_braille, 4|2 , "braille.fhp", p_bool }, + { pr_braille_ht, pr_braille, 4|2 , "braille.ht", p_bool }, + { pr_braille_baum, pr_braille, 4|2 , "braille.baum", p_bool }, +#endif + { pr_ignx11, 0, 0, "ignx11", p_bool }, + { pr_sys, 0, 8|4|2|1, "sys", p_bool }, + { pr_manual, 0, 0, "manual", p_bool }, + { pr_fb, 0, 8|4|2|1, "fb", p_bool }, + { pr_pppoe, 0, 8|4|2|1, "pppoe", p_bool }, /* dummy, used to turn off hwscan */ - { pr_scan, 0, 0, "scan" }, - { pr_pcmcia, 0, 8|4|2|1, "pcmcia" }, - { pr_fork, 0, 0, "fork" }, - { pr_cpuemu, 0, 0, "cpuemu" }, - { pr_cpuemu_debug, pr_cpuemu, 0, "cpuemu.debug" }, - { pr_sysfs, 0, 0, "sysfs" }, - { pr_udev, 0, 8|4|2|1, "udev" }, - { pr_block, 0, 8|4|2|1, "block" }, - { pr_block_cdrom, pr_block, 8|4|2|1, "block.cdrom" }, - { pr_block_part, pr_block, 8|4|2|1, "block.part" }, - { pr_block_mods, pr_block, 8|4|2|1, "block.mods" }, - { pr_edd, 0, 8|4|2|1, "edd" }, - { pr_edd_mod, pr_edd, 8|4|2|1, "edd.mod" }, - { pr_input, 0, 8|4|2|1, "input" }, - { pr_wlan, 0, 8|4|2|1, "wlan" }, - { pr_hal, 0, 0, "hal" }, - { pr_modules_pata, 0, 0, "modules.pata" } + { pr_scan, 0, 0, "scan", p_bool }, + { pr_pcmcia, 0, 8|4|2|1, "pcmcia", p_bool }, + { pr_fork, 0, 0, "fork", p_bool }, + { pr_cpuemu, 0, 0, "cpuemu", p_bool }, + { pr_cpuemu_debug, pr_cpuemu, 0, "cpuemu.debug", p_bool }, + { pr_sysfs, 0, 0, "sysfs", p_bool }, + { pr_udev, 0, 8|4|2|1, "udev", p_bool }, + { pr_block, 0, 8|4|2|1, "block", p_bool }, + { pr_block_cdrom, pr_block, 8|4|2|1, "block.cdrom", p_bool }, + { pr_block_part, pr_block, 8|4|2|1, "block.part", p_bool }, + { pr_block_mods, pr_block, 8|4|2|1, "block.mods", p_bool }, + { pr_edd, 0, 8|4|2|1, "edd", p_bool }, + { pr_edd_mod, pr_edd, 8|4|2|1, "edd.mod", p_bool }, + { pr_input, 0, 8|4|2|1, "input", p_bool }, + { pr_wlan, 0, 8|4|2|1, "wlan", p_bool }, + { pr_hal, 0, 0, "hal", p_bool }, + { pr_modules_pata, 0, 0, "modules.pata", p_bool }, + { pr_x86emu, 0, 0, "x86emu", p_list }, }; -struct s_pr_flags *get_pr_flags(enum probe_feature feature) + +/* + * Returns pointer to probe feature struct for name. + * If name is not a valid probe feature, NULL is returned. + * + */ +pr_flags_t *pr_flags_by_name(char *name) { - int i; + unsigned u; + + if(!name) return NULL; + + for(u = 0; u < sizeof pr_flags / sizeof *pr_flags; u++) { + if(!strcmp(name, pr_flags[u].name)) return pr_flags + u; + } + + return NULL; +} + + +pr_flags_t *pr_flags_by_id(enum probe_feature feature) +{ + unsigned u; + + for(u = 0; u < sizeof pr_flags / sizeof *pr_flags; u++) { + if(feature == pr_flags[u].val) return pr_flags + u; + } + + return NULL; +} + + +int get_probe_val_int(hd_data_t *hd_data, enum probe_feature feature) +{ + pr_flags_t *flags; + hal_prop_t *prop; + + flags = pr_flags_by_id(feature); + if(flags) { + prop = hal_get_int32(hd_data->probe_val, flags->name); + if(prop) return prop->val.int32; + } + + return 0; +} + + +char *get_probe_val_str(hd_data_t *hd_data, enum probe_feature feature) +{ + pr_flags_t *flags; + hal_prop_t *prop; + + flags = pr_flags_by_id(feature); + if(flags) { + prop = hal_get_str(hd_data->probe_val, flags->name); + if(prop) return prop->val.str; + } + + return NULL; +} - for(i = 0; (unsigned) i < sizeof pr_flags / sizeof *pr_flags; i++) { - if(feature == pr_flags[i].val) return pr_flags + i; + +str_list_t *get_probe_val_list(hd_data_t *hd_data, enum probe_feature feature) +{ + pr_flags_t *flags; + hal_prop_t *prop; + + flags = pr_flags_by_id(feature); + if(flags) { + prop = hal_get_list(hd_data->probe_val, flags->name); + if(prop) return prop->val.list; } return NULL; } + void fix_probe_features(hd_data_t *hd_data) { int i; - for(i = 0; (unsigned) i < sizeof hd_data->probe; i++) { + for(i = 0; i < sizeof hd_data->probe; i++) { hd_data->probe[i] |= hd_data->probe_set[i]; hd_data->probe[i] &= ~hd_data->probe_clr[i]; } @@ -367,9 +431,9 @@ { unsigned ofs, bit, mask; int i; - struct s_pr_flags *pr; + pr_flags_t *pr; - if(!(pr = get_pr_flags(feature))) return; + if(!(pr = pr_flags_by_id(feature))) return; if(pr->parent == -1u) { mask = pr->mask; @@ -400,7 +464,7 @@ { unsigned ofs, bit, mask; int i; - struct s_pr_flags *pr; + pr_flags_t *pr; #ifdef LIBHD_MEMCHECK { @@ -409,7 +473,7 @@ } #endif - if(!(pr = get_pr_flags(feature))) return; + if(!(pr = pr_flags_by_id(feature))) return; if(pr->parent == -1u) { mask = pr->mask; @@ -432,7 +496,7 @@ { unsigned ofs, bit, mask; int i; - struct s_pr_flags *pr; + pr_flags_t *pr; #ifdef LIBHD_MEMCHECK { @@ -441,7 +505,7 @@ } #endif - if(!(pr = get_pr_flags(feature))) return; + if(!(pr = pr_flags_by_id(feature))) return; if(pr->parent == -1u) { mask = pr->mask; @@ -940,6 +1004,8 @@ hd_data->lsscsi = free_str_list(hd_data->lsscsi); + hd_data->probe_val = hd_free_hal_properties(hd_data->probe_val); + hd_data->last_idx = 0; hd_shm_done(hd_data); @@ -1744,6 +1810,7 @@ hd_t *hd, *hd2; uint64_t irqs; str_list_t *sl, *sl0; + pr_flags_t *pf; #ifdef LIBHD_MEMCHECK if(!libhd_log) { @@ -1789,8 +1856,28 @@ s = free_mem(s); for(i = 1; i < pr_default; i++) { /* 1 because of pr_memory */ - if((s = hd_probe_feature_by_value(i))) { - ADD2LOG("%s%c%s", i == 1 ? "" : " ", hd_probe_feature(hd_data, i) ? '+' : '-', s); + pf = pr_flags_by_id(i); + if(pf) { + j = hd_probe_feature(hd_data, i); + ADD2LOG("%s%c%s", i == 1 ? "" : " ", j ? '+' : '-', pf->name); + if(j) switch(pf->type) { + case p_int32: + ADD2LOG("=%d", get_probe_val_int(hd_data, i)); + break; + + case p_string: + ADD2LOG("=%s", get_probe_val_str(hd_data, i) ?: ""); + break; + + case p_list: + s = hd_join(":", get_probe_val_list(hd_data, i)); + ADD2LOG("=%s", s ?: ""); + s = free_mem(s); + break; + + default: + break; + } } } @@ -2623,19 +2710,11 @@ */ enum probe_feature hd_probe_feature_by_name(char *name) { - unsigned u; - -#ifdef LIBHD_MEMCHECK - { - if(libhd_log) - fprintf(libhd_log, "; %s\t%p\t%p\n", __FUNCTION__, CALLED_FROM(hd_probe_feature_by_name, name), name); - } -#endif + pr_flags_t *flags; - for(u = 0; u < sizeof pr_flags / sizeof *pr_flags; u++) - if(!strcmp(name, pr_flags[u].name)) return pr_flags[u].val; + flags = pr_flags_by_name(name); - return 0; + return flags ? flags->val : 0; } @@ -2645,19 +2724,11 @@ */ char *hd_probe_feature_by_value(enum probe_feature feature) { - unsigned u; + pr_flags_t *flags; -#ifdef LIBHD_MEMCHECK - { - if(libhd_log) - fprintf(libhd_log, "; %s\t%p\t%u\n", __FUNCTION__, CALLED_FROM(hd_probe_feature_by_value, feature), feature); - } -#endif + flags = pr_flags_by_id(feature); - for(u = 0; u < sizeof pr_flags / sizeof *pr_flags; u++) - if(feature == pr_flags[u].val) return pr_flags[u].name; - - return NULL; + return flags ? flags->name : NULL; } @@ -3992,10 +4063,12 @@ void get_probe_env(hd_data_t *hd_data) { - char *s, *t, *env; + char *s, *t, *env, *t2, *t3; str_list_t *cmd = NULL; int j, k; char buf[10]; + hal_prop_t *prop; + pr_flags_t *flags; env = getenv("hwprobe"); if(!env) { @@ -4019,12 +4092,55 @@ } else { k = 2; -// ADD2LOG("hwprobe: +/- missing before \"%s\"\n", t); -// return; } - if((j = hd_probe_feature_by_name(t))) { - set_probe_feature(hd_data, j, k ? 1 : 0); + if((t2 = strchr(t, '=')) && t2 != t) *t2++ = 0; + + if((flags = pr_flags_by_name(t))) { + if(flags->type == p_bool) { + set_probe_feature(hd_data, j, k ? 1 : 0); + } + else { + prop = hal_get_any(hd_data->probe_val, t); + if(!prop) { + prop = hal_add_new(&hd_data->probe_val); + } + else { + hal_invalidate(prop); + } + switch(flags->type) { + case p_int32: + j = strtol(t2, &t3, 0); + if(!*t3) { + prop->type = flags->type; + prop->key = new_str(t); + prop->val.int32 = j; + set_probe_feature(hd_data, flags->val, j ? 1 : 0); + } + break; + + case p_string: + if(t2) { + prop->type = flags->type; + prop->key = new_str(t); + prop->val.str = new_str(t2); + set_probe_feature(hd_data, flags->val, *t2 ? 1 : 0); + } + break; + + case p_list: + if(t2) { + prop->type = flags->type; + prop->key = new_str(t); + prop->val.list = hd_split(':', t2); + set_probe_feature(hd_data, flags->val, prop->val.list ? 1 : 0); + } + break; + + default: + break; + } + } } else if(sscanf(t, "%8[^:]:%8[^:]:%8[^:]", buf, buf, buf) == 3) { add_str_list(&hd_data->xtra_hd, t - (k == 2 ? 0 : 1)); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/hd/hd.h new/hwinfo-16.0/src/hd/hd.h --- old/hwinfo-15.26/src/hd/hd.h 2009-01-22 11:41:22.000000000 +0100 +++ new/hwinfo-16.0/src/hd/hd.h 2009-05-12 16:25:06.000000000 +0200 @@ -19,7 +19,7 @@ */ /** Interface version */ -#define HD_VERSION 15 +#define HD_VERSION 16 /** * @defgroup DEBUGpub Debug flags @@ -117,8 +117,8 @@ pr_block, pr_block_cdrom, pr_block_part, pr_edd, pr_edd_mod, pr_bios_ddc, pr_bios_fb, pr_bios_mode, pr_input, pr_block_mods, pr_bios_vesa, pr_cpuemu_debug, pr_scsi_noserial, pr_wlan, pr_bios_crc, pr_hal, - pr_bios_vram, pr_bios_acpi, pr_bios_ddc_ports_1, pr_bios_ddc_ports_2, - pr_bios_ddc_ports_3, pr_bios_ddc_ports_4, pr_modules_pata, pr_net_eeprom, + pr_bios_vram, pr_bios_acpi, pr_bios_ddc_ports, pr_modules_pata, + pr_net_eeprom, pr_x86emu, pr_max, pr_lxrc, pr_default, pr_all /**< pr_all must be last */ } hd_probe_feature_t; @@ -2639,6 +2639,7 @@ unsigned char probe[(pr_all + 7) / 8]; /**< (Internal) bitmask of probing features. */ unsigned char probe_set[(pr_all + 7) / 8]; /**< (Iternal) bitmask of probing features that will always be set. */ unsigned char probe_clr[(pr_all + 7) / 8]; /**< (Internal) bitmask of probing features that will always be reset. */ + hal_prop_t *probe_val; /**< (Internal) probing features with arbitrary values */ unsigned last_idx; /**< (Internal) index of the last hd entry generated */ unsigned module; /**< (Internal) the current probing module we are in */ enum boot_arch boot; /**< (Internal) boot method */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/hd/hd_int.h new/hwinfo-16.0/src/hd/hd_int.h --- old/hwinfo-15.26/src/hd/hd_int.h 2008-09-15 11:56:07.000000000 +0200 +++ new/hwinfo-16.0/src/hd/hd_int.h 2009-05-12 17:45:26.000000000 +0200 @@ -240,12 +240,18 @@ char *hal_get_useful_str(hal_prop_t *prop, const char *key); hal_device_t *hal_find_device(hd_data_t *hd_data, char *udi); +hal_prop_t *hal_add_new(hal_prop_t **prop); char *hd_get_hddb_dir(void); char *hd_get_hddb_path(char *sub); int hd_mod_cmp(char *str1, char *str2); +int get_probe_val_int(hd_data_t *hd_data, enum probe_feature feature); +char *get_probe_val_str(hd_data_t *hd_data, enum probe_feature feature); +str_list_t *get_probe_val_list(hd_data_t *hd_data, enum probe_feature feature); + + #ifdef __cplusplus } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/hd/input.c new/hwinfo-16.0/src/hd/input.c --- old/hwinfo-15.26/src/hd/input.c 2008-05-30 17:03:13.000000000 +0200 +++ new/hwinfo-16.0/src/hd/input.c 2009-05-12 12:29:35.000000000 +0200 @@ -313,7 +313,7 @@ sl = sl0 = hd_split(' ', str); for(; sl; sl = sl->next) { u = strtoul(sl->str, NULL, 16); - str_printf(&s, -1, "%0*lx", sizeof (unsigned long) * 2, u); + str_printf(&s, -1, "%0*lx", (int) sizeof (unsigned long) * 2, u); } free_str_list(sl0); free_mem(str); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/hd/memory.c new/hwinfo-16.0/src/hd/memory.c --- old/hwinfo-15.26/src/hd/memory.c 2006-08-29 16:15:38.000000000 +0200 +++ new/hwinfo-16.0/src/hd/memory.c 2009-05-12 12:10:34.000000000 +0200 @@ -173,7 +173,7 @@ if(strstr(sl->str, "<6>BIOS-provided physical RAM map:") == sl->str) { for(sl = sl->next ; sl; sl = sl->next) { ADD2LOG(" -- %s", sl->str); - if(sscanf(sl->str, "<4> BIOS-e820: %"SCNx64" - %"SCNx64" (%63s", &u0, &u1, buf) != 3) break; + if(sscanf(sl->str, "<%*d> BIOS-e820: %"SCNx64" - %"SCNx64" (%63s", &u0, &u1, buf) != 3) break; if(strcmp(buf, "usable)")) continue; if(u1 < u0) break; mem += u1 - u0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/int10/i10_vbios.c new/hwinfo-16.0/src/int10/i10_vbios.c --- old/hwinfo-15.26/src/int10/i10_vbios.c 2006-03-09 14:12:55.000000000 +0100 +++ new/hwinfo-16.0/src/int10/i10_vbios.c 2009-05-12 12:10:34.000000000 +0200 @@ -413,7 +413,18 @@ static int copy_bios_ram(hd_data_t *hd_data) { - return hd_read_mmap(hd_data, MEM_FILE, (unsigned char *) 0, 0, 0x1000); + int i; + + i = hd_read_mmap(hd_data, MEM_FILE, (unsigned char *) 0, 0, 0x1000); + + /* + * bnc #469863 + * setup dummy int 0x15 + */ + *(uint32_t *) (0x15*4) = 0x00600000; // avoid seg 0 (due to stupid check in run_bios_int()) + *(uint8_t *) 0x600 = 0xcf; + + return i; } void loadCodeToMem(unsigned char *ptr, CARD8 *code) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/src/int10/int10.c new/hwinfo-16.0/src/int10/int10.c --- old/hwinfo-15.26/src/int10/int10.c 2007-09-12 11:26:01.000000000 +0200 +++ new/hwinfo-16.0/src/int10/int10.c 2009-05-12 16:52:56.000000000 +0200 @@ -96,10 +96,9 @@ /* notebooks like to have it at port 3 */ if((is.dell || is.nvidia) && is.notebook) vbe->ddc_ports = 3; - if(hd_probe_feature(hd_data, pr_bios_ddc_ports_1)) vbe->ddc_ports = 1; - if(hd_probe_feature(hd_data, pr_bios_ddc_ports_2)) vbe->ddc_ports = 2; - if(hd_probe_feature(hd_data, pr_bios_ddc_ports_3)) vbe->ddc_ports = 3; - if(hd_probe_feature(hd_data, pr_bios_ddc_ports_4)) vbe->ddc_ports = 4; + i = get_probe_val_int(hd_data, pr_bios_ddc_ports); + if(i > sizeof vbe->ddc_port / sizeof *vbe->ddc_port) i = sizeof vbe->ddc_port / sizeof *vbe->ddc_port; + if(i) vbe->ddc_ports = i; if(hd_probe_feature(hd_data, pr_bios_ddc)) { PROGRESS(4, 3, "ddc info"); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-15.26/VERSION new/hwinfo-16.0/VERSION --- old/hwinfo-15.26/VERSION 2009-01-22 12:33:00.000000000 +0100 +++ new/hwinfo-16.0/VERSION 2009-05-12 12:27:16.000000000 +0200 @@ -1 +1 @@ -15.26 +16.0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org