Mercurial > hg > truffle
comparison src/cpu/x86/vm/vm_version_x86.cpp @ 4961:0368109684cb
7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
Summary: Change OSThread to use mach thread_t
Reviewed-by: phh, dcubed
author | sla |
---|---|
date | Sun, 19 Feb 2012 13:11:39 +0100 |
parents | 22cee0ee8927 |
children | 33df1aeaebbf 8c92982cbbc4 |
comparison
equal
deleted
inserted
replaced
4960:86ce3208eb18 | 4961:0368109684cb |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
63 | 63 |
64 VM_Version_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {} | 64 VM_Version_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {} |
65 | 65 |
66 address generate_getPsrInfo() { | 66 address generate_getPsrInfo() { |
67 // Flags to test CPU type. | 67 // Flags to test CPU type. |
68 const uint32_t EFL_AC = 0x40000; | 68 const uint32_t HS_EFL_AC = 0x40000; |
69 const uint32_t EFL_ID = 0x200000; | 69 const uint32_t HS_EFL_ID = 0x200000; |
70 // Values for when we don't have a CPUID instruction. | 70 // Values for when we don't have a CPUID instruction. |
71 const int CPU_FAMILY_SHIFT = 8; | 71 const int CPU_FAMILY_SHIFT = 8; |
72 const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT); | 72 const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT); |
73 const uint32_t CPU_FAMILY_486 = (4 << CPU_FAMILY_SHIFT); | 73 const uint32_t CPU_FAMILY_486 = (4 << CPU_FAMILY_SHIFT); |
74 | 74 |
98 __ push(rax); | 98 __ push(rax); |
99 __ mov(rcx, rax); | 99 __ mov(rcx, rax); |
100 // | 100 // |
101 // if we are unable to change the AC flag, we have a 386 | 101 // if we are unable to change the AC flag, we have a 386 |
102 // | 102 // |
103 __ xorl(rax, EFL_AC); | 103 __ xorl(rax, HS_EFL_AC); |
104 __ push(rax); | 104 __ push(rax); |
105 __ popf(); | 105 __ popf(); |
106 __ pushf(); | 106 __ pushf(); |
107 __ pop(rax); | 107 __ pop(rax); |
108 __ cmpptr(rax, rcx); | 108 __ cmpptr(rax, rcx); |
116 // If we are unable to change the ID flag, we have a 486 which does | 116 // If we are unable to change the ID flag, we have a 486 which does |
117 // not support the "cpuid" instruction. | 117 // not support the "cpuid" instruction. |
118 // | 118 // |
119 __ bind(detect_486); | 119 __ bind(detect_486); |
120 __ mov(rax, rcx); | 120 __ mov(rax, rcx); |
121 __ xorl(rax, EFL_ID); | 121 __ xorl(rax, HS_EFL_ID); |
122 __ push(rax); | 122 __ push(rax); |
123 __ popf(); | 123 __ popf(); |
124 __ pushf(); | 124 __ pushf(); |
125 __ pop(rax); | 125 __ pop(rax); |
126 __ cmpptr(rcx, rax); | 126 __ cmpptr(rcx, rax); |