aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/kfreebsd-support-hotspot.diff
blob: dfa103e8e9dc9104ca1b912b3c0744dfd6ce3b41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
From 7268bef341b5668169892f5ac0569d5161d25ec9 Mon Sep 17 00:00:00 2001
Message-Id: <7268bef341b5668169892f5ac0569d5161d25ec9.1368289639.git.agx@sigxcpu.org>
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Sat, 11 May 2013 18:26:43 +0200
Subject: [PATCH] kfreebsd-support-hotspot.diff

---
 agent/src/os/linux/LinuxDebuggerLocal.c  |   44 ++++++++-
 agent/src/os/linux/libproc.h             |    8 ++
 agent/src/os/linux/ps_core.c             |   38 ++++++++
 agent/src/os/linux/ps_proc.c             |   54 +++++++++++
 make/defs.make                           |    7 +-
 make/linux/Makefile                      |    3 +
 make/linux/makefiles/defs.make           |    2 +-
 src/os/linux/vm/attachListener_linux.cpp |   18 +++-
 src/os/linux/vm/jvm_linux.cpp            |    2 +
 src/os/linux/vm/os_linux.cpp             |   32 +++++++
 src/os/posix/launcher/java_md.c          |   12 +--
 src/os_cpu/linux_x86/vm/os_linux_x86.cpp |  150 ++++++++++++++++++++++++++++++
 src/share/vm/memory/allocation.hpp       |    6 +-
 src/share/vm/oops/generateOopMap.cpp     |   10 +-
 14 files changed, 362 insertions(+), 24 deletions(-)

diff --git openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c openjdk/agent/src/os/linux/LinuxDebuggerLocal.c
index 5771fdd..5019266 100644
--- openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
+++ openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
@@ -316,7 +316,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
 
 #ifdef i386
 #define REG_INDEX(reg) sun_jvm_hotspot_debugger_x86_X86ThreadContext_##reg
-
+#ifdef __linux__
   regs[REG_INDEX(GS)]  = (uintptr_t) gregs.xgs;
   regs[REG_INDEX(FS)]  = (uintptr_t) gregs.xfs;
   regs[REG_INDEX(ES)]  = (uintptr_t) gregs.xes;
@@ -332,7 +332,23 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
   regs[REG_INDEX(PC)] = (uintptr_t) gregs.eip;
   regs[REG_INDEX(CS)]  = (uintptr_t) gregs.xcs;
   regs[REG_INDEX(SS)]  = (uintptr_t) gregs.xss;
-
+#elif defined(__FreeBSD_kernel__)
+  regs[REG_INDEX(GS)]  = (uintptr_t) gregs.r_gs;
+  regs[REG_INDEX(FS)]  = (uintptr_t) gregs.r_fs;
+  regs[REG_INDEX(ES)]  = (uintptr_t) gregs.r_es;
+  regs[REG_INDEX(DS)]  = (uintptr_t) gregs.r_ds;
+  regs[REG_INDEX(EDI)] = (uintptr_t) gregs.r_edi;
+  regs[REG_INDEX(ESI)] = (uintptr_t) gregs.r_esi;
+  regs[REG_INDEX(FP)] = (uintptr_t) gregs.r_ebp;
+  regs[REG_INDEX(SP)] = (uintptr_t) gregs.r_isp;
+  regs[REG_INDEX(EBX)] = (uintptr_t) gregs.r_ebx;
+  regs[REG_INDEX(EDX)] = (uintptr_t) gregs.r_edx;
+  regs[REG_INDEX(ECX)] = (uintptr_t) gregs.r_ecx;
+  regs[REG_INDEX(EAX)] = (uintptr_t) gregs.r_eax;
+  regs[REG_INDEX(PC)] = (uintptr_t) gregs.r_eip;
+  regs[REG_INDEX(CS)]  = (uintptr_t) gregs.r_cs;
+  regs[REG_INDEX(SS)]  = (uintptr_t) gregs.r_ss;
+#endif
 #endif /* i386 */
 
 #if ia64
@@ -344,7 +360,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
 
 #ifdef amd64
 #define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
-
+#ifdef __linux__
   regs[REG_INDEX(R15)] = gregs.r15;
   regs[REG_INDEX(R14)] = gregs.r14;
   regs[REG_INDEX(R13)] = gregs.r13;
@@ -370,7 +386,27 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
   regs[REG_INDEX(ES)] = gregs.es;
   regs[REG_INDEX(FS)] = gregs.fs;
   regs[REG_INDEX(GS)] = gregs.gs;
-
+#elif defined(__FreeBSD_kernel__)
+  regs[REG_INDEX(R15)] = gregs.r_r15;
+  regs[REG_INDEX(R14)] = gregs.r_r14;
+  regs[REG_INDEX(R13)] = gregs.r_r13;
+  regs[REG_INDEX(R12)] = gregs.r_r12;
+  regs[REG_INDEX(RBP)] = gregs.r_rbp;
+  regs[REG_INDEX(RBX)] = gregs.r_rbx;
+  regs[REG_INDEX(R11)] = gregs.r_r11;
+  regs[REG_INDEX(R10)] = gregs.r_r10;
+  regs[REG_INDEX(R9)] = gregs.r_r9;
+  regs[REG_INDEX(R8)] = gregs.r_r8;
+  regs[REG_INDEX(RAX)] = gregs.r_rax;
+  regs[REG_INDEX(RCX)] = gregs.r_rcx;
+  regs[REG_INDEX(RDX)] = gregs.r_rdx;
+  regs[REG_INDEX(RSI)] = gregs.r_rsi;
+  regs[REG_INDEX(RDI)] = gregs.r_rdi;
+  regs[REG_INDEX(RIP)] = gregs.r_rip;
+  regs[REG_INDEX(CS)] = gregs.r_cs;
+  regs[REG_INDEX(RSP)] = gregs.r_rsp;
+  regs[REG_INDEX(SS)] = gregs.r_ss;
+#endif
 #endif /* amd64 */
 
 #if defined(sparc) || defined(sparcv9)
