/*
- * Copyright (c) 1998-2011 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2016 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
@param size Size of the memory requested.
@result Pointer to the allocated memory, or zero on failure. */
-void * IOMalloc(vm_size_t size);
+void * IOMalloc(vm_size_t size) __attribute__((alloc_size(1)));
/*! @function IOFree
@abstract Frees memory allocated with IOMalloc.
@param alignment Byte count of the alignment for the memory. For example, pass 256 to get memory allocated at an address with bit 0-7 zero.
@result Pointer to the allocated memory, or zero on failure. */
-void * IOMallocAligned(vm_size_t size, vm_offset_t alignment);
+void * IOMallocAligned(vm_size_t size, vm_offset_t alignment) __attribute__((alloc_size(1)));
/*! @function IOFreeAligned
@abstract Frees memory allocated with IOMallocAligned.
@result Virtual address of the allocated memory, or zero on failure. */
void * IOMallocContiguous(vm_size_t size, vm_size_t alignment,
- IOPhysicalAddress * physicalAddress) __attribute__((deprecated));
+ IOPhysicalAddress * physicalAddress) __attribute__((deprecated)) __attribute__((alloc_size(1)));
/*! @function IOFreeContiguous
@abstract Deprecated - use IOBufferMemoryDescriptor. Frees memory allocated with IOMallocContiguous.
@param alignment Byte count of the alignment for the memory. For example, pass 256 to get memory allocated at an address with bits 0-7 zero.
@result Pointer to the allocated memory, or zero on failure. */
-void * IOMallocPageable(vm_size_t size, vm_size_t alignment);
+void * IOMallocPageable(vm_size_t size, vm_size_t alignment) __attribute__((alloc_size(1)));
/*! @function IOFreePageable
@abstract Frees memory allocated with IOMallocPageable.
/*! @function IOPause
@abstract Spin delay for a number of nanoseconds.
@discussion This function spins to delay for at least the number of specified nanoseconds. Since the CPU is busy spinning no time is made available to other processes; this method of delay should be used only for short periods.
- @param microseconds The integer number of nanoseconds to spin wait. */
+ @param nanoseconds The integer number of nanoseconds to spin wait. */
void IOPause(unsigned nanoseconds);
@abstract Log a message to console in text mode, and /var/log/system.log.
@discussion This function allows a driver to log diagnostic information to the screen during verbose boots, and to a log file found at /var/log/system.log. IOLog should not be called from interrupt context.
@param format A printf() style format string (see printf(3) documentation).
- @param other arguments described by the format string. */
+ */
void IOLog(const char *format, ...)
__attribute__((format(printf, 1, 2)));
@param format A printf() style format string (see printf(3) documentation).
@param ap stdarg(3) style variable arguments. */
-void IOLogv(const char *format, va_list ap);
+void IOLogv(const char *format, va_list ap)
+__attribute__((format(printf, 1, 0)));
#ifndef _FN_KPRINTF
#define _FN_KPRINTF