X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/de355530ae67247cbd0da700edb3a2a1dae884c2..ff6e181ae92fc6f1e89841290f461d1f2f9badd9:/osfmk/i386/iopb.c diff --git a/osfmk/i386/iopb.c b/osfmk/i386/iopb.c index ec00e33f2..0a819f1dc 100644 --- a/osfmk/i386/iopb.c +++ b/osfmk/i386/iopb.c @@ -3,19 +3,20 @@ * * @APPLE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * 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 + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * 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, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE 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. * * @APPLE_LICENSE_HEADER_END@ */ @@ -81,7 +82,7 @@ iopb_init(void) void -iopb_destroy(iopb_tss_t io_tss) +iopb_destroy(__unused iopb_tss_t io_tss) { } @@ -145,7 +146,7 @@ void iopb_init(void) { queue_init(&device_to_io_port_list); - simple_lock_init(&iopb_lock, ETAP_IO_IOPB); + simple_lock_init(&iopb_lock, 0); } /* @@ -298,7 +299,7 @@ io_tss_init( io_bitmap_init(io_tss->bitmap); io_tss->barrier = ~0; queue_init(&io_tss->io_port_list); - addr += LINEAR_KERNEL_ADDRESS; + addr |= LINEAR_KERNEL_ADDRESS; io_tss->iopb_desc[0] = ((size-1) & 0xffff) | ((addr & 0xffff) << 16); io_tss->iopb_desc[1] = ((addr & 0x00ff0000) >> 16) @@ -368,7 +369,7 @@ i386_io_port_add( || device == DEVICE_NULL) return KERN_INVALID_ARGUMENT; - pcb = thread->top_act->mact.pcb; + pcb = thread->machine.pcb; new_io_tss = 0; iu = (io_use_t) kalloc(sizeof(struct io_use)); @@ -467,7 +468,7 @@ i386_io_port_remove( || device == DEVICE_NULL) return KERN_INVALID_ARGUMENT; - pcb = thread->top_act->mact.pcb; + pcb = thread->machine.pcb; simple_lock(&iopb_lock); @@ -539,7 +540,7 @@ i386_io_port_list(thread, list, list_count) if (thread == THREAD_NULL) return KERN_INVALID_ARGUMENT; - pcb = thread->top_act->mact.pcb; + pcb = thread->machine.pcb; alloc_count = 16; /* a guess */ @@ -633,7 +634,7 @@ iopb_check_mapping( io_port_t io_port; io_use_t iu; - pcb = thread->top_act->mact.pcb; + pcb = thread->machine.pcb; simple_lock(&iopb_lock);