diff --git openjdk/hotspot/agent/src/os/linux/libproc.h openjdk/agent/src/os/linux/libproc.h
index 7edaa9c..8c2511c 100644
--- openjdk/hotspot/agent/src/os/linux/libproc.h
+++ openjdk/hotspot/agent/src/os/linux/libproc.h
@@ -27,6 +27,10 @@
 
 #include <unistd.h>
 #include <stdint.h>
+#if defined(__FreeBSD_kernel__)
+#include <sys/types.h>
+#include <machine/reg.h>
+#endif
 #include "proc_service.h"
 
 #if defined(sparc) || defined(sparcv9)
@@ -112,6 +116,10 @@ unsigned long   regs[IA64_REG_COUNT];     /* integer and fp regs */
 #define user_regs_struct  pt_regs
 #endif
 
+#if defined(__FreeBSD_kernel__)
+#define user_regs_struct reg
+#endif
+
 // This C bool type must be int for compatibility with Linux calls and
 // it would be a mistake to equivalence it to C++ bool on many platforms
 
diff --git openjdk/hotspot/agent/src/os/linux/ps_core.c openjdk/agent/src/os/linux/ps_core.c
index 9739e16..abf4da6 100644
--- openjdk/hotspot/agent/src/os/linux/ps_core.c
+++ openjdk/hotspot/agent/src/os/linux/ps_core.c
@@ -539,11 +539,16 @@ static bool core_handle_prstatus(struct ps_prochandle* ph, const char* buf, size
       return false;
 
    // copy regs
+#if defined(__FreeBSD_kernel__)
+   memcpy(&newthr->regs, &prstat->pr_reg, sizeof(struct user_regs_struct));
+#else
    memcpy(&newthr->regs, prstat->pr_reg, sizeof(struct user_regs_struct));
+#endif
 
    if (is_debug()) {
       print_debug("integer regset\n");
 #ifdef i386
+#ifdef __linux__
       // print the regset
       print_debug("\teax = 0x%x\n", newthr->regs.eax);
       print_debug("\tebx = 0x%x\n", newthr->regs.ebx);
@@ -554,9 +559,21 @@ static bool core_handle_prstatus(struct ps_prochandle* ph, const char* buf, size
       print_debug("\tesi = 0x%x\n", newthr->regs.esi);
       print_debug("\tedi = 0x%x\n", newthr->regs.edi);
       print_debug("\teip = 0x%x\n", newthr->regs.eip);
+#elif defined(__FreeBSD_kernel__)
+      print_debug("\teax = 0x%x\n", newthr->regs.r_eax);
+      print_debug("\tebx = 0x%x\n", newthr->regs.r_ebx);
+      print_debug("\tecx = 0x%x\n", newthr->regs.r_ecx);
+      print_debug("\tedx = 0x%x\n", newthr->regs.r_edx);
+      print_debug("\tesp = 0x%x\n", newthr->regs.r_esp);
+      print_debug("\tebp = 0x%x\n", newthr->regs.r_ebp);
+      print_debug("\tesi = 0x%x\n", newthr->regs.r_esi);
+      print_debug("\tedi = 0x%x\n", newthr->regs.r_edi);
+      print_debug("\teip = 0x%x\n", newthr->regs.r_eip);
+#endif
 #endif
 
 #if defined(amd64) || defined(x86_64)
+#ifdef __linux__
       // print the regset
       print_debug("\tr15 = 0x%lx\n", newthr->regs.r15);
       print_debug("\tr14 = 0x%lx\n", newthr->regs.r14);
@@ -585,6 +602,27 @@ static bool core_handle_prstatus(struct ps_prochandle* ph, const char* buf, size
       print_debug("\tes = 0x%lx\n", newthr->regs.es);
       print_debug("\tfs = 0x%lx\n", newthr->regs.fs);
       print_debug("\tgs = 0x%lx\n", newthr->regs.gs);
+#elif defined(__FreeBSD_kernel__)
+      print_debug("\tr15 = 0x%lx\n", newthr->regs.r_r15);
+      print_debug("\tr14 = 0x%lx\n", newthr->regs.r_r14);
+      print_debug("\tr13 = 0x%lx\n", newthr->regs.r_r13);
+      print_debug("\tr12 = 0x%lx\n", newthr->regs.r_r12);
+      print_debug("\trbp = 0x%lx\n", newthr->regs.r_rbp);
+      print_debug("\trbx = 0x%lx\n", newthr->regs.r_rbx);
+      print_debug("\tr11 = 0x%lx\n", newthr->regs.r_r11);
+      print_debug("\tr10 = 0x%lx\n", newthr->regs.r_r10);
+      print_debug("\tr9 = 0x%lx\n", newthr->regs.r_r9);
+      print_debug("\tr8 = 0x%lx\n", newthr->regs.r_r8);
+      print_debug("\trax = 0x%lx\n", newthr->regs.r_rax);
+      print_debug("\trcx = 0x%lx\n", newthr->regs.r_rcx);
+      print_debug("\trdx = 0x%lx\n", newthr->regs.r_rdx);
+      print_debug("\trsi = 0x%lx\n", newthr->regs.r_rsi);
+      print_debug("\trdi = 0x%lx\n", newthr->regs.r_rdi);
+      print_debug("\trip = 0x%lx\n", newthr->regs.r_rip);
+      print_debug("\tcs = 0x%lx\n", newthr->regs.r_cs);
+      print_debug("\trsp = 0x%lx\n", newthr->regs.r_rsp);
+      print_debug("\tss = 0x%lx\n", newthr->regs.r_ss);
+#endif
 #endif
    }
 
diff --git openjdk/hotspot/agent/src/os/linux/ps_proc.c openjdk/agent/src/os/linux/ps_proc.c
index 676e88a..e3c678a 100644
--- openjdk/hotspot/agent/src/os/linux/ps_proc.c
+++ openjdk/hotspot/agent/src/os/linux/ps_proc.c
@@ -37,6 +37,18 @@
 #define __WALL          0x40000000  // Copied from /usr/include/linux/wait.h
 #endif
 
+#ifndef PTRACE_PEEKDATA
+#define PTRACE_PEEKDATA PT_READ_D
+#endif
+
+#ifndef PTRACE_ATTACH
+#define PTRACE_ATTACH PT_ATTACH
+#endif
+
+#ifndef PTRACE_DETACH
+#define PTRACE_DETACH PT_DETACH
+#endif
+
 // This file has the libproc implementation specific to live process
 // For core files, refer to ps_core.c
 
@@ -54,7 +66,11 @@ static inline uintptr_t align(uintptr_t ptr, size_t size) {
 // before calling process_read_data.
 
 static bool process_read_data(struct ps_prochandle* ph, uintptr_t addr, char *buf, size_t size) {
+#if defined(__FreeBSD_kernel__)
+  int rslt;
+#else
   long rslt;
+#endif
   size_t i, words;
   uintptr_t end_addr = addr + size;
   uintptr_t aligned_addr = align(addr, sizeof(long));
@@ -62,36 +78,62 @@ static bool process_read_data(struct ps_prochandle* ph, uintptr_t addr, char *bu
   if (aligned_addr != addr) {
     char *ptr = (char *)&rslt;
     errno = 0;
+#if defined(__FreeBSD_kernel__)
+    rslt = ptrace(PTRACE_PEEKDATA, ph->pid, (caddr_t) aligned_addr, 0);
+#else
     rslt = ptrace(PTRACE_PEEKDATA, ph->pid, aligned_addr, 0);
+#endif
     if (errno) {
       print_debug("ptrace(PTRACE_PEEKDATA, ..) failed for %d bytes @ %lx\n", size, addr);
       return false;
     }
     for (; aligned_addr != addr; aligned_addr++, ptr++);
+#if defined(__FreeBSD_kernel__)
+    for (; ((intptr_t)aligned_addr % sizeof(int)) && aligned_addr < end_addr;
+#else
     for (; ((intptr_t)aligned_addr % sizeof(long)) && aligned_addr < end_addr;
+#endif
         aligned_addr++)
        *(buf++) = *(ptr++);
   }
 
+#if defined(__FreeBSD_kernel__)
+  words = (end_addr - aligned_addr) / sizeof(int);
+#else
   words = (end_addr - aligned_addr) / sizeof(long);
+#endif
 
   // assert((intptr_t)aligned_addr % sizeof(long) == 0);
   for (i = 0; i < words; i++) {
     errno = 0;
+#if defined(__FreeBSD_kernel__)
+    rslt = ptrace(PTRACE_PEEKDATA, ph->pid, (caddr_t) aligned_addr, 0);
+#else
     rslt = ptrace(PTRACE_PEEKDATA, ph->pid, aligned_addr, 0);
+#endif
     if (errno) {
       print_debug("ptrace(PTRACE_PEEKDATA, ..) failed for %d bytes @ %lx\n", size, addr);
       return false;
     }
+#if defined(__FreeBSD_kernel__)
+    *(int *)buf = rslt;
+    buf += sizeof(int);
+    aligned_addr += sizeof(int);
+#else
     *(long *)buf = rslt;
     buf += sizeof(long);
     aligned_addr += sizeof(long);
+#endif
   }
 
   if (aligned_addr != end_addr) {
     char *ptr = (char *)&rslt;
     errno = 0;
+#if defined(__FreeBSD_kernel__)
+    rslt = ptrace(PTRACE_PEEKDATA, ph->pid, (caddr_t) aligned_addr, 0);
+#else
     rslt = ptrace(PTRACE_PEEKDATA, ph->pid, aligned_addr, 0);
+#endif
     if (errno) {
       print_debug("ptrace(PTRACE_PEEKDATA, ..) failed for %d bytes @ %lx\n", size, addr);
       return false;
@@ -130,7 +172,11 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
 #endif
 
 #ifdef PTRACE_GETREGS_REQ
+#if defined(__FreeBSD_kernel__)
+ if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, (caddr_t) user, 0) < 0) {
+#else
  if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) {
+#endif
    print_debug("ptrace(PTRACE_GETREGS, ...) failed for lwp %d\n", pid);
    return false;
  }
@@ -144,7 +190,11 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
 
 // attach to a process/thread specified by "pid"
 static bool ptrace_attach(pid_t pid) {
+#if defined(__FreeBSD_kernel__)
+  if (ptrace(PTRACE_ATTACH, pid, NULL, 0) < 0) {
+#else
   if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
+#endif
     print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
     return false;
   } else {
@@ -271,7 +321,11 @@ static bool read_lib_info(struct ps_prochandle* ph) {
 
 // detach a given pid
 static bool ptrace_detach(pid_t pid) {
+#if defined(__FreeBSD_kernel__)
+  if (pid && ptrace(PTRACE_DETACH, pid, NULL, 0) < 0) {
+#else
   if (pid && ptrace(PTRACE_DETACH, pid, NULL, NULL) < 0) {
+#endif
     print_debug("ptrace(PTRACE_DETACH, ..) failed for %d\n", pid);
     return false;
   } else {
diff --git openjdk/hotspot/make/defs.make openjdk/make/defs.make
index a0aa0e5..efd8995 100644
--- openjdk/hotspot/make/defs.make
+++ openjdk/hotspot/make/defs.make
@@ -118,9 +118,6 @@ endif
 # Windows should have OS predefined
 ifeq ($(OS),)
   OS   := $(shell uname -s)
-  ifneq ($(findstring BSD,$(OS)),)
-    OS=bsd
-  endif
   ifeq ($(OS), Darwin)
     OS=bsd
   endif
@@ -142,6 +139,10 @@ else
   OSNAME=linux
 endif
 
+ifeq ($(OS), GNU/kFreeBSD)
+  OSNAME=linux
+endif
+
 # Determinations of default make arguments and platform specific settings
 MAKE_ARGS=
 
diff --git openjdk/hotspot/make/linux/Makefile openjdk/make/linux/Makefile
index 0ae3f4c..572c3e9 100644
--- openjdk/hotspot/make/linux/Makefile
+++ openjdk/hotspot/make/linux/Makefile
@@ -234,6 +234,9 @@ checks: check_os_version check_j2se_version
 SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3%
 OS_VERSION := $(shell uname -r)
 EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
+ifeq ($(shell uname -s), GNU/kFreeBSD)
+EMPTY_IF_NOT_SUPPORTED = supported
+endif
 
 check_os_version:
 ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
diff --git openjdk/hotspot/make/linux/makefiles/defs.make openjdk/make/linux/makefiles/defs.make
index 70f502f..8bd7c4e 100644
--- openjdk/hotspot/make/linux/makefiles/defs.make
+++ openjdk/hotspot/make/linux/makefiles/defs.make
@@ -91,7 +91,7 @@ ifeq ($(ARCH), x86_64)
 endif
 
 # i686
-ifeq ($(ARCH), i686)
+ifneq (,$(filter i686 i386, $(ARCH)))
   ARCH_DATA_MODEL  = 32
   PLATFORM         = linux-i586
   VM_PLATFORM      = linux_i486
diff --git openjdk/hotspot/src/os/linux/vm/attachListener_linux.cpp openjdk/src/os/linux/vm/attachListener_linux.cpp
index 5b9c729..e88faa3 100644
--- openjdk/hotspot/src/os/linux/vm/attachListener_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/attachListener_linux.cpp
@@ -39,6 +39,10 @@
 #define UNIX_PATH_MAX   sizeof(((struct sockaddr_un *)0)->sun_path)
 #endif
 
+#if defined(__FreeBSD_kernel__)
+#include <sys/ucred.h>
+#endif
+
 // The attach mechanism on Linux uses a UNIX domain socket. An attach listener
 // thread is created at startup or is created on-demand via a signal from
 // the client tool. The attach listener creates a socket and binds it to a file
@@ -337,9 +341,15 @@ LinuxAttachOperation* LinuxAttachListener::dequeue() {
 
     // get the credentials of the peer and check the effective uid/guid
     // - check with jeff on this.
+#if defined(LOCAL_PEERCRED) /* GNU/kFreeBSD */
+    struct xucred cred_info;
+    socklen_t optlen = sizeof(cred_info);
+    if (::getsockopt(s, SOL_SOCKET, LOCAL_PEERCRED, (void*)&cred_info, &optlen) == -1) {
+#else
     struct ucred cred_info;
     socklen_t optlen = sizeof(cred_info);
     if (::getsockopt(s, SOL_SOCKET, SO_PEERCRED, (void*)&cred_info, &optlen) == -1) {
+#endif
       int res;
       RESTARTABLE(::close(s), res);
       continue;
@@ -347,10 +357,14 @@ LinuxAttachOperation* LinuxAttachListener::dequeue() {
     uid_t euid = geteuid();
     gid_t egid = getegid();
 
+#if defined(LOCAL_PEERCRED) /* GNU/kFreeBSD */
+    if (cred_info.cr_uid != euid || cred_info.cr_gid != egid) {
+#else
     if (cred_info.uid != euid || cred_info.gid != egid) {
-      int res;
+#endif
+      int res;   
       RESTARTABLE(::close(s), res);
-      continue;
+      continue;  
     }
 
     // peer credential look okay so we read the request
diff --git openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp openjdk/src/os/linux/vm/jvm_linux.cpp
index ba84788..8c4937a 100644
--- openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp
@@ -169,7 +169,9 @@ struct siglabel siglabels[] = {
   "WINCH",      SIGWINCH,       /* Window size change (4.3 BSD, Sun).  */
   "POLL",       SIGPOLL,        /* Pollable event occurred (System V).  */
   "IO",         SIGIO,          /* I/O now possible (4.2 BSD).  */
+#ifdef SIGPWR
   "PWR",        SIGPWR,         /* Power failure restart (System V).  */
+#endif
 #ifdef SIGSYS
   "SYS",        SIGSYS          /* Bad system call. Only on some Linuxen! */
 #endif
diff --git openjdk/hotspot/src/os/linux/vm/os_linux.cpp openjdk/src/os/linux/vm/os_linux.cpp
index 55f52c3..a82f627 100644
--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
@@ -113,8 +113,13 @@
 # include <semaphore.h>
 # include <fcntl.h>
 # include <string.h>
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+# include <sys/param.h>
+# include <sys/sysctl.h>
+#else
 # include <syscall.h>
 # include <sys/sysinfo.h>
+#endif
 # include <gnu/libc-version.h>
 # include <sys/ipc.h>
 # include <sys/shm.h>
@@ -125,6 +130,10 @@
 
 #define MAX_PATH    (2 * K)
 
+#ifndef ETIME
+#define ETIME ETIMEDOUT
+#endif
+
 // for timer info max values which include all bits
 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
 
@@ -205,11 +214,22 @@ julong os::available_memory() {
 }
 
 julong os::Linux::available_memory() {
+#ifndef __FreeBSD_kernel__
   // values in struct sysinfo are "unsigned long"
   struct sysinfo si;
   sysinfo(&si);
 
   return (julong)si.freeram * si.mem_unit;
+#else
+  int mib[2] = {CTL_HW, HW_USERMEM}, mem;
+  size_t len;
+  len = sizeof(mem);
+  if (sysctl(mib, 2, &mem, &len, NULL, 0) == 0) {
+    return (julong) mem;
+  } else {
+    return 0;
+  }
+#endif
 }
 
 julong os::physical_memory() {
@@ -2128,18 +2148,22 @@ void os::print_memory_info(outputStream* st) {
   st->print("Memory:");
   st->print(" %dk page", os::vm_page_size()>>10);
 
+#ifndef __FreeBSD_kernel__
   // values in struct sysinfo are "unsigned long"
   struct sysinfo si;
   sysinfo(&si);
+#endif
 
   st->print(", physical " UINT64_FORMAT "k",
             os::physical_memory() >> 10);
   st->print("(" UINT64_FORMAT "k free)",
             os::available_memory() >> 10);
+#ifndef __FreeBSD_kernel__
   st->print(", swap " UINT64_FORMAT "k",
             ((jlong)si.totalswap * si.mem_unit) >> 10);
   st->print("(" UINT64_FORMAT "k free)",
             ((jlong)si.freeswap * si.mem_unit) >> 10);
+#endif
   st->cr();
 }
 
@@ -5372,6 +5396,7 @@ extern char** environ;
 int os::fork_and_exec(char* cmd) {
   const char * argv[4] = {"sh", "-c", cmd, NULL};
 
+#ifdef __linux__
   // fork() in LinuxThreads/NPTL is not async-safe. It needs to run
   // pthread_atfork handlers and reset pthread library. All we need is a
   // separate process to execve. Make a direct syscall to fork process.
@@ -5379,6 +5404,9 @@ int os::fork_and_exec(char* cmd) {
   // the best...
   pid_t pid = NOT_IA64(syscall(__NR_fork);)
               IA64_ONLY(fork();)
+#else
+  pid_t pid = fork();
+#endif
 
   if (pid < 0) {
     // fork failed
@@ -5387,6 +5415,7 @@ int os::fork_and_exec(char* cmd) {
   } else if (pid == 0) {
     // child process
 
+#ifdef __linux__
     // execve() in LinuxThreads will call pthread_kill_other_threads_np()
     // first to kill every thread on the thread list. Because this list is
     // not reset by fork() (see notes above), execve() will instead kill
@@ -5396,6 +5425,9 @@ int os::fork_and_exec(char* cmd) {
     // above.
     NOT_IA64(syscall(__NR_execve, "/bin/sh", argv, environ);)
     IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);)
+#else
+    execve("/bin/sh", (char* const*)argv, environ);
+#endif
 
     // execve failed
     _exit(-1);
diff --git openjdk/hotspot/src/os/posix/launcher/java_md.c openjdk/src/os/posix/launcher/java_md.c
index 8b1542e..69e0832 100644
--- openjdk/hotspot/src/os/posix/launcher/java_md.c
+++ openjdk/hotspot/src/os/posix/launcher/java_md.c
@@ -41,7 +41,7 @@
 #include "version_comp.h"
 #endif
 
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(__GLIBC__)
 #include <pthread.h>
 #else
 #include <thread.h>
@@ -96,7 +96,7 @@ extern char **environ;
  *      A collection of useful strings. One should think of these as #define
  *      entries, but actual strings can be more efficient (with many compilers).
  */
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
 static const char *system_dir   = "/usr/java";
 static const char *user_dir     = "/java";
 #else /* Solaris */
@@ -433,7 +433,7 @@ CreateExecutionEnvironment(int *_argcp,
       runpath = getenv(LD_LIBRARY_PATH);
 #endif /* __sun */
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
       /*
        * On linux, if a binary is running as sgid or suid, glibc sets
        * LD_LIBRARY_PATH to the empty string for security purposes.  (In
@@ -823,7 +823,7 @@ error:
 jboolean
 GetApplicationHome(char *buf, jint bufsize)
 {
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(__GLIBC__)
     char *execname = GetExecname();
     if (execname) {
         strncpy(buf, execname, bufsize-1);
@@ -992,7 +992,7 @@ SetExecname(char **argv)
             }
         }
     }
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__GLIBC__)
     {
         const char* self = "/proc/self/exe";
         char buf[PATH_MAX+1];
@@ -1887,7 +1887,7 @@ jlong_format_specifier() {
 int
 ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) {
     int rslt;
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(__GLIBC__)
     pthread_t tid;
     pthread_attr_t attr;
     pthread_attr_init(&attr);
diff --git openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
index ba484b9..d1e7b6f 100644
--- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -81,6 +81,7 @@
 # include <ucontext.h>
 # include <fpu_control.h>
 
+#ifdef __linux__
 #ifdef AMD64
 #define REG_SP REG_RSP
 #define REG_PC REG_RIP
@@ -94,6 +95,54 @@
 #define SPELL_REG_SP "esp"
 #define SPELL_REG_FP "ebp"
 #endif // AMD64
+#endif
+
+#if defined(__FreeBSD_kernel__)
+#define context_trapno uc_mcontext.mc_trapno
+#ifdef AMD64
+#define SPELL_REG_SP "rsp"
+#define SPELL_REG_FP "rbp"
+#define context_sp uc_mcontext.mc_rsp
+#define context_pc uc_mcontext.mc_rip
+#define context_fp uc_mcontext.mc_rbp
+#define context_rip uc_mcontext.mc_rip
+#define context_rsp uc_mcontext.mc_rsp
+#define context_rbp uc_mcontext.mc_rbp
+#define context_flags uc_mcontext.mc_flags
+#define context_err uc_mcontext.mc_err
+#define context_rax uc_mcontext.mc_rax
+#define context_rbx uc_mcontext.mc_rbx
+#define context_rcx uc_mcontext.mc_rcx
+#define context_rdx uc_mcontext.mc_rdx
+#define context_rsi uc_mcontext.mc_rsi
+#define context_rdi uc_mcontext.mc_rdi
+#define context_r8 uc_mcontext.mc_r8
+#define context_r9 uc_mcontext.mc_r9
+#define context_r10 uc_mcontext.mc_r10
+#define context_r11 uc_mcontext.mc_r11
+#define context_r12 uc_mcontext.mc_r12
+#define context_r13 uc_mcontext.mc_r13
+#define context_r14 uc_mcontext.mc_r14
+#define context_r15 uc_mcontext.mc_r15
+#else
+#define SPELL_REG_SP "esp"
+#define SPELL_REG_FP "ebp"
+#define context_sp uc_mcontext.mc_esp
+#define context_pc uc_mcontext.mc_eip
+#define context_fp uc_mcontext.mc_ebp
+#define context_eip uc_mcontext.mc_eip
+#define context_esp uc_mcontext.mc_esp
+#define context_eax uc_mcontext.mc_eax
+#define context_ebx uc_mcontext.mc_ebx
+#define context_ecx uc_mcontext.mc_ecx
+#define context_edx uc_mcontext.mc_edx
+#define context_ebp uc_mcontext.mc_ebp
+#define context_esi uc_mcontext.mc_esi
+#define context_edi uc_mcontext.mc_edi
+#define context_eflags uc_mcontext.mc_eflags
+#define context_trapno uc_mcontext.mc_trapno
+#endif // AMD64
+#endif
 
 address os::current_stack_pointer() {
 #ifdef SPARC_WORKS
@@ -119,15 +168,27 @@ void os::initialize_thread() {
 }
 
 address os::Linux::ucontext_get_pc(ucontext_t * uc) {
+#if defined(__FreeBSD_kernel__)
+  return (address)uc->context_pc;
+#else
   return (address)uc->uc_mcontext.gregs[REG_PC];
+#endif
 }
 
 intptr_t* os::Linux::ucontext_get_sp(ucontext_t * uc) {
+#if defined(__FreeBSD_kernel__)
+  return (intptr_t*)uc->context_sp;
+#else
   return (intptr_t*)uc->uc_mcontext.gregs[REG_SP];
+#endif
 }
 
 intptr_t* os::Linux::ucontext_get_fp(ucontext_t * uc) {
+#if defined(__FreeBSD_kernel__)
+  return (intptr_t*)uc->context_fp;
+#else
   return (intptr_t*)uc->uc_mcontext.gregs[REG_FP];
+#endif
 }
 
 // For Forte Analyzer AsyncGetCallTrace profiling support - thread
@@ -279,12 +340,20 @@ JVM_handle_linux_signal(int sig,
     pc = (address) os::Linux::ucontext_get_pc(uc);
 
     if (pc == (address) Fetch32PFI) {
+#if defined(__FreeBSD_kernel__)
+       uc->context_pc = intptr_t(Fetch32Resume) ;
+#else
        uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ;
+#endif
        return 1 ;
     }
 #ifdef AMD64
     if (pc == (address) FetchNPFI) {
+#if defined(__FreeBSD_kernel__)
+       uc->context_pc = intptr_t (FetchNResume) ;
+#else
        uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ;
+#endif
        return 1 ;
     }
 #endif // AMD64
@@ -430,7 +499,11 @@ JVM_handle_linux_signal(int sig,
   // Furthermore, a false-positive should be harmless.
   if (UnguardOnExecutionViolation > 0 &&
       (sig == SIGSEGV || sig == SIGBUS) &&
+#if defined(__FreeBSD_kernel__)
+      uc->context_trapno == trap_page_fault) {
+#else
       uc->uc_mcontext.gregs[REG_TRAPNO] == trap_page_fault) {
+#endif
     int page_size = os::vm_page_size();
     address addr = (address) info->si_addr;
     address pc = os::Linux::ucontext_get_pc(uc);
@@ -500,7 +573,11 @@ JVM_handle_linux_signal(int sig,
     // save all thread context in case we need to restore it
     if (thread != NULL) thread->set_saved_exception_pc(pc);
 
+#if defined(__FreeBSD_kernel__)
+    uc->context_pc = (intptr_t)stub;
+#else
     uc->uc_mcontext.gregs[REG_PC] = (greg_t)stub;
+#endif
     return true;
   }
 
@@ -752,6 +829,7 @@ void os::print_context(outputStream *st, void *context) {
 
   ucontext_t *uc = (ucontext_t*)context;
   st->print_cr("Registers:");
+#ifdef __linux__
 #ifdef AMD64
   st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
@@ -794,6 +872,48 @@ void os::print_context(outputStream *st, void *context) {
   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
   st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2);
 #endif // AMD64
+#elif defined(__FreeBSD_kernel__)
+#ifdef AMD64
+  st->print(  "RAX=" INTPTR_FORMAT, uc->context_rax);
+  st->print(", RBX=" INTPTR_FORMAT, uc->context_rbx);
+  st->print(", RCX=" INTPTR_FORMAT, uc->context_rcx);
+  st->print(", RDX=" INTPTR_FORMAT, uc->context_rdx);
+  st->cr();
+  st->print(  "RSP=" INTPTR_FORMAT, uc->context_rsp);
+  st->print(", RBP=" INTPTR_FORMAT, uc->context_rbp);
+  st->print(", RSI=" INTPTR_FORMAT, uc->context_rsi);
+  st->print(", RDI=" INTPTR_FORMAT, uc->context_rdi);
+  st->cr();
+  st->print(  "R8 =" INTPTR_FORMAT, uc->context_r8);
+  st->print(", R9 =" INTPTR_FORMAT, uc->context_r9);
+  st->print(", R10=" INTPTR_FORMAT, uc->context_r10);
+  st->print(", R11=" INTPTR_FORMAT, uc->context_r11);
+  st->cr();
+  st->print(  "R12=" INTPTR_FORMAT, uc->context_r12);
+  st->print(", R13=" INTPTR_FORMAT, uc->context_r13);
+  st->print(", R14=" INTPTR_FORMAT, uc->context_r14);
+  st->print(", R15=" INTPTR_FORMAT, uc->context_r15);
+  st->cr();
+  st->print(  "RIP=" INTPTR_FORMAT, uc->context_rip);
+  st->print(", EFLAGS=" INTPTR_FORMAT, uc->context_flags);
+  st->print(", ERR=" INTPTR_FORMAT, uc->context_err);
+  st->cr();
+  st->print("  TRAPNO=" INTPTR_FORMAT, uc->context_trapno);
+#else
+  st->print(  "EAX=" INTPTR_FORMAT, uc->context_eax);
+  st->print(", EBX=" INTPTR_FORMAT, uc->context_ebx);
+  st->print(", ECX=" INTPTR_FORMAT, uc->context_ecx);
+  st->print(", EDX=" INTPTR_FORMAT, uc->context_edx);
+  st->cr();
+  st->print(  "ESP=" INTPTR_FORMAT, uc->context_esp);
+  st->print(", EBP=" INTPTR_FORMAT, uc->context_ebp);
+  st->print(", ESI=" INTPTR_FORMAT, uc->context_esi);
+  st->print(", EDI=" INTPTR_FORMAT, uc->context_edi);
+  st->cr();
+  st->print(  "EIP=" INTPTR_FORMAT, uc->context_eip);
+  st->print(", EFLAGS=" INTPTR_FORMAT, uc->context_eflags);
+#endif // AMD64
+#endif
   st->cr();
   st->cr();
 
@@ -824,6 +944,7 @@ void os::print_register_info(outputStream *st, void *context) {
 
   // this is only for the "general purpose" registers
 
+#ifdef __linux__
 #ifdef AMD64
   st->print("RAX="); print_location(st, uc->uc_mcontext.gregs[REG_RAX]);
   st->print("RBX="); print_location(st, uc->uc_mcontext.gregs[REG_RBX]);
@@ -851,6 +972,35 @@ void os::print_register_info(outputStream *st, void *context) {
   st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
   st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
 #endif // AMD64
+#elif defined(__FreeBSD_kernel__)
+#ifdef AMD64
+  st->print("RAX="); print_location(st, uc->context_rax);
+  st->print("RBX="); print_location(st, uc->context_rbx);
+  st->print("RCX="); print_location(st, uc->context_rcx);
+  st->print("RDX="); print_location(st, uc->context_rdx);
+  st->print("RSP="); print_location(st, uc->context_rsp);
+  st->print("RBP="); print_location(st, uc->context_rbp);
+  st->print("RSI="); print_location(st, uc->context_rsi);
+  st->print("RDI="); print_location(st, uc->context_rdi);
+  st->print("R8 ="); print_location(st, uc->context_r8);
+  st->print("R9 ="); print_location(st, uc->context_r9);
+  st->print("R10="); print_location(st, uc->context_r10);
+  st->print("R11="); print_location(st, uc->context_r11);
+  st->print("R12="); print_location(st, uc->context_r12);
+  st->print("R13="); print_location(st, uc->context_r13);
+  st->print("R14="); print_location(st, uc->context_r14);
+  st->print("R15="); print_location(st, uc->context_r15);
+#else
+  st->print("EAX="); print_location(st, uc->context_eax);
+  st->print("EBX="); print_location(st, uc->context_ebx);
+  st->print("ECX="); print_location(st, uc->context_ecx);
+  st->print("EDX="); print_location(st, uc->context_edx);
+  st->print("ESP="); print_location(st, uc->context_esp);
+  st->print("EBP="); print_location(st, uc->context_ebp);
+  st->print("ESI="); print_location(st, uc->context_esi);
+  st->print("EDI="); print_location(st, uc->context_edi);
+#endif // AMD64
+#endif
 
   st->cr();
 }
diff --git openjdk/hotspot/src/share/vm/memory/allocation.hpp openjdk/src/share/vm/memory/allocation.hpp
index 4c2f1e8..d2cbfe1 100644
--- openjdk/hotspot/src/share/vm/memory/allocation.hpp
+++ openjdk/hotspot/src/share/vm/memory/allocation.hpp
@@ -218,9 +218,9 @@ protected:
   void signal_out_of_memory(size_t request, const char* whence) const;
 
   void check_for_overflow(size_t request, const char* whence) const {
-    if (UINTPTR_MAX - request < (uintptr_t)_hwm) {
-      signal_out_of_memory(request, whence);
-    }
+//    if (UINTPTR_MAX - request < (uintptr_t)_hwm) {
+//      signal_out_of_memory(request, whence);
+//    }
  }
 
  public:
diff --git openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp openjdk/src/share/vm/oops/generateOopMap.cpp
index 58ef931..9448389 100644
--- openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp
+++ openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp
@@ -970,11 +970,11 @@ void GenerateOopMap::init_basic_blocks() {
   // The product of bbNo and _state_len can get large if there are lots of
   // basic blocks and stack/locals/monitors.  Need to check to make sure
   // we don't overflow the capacity of a pointer.
-  if ((unsigned)bbNo > UINTPTR_MAX / sizeof(CellTypeState) / _state_len) {
-    report_error("The amount of memory required to analyze this method "
-                 "exceeds addressable range");
-    return;
-  }
+//  if ((unsigned)bbNo > UINTPTR_MAX / sizeof(CellTypeState) / _state_len) {
+//    report_error("The amount of memory required to analyze this method "
+//                 "exceeds addressable range");
+//    return;
+//  }
 
   CellTypeState *basicBlockState =
       NEW_RESOURCE_ARRAY(CellTypeState, bbNo * _state_len);
--- openjdk/hotspot/src/share/vm/ci/ciObject.hpp.orig	2013-05-12 18:20:12.688303624 +0200
+++ openjdk/hotspot/src/share/vm/ci/ciObject.hpp	2013-05-12 18:20:18.500302224 +0200
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_CI_CIOBJECT_HPP
 #define SHARE_VM_CI_CIOBJECT_HPP
 
+#include "utilities/globalDefinitions.hpp"
 #include "ci/ciClassList.hpp"
 #include "memory/allocation.hpp"
 #include "runtime/handles.hpp"
--- openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp.orig	2013-05-12 19:07:21.809316797 +0200
+++ openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp	2013-05-12 19:07:24.350507077 +0200
@@ -26,11 +26,11 @@
 // or if the user passes USE_PRECOMPILED_HEADER=0 to the makefiles.
 #ifndef DONT_USE_PRECOMPILED_HEADER
 
+# include "ci/ciArray.hpp"
 # include "asm/assembler.hpp"
 # include "asm/assembler.inline.hpp"
 # include "asm/codeBuffer.hpp"
 # include "asm/register.hpp"
-# include "ci/ciArray.hpp"
 # include "ci/ciArrayKlass.hpp"
 # include "ci/ciClassList.hpp"
 # include "ci/ciConstant.hpp"
--- openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp.orig	2013-05-12 23:38:04.815301011 +0200
+++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	2013-05-12 23:38:13.159314491 +0200
@@ -22,6 +22,7 @@
  *
  */
 
+#include "utilities/globalDefinitions.hpp"
 // no precompiled headers
 #include "classfile/vmSymbols.hpp"
 #include "gc_interface/collectedHeap.hpp"
--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp.orig	2013-05-13 08:26:02.233299403 +0200
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2013-05-13 08:26:11.662320533 +0200
@@ -22,6 +22,7 @@
  *
  */
 
+#include "utilities/globalDefinitions.hpp"
 // no precompiled headers
 #include "classfile/classLoader.hpp"
 #include "classfile/systemDictionary.hpp"
--- openjdk/hotspot/src/os/linux/vm/osThread_linux.cpp.orig	2013-05-13 10:14:54.977305814 +0200
+++ openjdk/hotspot/src/os/linux/vm/osThread_linux.cpp	2013-05-13 10:15:12.863586024 +0200
@@ -22,6 +22,7 @@
  *
  */
 
+#include "utilities/globalDefinitions.hpp"
 // no precompiled headers
 #include "runtime/atomic.hpp"
 #include "runtime/handles.inline.hpp"
--- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp.orig	2013-05-13 11:34:51.322318085 +0200
+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	2013-05-13 11:35:02.410309395 +0200
@@ -22,6 +22,7 @@
  *
  */
 
+#include "utilities/globalDefinitions.hpp"
 // no precompiled headers
 #include "assembler_x86.inline.hpp"
 #include "classfile/classLoader.hpp"