#ifdef __ppc__
#include <ppc/mappings.h>
#endif
-#ifdef __i386
+#if defined(__i386__) || defined(__x86_64__)
#include <i386/pmap.h>
#endif
#include <IOKit/IOTypes.h>
extern void iokit_retain_port( ipc_port_t port );
extern void iokit_release_port( ipc_port_t port );
+extern void iokit_release_port_send( ipc_port_t port );
extern kern_return_t iokit_switch_object_port( ipc_port_t port, io_object_t obj, ipc_kobject_type_t type );
{
io_object_t obj = NULL;
- if (connectRef && MACH_PORT_VALID((mach_port_name_t)connectRef)) {
+ if (connectRef && MACH_PORT_VALID(CAST_MACH_PORT_TO_NAME(connectRef))) {
ipc_port_t port;
kern_return_t kr;
- kr = ipc_object_translate(space, (mach_port_name_t)connectRef, MACH_PORT_RIGHT_SEND, (ipc_object_t *)&port);
+ kr = ipc_object_translate(space, CAST_MACH_PORT_TO_NAME(connectRef), MACH_PORT_RIGHT_SEND, (ipc_object_t *)&port);
if (kr == KERN_SUCCESS) {
assert(IP_VALID(port));
ipc_port_release( port );
}
+EXTERN void
+iokit_release_port_send( ipc_port_t port )
+{
+ ipc_port_release_send( port );
+}
+
/*
* Get the port for a device.
* Consumes a device reference; produces a naked send right.
/* need to create a pmap function to generalize */
unsigned int IODefaultCacheBits(addr64_t pa)
{
- return(pmap_cache_attributes(pa >> PAGE_SHIFT));
+ return(pmap_cache_attributes((ppnum_t)(pa >> PAGE_SHIFT)));
}
kern_return_t IOMapPages(vm_map_t map, mach_vm_address_t va, mach_vm_address_t pa,
for (idx = 0; idx < pmap_mem_regions_count; idx++)
{
lastPage = pmap_mem_regions[idx].mrEnd;
-#elif __i386__
+#elif __i386__ || __x86_64__
for (idx = 0; idx < pmap_memory_region_count; idx++)
{
lastPage = pmap_memory_regions[idx].end - 1;
-#elif __arm__
- if (0) /* XXX */
- {
#else
#error arch
#endif
void IOGetTime( mach_timespec_t * clock_time);
void IOGetTime( mach_timespec_t * clock_time)
{
- clock_get_system_nanotime(&clock_time->tv_sec, (uint32_t *) &clock_time->tv_nsec);
+ clock_sec_t sec;
+ clock_nsec_t nsec;
+ clock_get_system_nanotime(&sec, &nsec);
+ clock_time->tv_sec = (typeof(clock_time->tv_sec))sec;
+ clock_time->tv_nsec = nsec;
}