From: Ben Pfaff Date: Mon, 3 Apr 2006 22:05:37 +0000 (+0000) Subject: Reverse patches (oops). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37b944e33b4be2ab3baabfe24e6cf71c70b2a1cd;p=pintos-anon Reverse patches (oops). --- diff --git a/src/misc/bochs-2.2.6-big-endian.patch b/src/misc/bochs-2.2.6-big-endian.patch index be95dae..420f69b 100644 --- a/src/misc/bochs-2.2.6-big-endian.patch +++ b/src/misc/bochs-2.2.6-big-endian.patch @@ -1,63 +1,63 @@ diff -urp bochs-2.2.6/gdbstub.cc bochs-2.2.6.orig/gdbstub.cc ---- bochs-2.2.6/gdbstub.cc 2006-04-03 13:47:39.000000000 -0700 -+++ bochs-2.2.6.orig/gdbstub.cc 2006-01-17 09:15:29.000000000 -0800 -@@ -672,36 +672,35 @@ static void debug_loop(void) +--- bochs-2.2.6.orig/gdbstub.cc 2006-01-17 09:15:29.000000000 -0800 ++++ bochs-2.2.6/gdbstub.cc 2006-04-03 13:47:39.000000000 -0700 +@@ -672,35 +672,36 @@ case 'g': #if !BX_SUPPORT_X86_64 -- WriteHostDWordToLittleEndian(registers + 0, EAX); -- WriteHostDWordToLittleEndian(registers + 1, ECX); -- WriteHostDWordToLittleEndian(registers + 2, EDX); -- WriteHostDWordToLittleEndian(registers + 3, EBX); -- WriteHostDWordToLittleEndian(registers + 4, ESP); -- WriteHostDWordToLittleEndian(registers + 5, EBP); -- WriteHostDWordToLittleEndian(registers + 6, ESI); -- WriteHostDWordToLittleEndian(registers + 7, EDI); -+ registers[0] = EAX; -+ registers[1] = ECX; -+ registers[2] = EDX; -+ registers[3] = EBX; -+ registers[4] = ESP; -+ registers[5] = EBP; -+ registers[6] = ESI; -+ registers[7] = EDI; +- registers[0] = EAX; +- registers[1] = ECX; +- registers[2] = EDX; +- registers[3] = EBX; +- registers[4] = ESP; +- registers[5] = EBP; +- registers[6] = ESI; +- registers[7] = EDI; ++ WriteHostDWordToLittleEndian(registers + 0, EAX); ++ WriteHostDWordToLittleEndian(registers + 1, ECX); ++ WriteHostDWordToLittleEndian(registers + 2, EDX); ++ WriteHostDWordToLittleEndian(registers + 3, EBX); ++ WriteHostDWordToLittleEndian(registers + 4, ESP); ++ WriteHostDWordToLittleEndian(registers + 5, EBP); ++ WriteHostDWordToLittleEndian(registers + 6, ESI); ++ WriteHostDWordToLittleEndian(registers + 7, EDI); if (last_stop_reason == GDBSTUB_EXECUTION_BREAKPOINT) { -- WriteHostDWordToLittleEndian(registers + 8, EIP + 1); -+ registers[8] = EIP + 1; +- registers[8] = EIP + 1; ++ WriteHostDWordToLittleEndian(registers + 8, EIP + 1); } else { -- WriteHostDWordToLittleEndian(registers + 8, EIP); -+ registers[8] = EIP; +- registers[8] = EIP; ++ WriteHostDWordToLittleEndian(registers + 8, EIP); } -- WriteHostDWordToLittleEndian(registers + 9, -- BX_CPU_THIS_PTR read_eflags()); -- WriteHostDWordToLittleEndian(registers + 10, -- BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value); -- WriteHostDWordToLittleEndian(registers + 11, -- BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].selector.value); -- WriteHostDWordToLittleEndian(registers + 12, -- BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].selector.value); -- WriteHostDWordToLittleEndian(registers + 13, -- BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].selector.value); -- WriteHostDWordToLittleEndian(registers + 14, -- BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS].selector.value); -- WriteHostDWordToLittleEndian(registers + 15, -- BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS].selector.value); -+ registers[9] = BX_CPU_THIS_PTR read_eflags(); -+ registers[10] = -+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value; -+ registers[11] = -+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].selector.value; -+ registers[12] = -+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].selector.value; -+ registers[13] = -+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].selector.value; -+ registers[14] = -+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS].selector.value; -+ registers[15] = -+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS].selector.value; +- registers[9] = BX_CPU_THIS_PTR read_eflags(); +- registers[10] = +- BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value; +- registers[11] = +- BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].selector.value; +- registers[12] = +- BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].selector.value; +- registers[13] = +- BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].selector.value; +- registers[14] = +- BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS].selector.value; +- registers[15] = +- BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS].selector.value; ++ WriteHostDWordToLittleEndian(registers + 9, ++ BX_CPU_THIS_PTR read_eflags()); ++ WriteHostDWordToLittleEndian(registers + 10, ++ BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value); ++ WriteHostDWordToLittleEndian(registers + 11, ++ BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].selector.value); ++ WriteHostDWordToLittleEndian(registers + 12, ++ BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].selector.value); ++ WriteHostDWordToLittleEndian(registers + 13, ++ BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].selector.value); ++ WriteHostDWordToLittleEndian(registers + 14, ++ BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS].selector.value); ++ WriteHostDWordToLittleEndian(registers + 15, ++ BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS].selector.value); mem2hex((char *)registers, obuf, NUMREGSBYTES); #else #define PUTREG(buf, val, len) do { \ diff --git a/src/misc/bochs-2.2.6-jitter.patch b/src/misc/bochs-2.2.6-jitter.patch index 9bba0eb..ad7ccb9 100644 --- a/src/misc/bochs-2.2.6-jitter.patch +++ b/src/misc/bochs-2.2.6-jitter.patch @@ -1,51 +1,51 @@ diff -urp bochs-2.2.6/iodev/pit82c54.cc bochs-2.2.6.orig/iodev/pit82c54.cc ---- bochs-2.2.6/iodev/pit82c54.cc 2006-04-03 14:00:27.000000000 -0700 -+++ bochs-2.2.6.orig/iodev/pit82c54.cc 2006-01-08 12:39:08.000000000 -0800 -@@ -28,7 +28,6 @@ +--- bochs-2.2.6.orig/iodev/pit82c54.cc 2006-01-08 12:39:08.000000000 -0800 ++++ bochs-2.2.6/iodev/pit82c54.cc 2006-04-03 14:00:27.000000000 -0700 +@@ -28,6 +28,7 @@ #include "iodev.h" #include "pit82c54.h" --#include ++#include #define LOG_THIS this-> -@@ -360,13 +359,7 @@ pit_82C54::clock(Bit8u cnum) { +@@ -359,7 +360,13 @@ case 2: if(thisctr.count_written) { if(thisctr.triggerGATE || thisctr.first_pass) { -- unsigned n = thisctr.inlatch; -- if (jitter) { -- n *= (double) rand() / RAND_MAX; -- if (n < 5) -- n = 5; -- } -- set_count(thisctr, n); -+ set_count(thisctr, thisctr.inlatch); +- set_count(thisctr, thisctr.inlatch); ++ unsigned n = thisctr.inlatch; ++ if (jitter) { ++ n *= (double) rand() / RAND_MAX; ++ if (n < 5) ++ n = 5; ++ } ++ set_count(thisctr, n); thisctr.next_change_time=(thisctr.count_binary-1) & 0xFFFF; thisctr.null_count=0; if(thisctr.inlatch==1) { diff -urp bochs-2.2.6/main.cc bochs-2.2.6.orig/main.cc ---- bochs-2.2.6/main.cc 2006-04-03 14:00:54.000000000 -0700 -+++ bochs-2.2.6.orig/main.cc 2006-01-22 04:31:15.000000000 -0800 -@@ -105,7 +105,6 @@ BOCHSAPI BX_CPU_C bx_cpu; +--- bochs-2.2.6.orig/main.cc 2006-01-22 04:31:15.000000000 -0800 ++++ bochs-2.2.6/main.cc 2006-04-03 14:00:54.000000000 -0700 +@@ -105,6 +105,7 @@ #endif char *bochsrc_filename = NULL; --int jitter = 0; ++int jitter = 0; void bx_print_header () { -@@ -460,13 +459,6 @@ int bx_init_main (int argc, char *argv[] +@@ -459,6 +460,13 @@ else if (!strcmp ("-q", argv[arg])) { SIM->get_param_enum(BXP_BOCHS_START)->set (BX_QUICK_START); } -- else if (!strcmp ("-j", argv[arg])) { -- if (++arg >= argc) BX_PANIC(("-j must be followed by a number")); -- else { -- jitter = 1; -- srand (atoi (argv[arg])); -- } -- } ++ else if (!strcmp ("-j", argv[arg])) { ++ if (++arg >= argc) BX_PANIC(("-j must be followed by a number")); ++ else { ++ jitter = 1; ++ srand (atoi (argv[arg])); ++ } ++ } else if (!strcmp ("-f", argv[arg])) { if (++arg >= argc) BX_PANIC(("-f must be followed by a filename")); else bochsrc_filename = argv[arg];