2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _IOKIT_KERNELINTERNAL_H
25 #define _IOKIT_KERNELINTERNAL_H
27 #include <sys/cdefs.h>
32 #include <mach/memory_object_types.h>
33 #include <device/device_port.h>
35 typedef kern_return_t (*IOIteratePageableMapsCallback
)(vm_map_t map
, void * ref
);
38 kern_return_t
IOIteratePageableMaps(vm_size_t size
,
39 IOIteratePageableMapsCallback callback
, void * ref
);
40 vm_map_t
IOPageableMapForAddress( vm_address_t address
);
41 SInt32
OSKernelStackRemaining( void );
44 IOKernelAllocateContiguous(mach_vm_size_t size
, mach_vm_size_t alignment
);
46 IOKernelFreeContiguous(mach_vm_address_t address
, mach_vm_size_t size
);
48 extern vm_size_t debug_iomallocpageable_size
;
50 // osfmk/device/iokit_rpc.c
51 // LP64todo - these need to expand
52 extern kern_return_t
IOMapPages(vm_map_t map
, mach_vm_address_t va
, mach_vm_address_t pa
,
53 mach_vm_size_t length
, unsigned int options
);
54 extern kern_return_t
IOUnmapPages(vm_map_t map
, mach_vm_address_t va
, mach_vm_size_t length
);
56 extern kern_return_t
IOProtectCacheMode(vm_map_t map
, mach_vm_address_t va
,
57 mach_vm_size_t length
, unsigned int mapFlags
);
59 extern ppnum_t
IOGetLastPageNumber(void);
61 extern ppnum_t gIOLastPage
;
63 /* Physical to physical copy (ints must be disabled) */
64 extern void bcopy_phys(addr64_t from
, addr64_t to
, int size
);
68 // Used for dedicated communications for IODMACommand
70 kIOMDWalkSegments
= 0x00000001,
71 kIOMDFirstSegment
= 0x00000002 | kIOMDWalkSegments
,
72 kIOMDGetCharacteristics
= 0x00000004,
73 kIOMDLastDMACommandOperation
75 struct IOMDDMACharacteristics
{
81 IODirection fDirection
;
82 UInt8 fIsMapped
, fIsPrepared
;
84 struct IOMDDMAWalkSegmentArgs
{
85 UInt64 fOffset
; // Input/Output offset
86 UInt64 fIOVMAddr
, fLength
; // Output variables
87 UInt8 fMapped
; // Input Variable, Require mapped IOVMA
89 typedef UInt8 IOMDDMAWalkSegmentState
[128];
91 #endif /* ! _IOKIT_KERNELINTERNAL_H */