* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
- if (sysctl(mib, 4, NULL, &needed, NULL, 0) < 0) {
- printf("trace facility failure, KERN_KDENABLE\n");
+ if (sysctl(mib, 4, NULL, &needed, NULL, 0) < 0) {
+ printf("trace facility failure, KERN_KDENABLE\n");
__unused int sysret;
void *hint = reuse_addrs ? (void *)0x1000 : NULL;
parray[i].taddr = (uintptr_t)mmap(hint, mapping_size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
__unused int sysret;
void *hint = reuse_addrs ? (void *)0x1000 : NULL;
parray[i].taddr = (uintptr_t)mmap(hint, mapping_size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
uint32_t pattern = parray[i].taddr;
pattern |= cpid & 0xFFF;
// memset_pattern4((void *)parray[i].taddr, &pattern, PAGE_SIZE); //
uint32_t pattern = parray[i].taddr;
pattern |= cpid & 0xFFF;
// memset_pattern4((void *)parray[i].taddr, &pattern, PAGE_SIZE); //
if (val != 0) {
CONSISTENCY("Mismatch, actual: 0x%llx, expected: 0x%llx\n", (unsigned long long)val, 0ULL);
if (val != 0) {
CONSISTENCY("Mismatch, actual: 0x%llx, expected: 0x%llx\n", (unsigned long long)val, 0ULL);
uint32_t role = *(uint32_t *)targs;
__unused int sysret;
printf("Starting thread %p, role: %u\n", pthread_self(), role);
uint32_t role = *(uint32_t *)targs;
__unused int sysret;
printf("Starting thread %p, role: %u\n", pthread_self(), role);
syscall(180, 0x71BC0000, (ad >> 32), (ad & ~0), 0, 0, 0);
CONSISTENCY("Mismatch, actual: 0x%llx, expected: 0x%llx\n", (unsigned long long)val, (unsigned long long)ad);
if (stop_on_failure) {
syscall(180, 0x71BC0000, (ad >> 32), (ad & ~0), 0, 0, 0);
CONSISTENCY("Mismatch, actual: 0x%llx, expected: 0x%llx\n", (unsigned long long)val, (unsigned long long)ad);
if (stop_on_failure) {
int result = pthread_create(&threads[dex], NULL, tlbexerciser, &roles[dex]);
int result = pthread_create(&threads[dex], NULL, tlbexerciser, &roles[dex]);