/*
- * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
- * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
- *
* HISTORY
*
* 17-Apr-91 Portions from libIO.m, Doug Mitchell at NeXT.
mach_timespec_t IOZeroTvalspec = { 0, 0 };
+
+/*
+ * Global variables for use by iLogger
+ * These symbols are for use only by Apple diagnostic code.
+ * Binary compatibility is not guaranteed for kexts that reference these symbols.
+ */
+
+void *_giDebugLogInternal = NULL;
+void *_giDebugLogDataInternal = NULL;
+void *_giDebugReserved1 = NULL;
+void *_giDebugReserved2 = NULL;
+
+
/*
* Static variables for this module.
*/
if (adjustedSize >= page_size) {
kr = kernel_memory_allocate(kernel_map, &address,
- size, alignMask, KMA_KOBJECT);
- if (KERN_SUCCESS != kr) {
- IOLog("Failed %08x, %08x\n", size, alignment);
+ size, alignMask, 0);
+ if (KERN_SUCCESS != kr)
address = 0;
- }
} else {
adjustedSize += alignMask;
- allocationAddress = (vm_address_t) kalloc(adjustedSize);
+
+ if (adjustedSize >= page_size) {
+
+ kr = kernel_memory_allocate(kernel_map, &allocationAddress,
+ adjustedSize, 0, 0);
+ if (KERN_SUCCESS != kr)
+ allocationAddress = 0;
+
+ } else
+ allocationAddress = (vm_address_t) kalloc(adjustedSize);
if (allocationAddress) {
address = (allocationAddress + alignMask
allocationAddress = *((vm_address_t *)( (vm_address_t) address
- sizeof(vm_address_t) ));
- kfree((vm_offset_t) allocationAddress, adjustedSize);
+ if (adjustedSize >= page_size)
+ kmem_free( kernel_map, (vm_address_t) allocationAddress, adjustedSize);
+ else
+ kfree((vm_offset_t) allocationAddress, adjustedSize);
}
#if IOALLOCDEBUG
if (adjustedSize >= page_size) {
kr = kmem_alloc_contig(kernel_map, &address, size,
- alignMask, KMA_KOBJECT);
+ alignMask, 0);
if (KERN_SUCCESS != kr)
address = 0;
} else {
adjustedSize += alignMask;
- allocationAddress = (vm_address_t)
- kalloc(adjustedSize);
+ allocationAddress = (vm_address_t) kalloc(adjustedSize);
+
if (allocationAddress) {
address = (allocationAddress + alignMask
void IOSleep(unsigned milliseconds)
{
- int wait_result;
+ wait_result_t wait_result;
+
+ wait_result = assert_wait_timeout(milliseconds, THREAD_UNINT);
+ assert(wait_result == THREAD_WAITING);
- assert_wait_timeout(milliseconds, THREAD_INTERRUPTIBLE);
- wait_result = thread_block((void (*)(void))0);
- if (wait_result != THREAD_TIMED_OUT)
- thread_cancel_timer();
+ wait_result = thread_block(THREAD_CONTINUE_NULL);
+ assert(wait_result == THREAD_TIMED_OUT);
}
/*