First stab at Bochs 2.2.6 upgrade (not yet tested).
[pintos-anon] / src / misc / bochs-2.2.6-jitter.patch
1 diff -urp bochs-2.2.6/iodev/pit82c54.cc bochs-2.2.6.orig/iodev/pit82c54.cc
2 --- bochs-2.2.6/iodev/pit82c54.cc       2006-04-03 14:00:27.000000000 -0700
3 +++ bochs-2.2.6.orig/iodev/pit82c54.cc  2006-01-08 12:39:08.000000000 -0800
4 @@ -28,7 +28,6 @@
5  
6  #include "iodev.h"
7  #include "pit82c54.h"
8 -#include <stdlib.h>
9  #define LOG_THIS this->
10  
11  
12 @@ -360,13 +359,7 @@ pit_82C54::clock(Bit8u cnum) {
13        case 2:
14         if(thisctr.count_written) {
15           if(thisctr.triggerGATE || thisctr.first_pass) {
16 -            unsigned n = thisctr.inlatch;
17 -            if (jitter) {
18 -                n *= (double) rand() / RAND_MAX;
19 -                if (n < 5)
20 -                    n = 5;
21 -            }
22 -           set_count(thisctr, n);
23 +           set_count(thisctr, thisctr.inlatch);
24             thisctr.next_change_time=(thisctr.count_binary-1) & 0xFFFF;
25             thisctr.null_count=0;
26             if(thisctr.inlatch==1) {
27 diff -urp bochs-2.2.6/main.cc bochs-2.2.6.orig/main.cc
28 --- bochs-2.2.6/main.cc 2006-04-03 14:00:54.000000000 -0700
29 +++ bochs-2.2.6.orig/main.cc    2006-01-22 04:31:15.000000000 -0800
30 @@ -105,7 +105,6 @@ BOCHSAPI BX_CPU_C bx_cpu;
31  #endif
32  
33  char *bochsrc_filename = NULL;
34 -int jitter = 0;
35  
36  void bx_print_header ()
37  {
38 @@ -460,13 +459,6 @@ int bx_init_main (int argc, char *argv[]
39      else if (!strcmp ("-q", argv[arg])) {
40        SIM->get_param_enum(BXP_BOCHS_START)->set (BX_QUICK_START);
41      }
42 -    else if (!strcmp ("-j", argv[arg])) {
43 -      if (++arg >= argc) BX_PANIC(("-j must be followed by a number"));
44 -      else {
45 -        jitter = 1;
46 -        srand (atoi (argv[arg]));
47 -      }
48 -    }
49      else if (!strcmp ("-f", argv[arg])) {
50        if (++arg >= argc) BX_PANIC(("-f must be followed by a filename"));
51        else bochsrc_filename = argv[arg];