Hello community, here is the log from the commit of package acpica for openSUSE:11.4 checked in at Sun Feb 27 12:38:21 CET 2011.
-------- --- old-versions/11.4/all/acpica/acpica.changes 2011-01-14 16:02:04.000000000 +0100 +++ 11.4/acpica/acpica.changes 2011-02-24 16:32:20.000000000 +0100 @@ -1,0 +2,5 @@ +Thu Feb 24 15:31:07 UTC 2011 - [email protected] + +- Add possibility to see changes via new -s param: -r [ -s sleep ] + +------------------------------------------------------------------- calling whatdependson for 11.4-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ acpica.spec ++++++ --- /var/tmp/diff_new_pack.UGNDIr/_old 2011-02-27 12:37:59.000000000 +0100 +++ /var/tmp/diff_new_pack.UGNDIr/_new 2011-02-27 12:37:59.000000000 +0100 @@ -21,7 +21,7 @@ Name: acpica Url: http://acpica.org Version: 20110112 -Release: 1 +Release: 4.<RELEASE2> License: Intel ACPICA %define src_dir acpica-unix-%{version} %define dmp_ver 20101221 ++++++ ec_access.c ++++++ --- /var/tmp/diff_new_pack.UGNDIr/_old 2011-02-27 12:38:00.000000000 +0100 +++ /var/tmp/diff_new_pack.UGNDIr/_new 2011-02-27 12:38:00.000000000 +0100 @@ -28,6 +28,7 @@ */ static int read_mode = -1; +static int sleep_time; static int write_byte_offset = -1; static int read_byte_offset = -1; static uint8_t write_value = -1; @@ -35,16 +36,18 @@ void usage(char progname[], int exit_status) { printf("Usage:\n"); - printf("1) %s -r\n", basename(progname)); + printf("1) %s -r [-s sleep]\n", basename(progname)); printf("2) %s -b byte_offset\n", basename(progname)); printf("3) %s -w byte_offset -v value\n\n", basename(progname)); - puts("\t-r or --read -- Dump EC registers"); - puts("\t-b or --byte byte_offset -- Read value " + puts("\t-r [-s sleep] : Dump EC registers"); + puts("\t If sleep is given, sleep x seconds,"); + puts("\t re-read EC registers and show changes"); + puts("\t-b offset : Read value" " at byte_offset (in hex)"); - puts("\t-w or --write byte_offset -v or --value value -- " + puts("\t-w offset -v value : " "Write value at byte_offset"); - puts("\t-h or --help -- Print this help\n\n"); + puts("\t-h : Print this help\n\n"); puts("Offsets and values are in hexadecimal number sytem."); puts("The offset and value must be between 0 and 0xff."); exit(exit_status); @@ -53,21 +56,8 @@ void parse_opts(int argc, char *argv[]) { int c; - struct option long_options[] = { - {"read", 0, 0, 'r'}, - {"byte", 0, 0, 'b'}, - {"write", 1, 0, 'w'}, - {"value", 1, 0, 'v'}, - {"help", 0, 0, 'h'}, - {0, 0, 0, 0} - }; - - while (1) { - c = getopt_long(argc, argv, "rb:w:v:h", - long_options, NULL); - if (c == -1) - break; + while ((c = getopt(argc, argv, "rs:b:w:v:h")) != -1) { switch (c) { case 'r': @@ -75,6 +65,17 @@ usage (argv[0], EXIT_FAILURE); read_mode = 1; break; + case 's': + if (read_mode != -1 && read_mode != 1) + usage (argv[0], EXIT_FAILURE); + + sleep_time = atoi(optarg); + if (sleep_time <= 0) { + sleep_time = 0; + usage(argv[0], EXIT_FAILURE); + printf("Bad sleep time: %s\n", optarg); + } + break; case 'b': if (read_mode != -1) usage (argv[0], EXIT_FAILURE); @@ -127,6 +128,7 @@ void dump_ec(int fd) { char buf[EC_SPACE_SIZE]; + char buf2[EC_SPACE_SIZE]; int byte_off, bytes_read; bytes_read = read(fd, buf, EC_SPACE_SIZE); @@ -137,14 +139,40 @@ if (bytes_read != EC_SPACE_SIZE) fprintf(stderr, "Could only read %d bytes\n", bytes_read); - printf("\t00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"); + printf(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); + for (byte_off = 0; byte_off < bytes_read; byte_off++) { + if ((byte_off % 16) == 0) + printf("\n%.2X: ", byte_off); + printf(" %.2x ", (uint8_t)buf[byte_off]); + } + printf("\n"); + + if (!sleep_time) + return; + + printf("\n"); + lseek(fd, 0, SEEK_SET); + sleep(sleep_time); + + bytes_read = read(fd, buf2, EC_SPACE_SIZE); + + if (bytes_read == -1) + err(EXIT_FAILURE, "Could not read from %s\n", SYSFS_PATH); + + if (bytes_read != EC_SPACE_SIZE) + fprintf(stderr, "Could only read %d bytes\n", bytes_read); + + printf(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); for (byte_off = 0; byte_off < bytes_read; byte_off++) { if ((byte_off % 16) == 0) - printf("\n%.2X: \t", byte_off); - printf("%.2x ", (uint8_t)buf[byte_off]); + printf("\n%.2X: ", byte_off); + + if (buf[byte_off] == buf2[byte_off]) + printf(" %.2x ", (uint8_t)buf2[byte_off]); + else + printf("*%.2x ", (uint8_t)buf2[byte_off]); } printf("\n"); - sync(); } void read_ec_val(int fd, int byte_offset) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
