X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/fe8ab488e9161c46dd9885d58fc52996dc0249ff..d9a64523371fa019c4575bb400cbbc3a50ac9903:/libkern/OSKextLib.cpp diff --git a/libkern/OSKextLib.cpp b/libkern/OSKextLib.cpp index 175704eec..5b9ee7b4a 100644 --- a/libkern/OSKextLib.cpp +++ b/libkern/OSKextLib.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2012 Apple Inc. All rights reserved. + * Copyright (c) 2008-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -48,6 +48,7 @@ kern_return_t OSKextLoadKextWithIdentifier(const char * bundle_id) return OSKext::loadKextWithIdentifier(bundle_id); } +uint32_t OSKextGetLoadTagForIdentifier(const char * kextIdentifier); /********************************************************************* *********************************************************************/ uint32_t @@ -353,8 +354,8 @@ finish: /********************************************************************* * Gets the vm_map for the current kext *********************************************************************/ -extern vm_offset_t segPRELINKB; -extern unsigned long segSizePRELINK; +extern vm_offset_t segPRELINKTEXTB; +extern unsigned long segSizePRELINKTEXT; extern int kth_started; extern vm_map_t g_kext_map; @@ -364,8 +365,8 @@ kext_get_vm_map(kmod_info_t *info) vm_map_t kext_map = NULL; /* Set the vm map */ - if ((info->address >= segPRELINKB) && - (info->address < (segPRELINKB + segSizePRELINK))) + if ((info->address >= segPRELINKTEXTB) && + (info->address < (segPRELINKTEXTB + segSizePRELINKTEXT))) { kext_map = kernel_map; } else { @@ -438,10 +439,10 @@ void kext_dump_panic_lists(int (*printf_func)(const char * fmt, ...)) void kmod_panic_dump(vm_offset_t * addr, unsigned int cnt) { - extern int kdb_printf(const char *format, ...) __printflike(1,2); + extern int paniclog_append_noflush(const char *format, ...) __printflike(1,2); + + OSKext::printKextsInBacktrace(addr, cnt, &paniclog_append_noflush, 0); - OSKext::printKextsInBacktrace(addr, cnt, &kdb_printf, - /* takeLock? */ false, false); return; } @@ -454,9 +455,18 @@ kmod_dump_log( unsigned int cnt, boolean_t doUnslide) { - OSKext::printKextsInBacktrace(addr, cnt, &printf, /* lock? */ true, doUnslide); + uint32_t flags = OSKext::kPrintKextsLock; + if (doUnslide) flags |= OSKext::kPrintKextsUnslide; + OSKext::printKextsInBacktrace(addr, cnt, &printf, flags); } +void * +OSKextKextForAddress(const void *addr) +{ + return OSKext::kextForAddress(addr); +} + + /********************************************************************* * Compatibility implementation for kmod_get_info() host_priv routine. * Only supported on old 32-bit architectures.