From: Apple Date: Thu, 14 Aug 2003 01:25:02 +0000 (+0000) Subject: xnu-344.34.tar.gz X-Git-Tag: mac-os-x-1026^0 X-Git-Url: https://git.saurik.com/apple/xnu.git/commitdiff_plain/ac5ea4a98a4e1d34a076095ea1eaa87e43d1f335 xnu-344.34.tar.gz --- diff --git a/bsd/conf/version.minor b/bsd/conf/version.minor index 7ed6ff82d..1e8b31496 100644 --- a/bsd/conf/version.minor +++ b/bsd/conf/version.minor @@ -1 +1 @@ -5 +6 diff --git a/bsd/netinet/tcp_input.c b/bsd/netinet/tcp_input.c index 74493fdb7..b3b12b6f5 100644 --- a/bsd/netinet/tcp_input.c +++ b/bsd/netinet/tcp_input.c @@ -466,7 +466,7 @@ tcp_input(m, off0) } } else #endif /* INET6 */ - { + { /* * Get IP and TCP header together in first mbuf. * Note: IP leaves IP header in first mbuf. @@ -496,10 +496,20 @@ tcp_input(m, off0) if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { if (apple_hwcksum_rx && (m->m_pkthdr.csum_flags & CSUM_TCP_SUM16)) { u_short pseudo; + char b[9]; + *(uint32_t*)&b[0] = *(uint32_t*)&ipov->ih_x1[0]; + *(uint32_t*)&b[4] = *(uint32_t*)&ipov->ih_x1[4]; + *(uint8_t*)&b[8] = *(uint8_t*)&ipov->ih_x1[8]; + bzero(ipov->ih_x1, sizeof(ipov->ih_x1)); ipov->ih_len = (u_short)tlen; HTONS(ipov->ih_len); pseudo = in_cksum(m, sizeof (struct ip)); + + *(uint32_t*)&ipov->ih_x1[0] = *(uint32_t*)&b[0]; + *(uint32_t*)&ipov->ih_x1[4] = *(uint32_t*)&b[4]; + *(uint8_t*)&ipov->ih_x1[8] = *(uint8_t*)&b[8]; + th->th_sum = in_addword(pseudo, (m->m_pkthdr.csum_data & 0xFFFF)); } else { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) @@ -511,14 +521,23 @@ tcp_input(m, off0) } th->th_sum ^= 0xffff; } else { + char b[9]; /* * Checksum extended TCP header and data. */ + *(uint32_t*)&b[0] = *(uint32_t*)&ipov->ih_x1[0]; + *(uint32_t*)&b[4] = *(uint32_t*)&ipov->ih_x1[4]; + *(uint8_t*)&b[8] = *(uint8_t*)&ipov->ih_x1[8]; + len = sizeof (struct ip) + tlen; bzero(ipov->ih_x1, sizeof(ipov->ih_x1)); ipov->ih_len = (u_short)tlen; HTONS(ipov->ih_len); th->th_sum = in_cksum(m, len); + + *(uint32_t*)&ipov->ih_x1[0] = *(uint32_t*)&b[0]; + *(uint32_t*)&ipov->ih_x1[4] = *(uint32_t*)&b[4]; + *(uint8_t*)&ipov->ih_x1[8] = *(uint8_t*)&b[8]; } if (th->th_sum) { tcpstat.tcps_rcvbadsum++; @@ -528,7 +547,7 @@ tcp_input(m, off0) /* Re-initialization for later version check */ ip->ip_v = IPVERSION; #endif - } + } /* * Check that TCP offset makes sense, diff --git a/bsd/netinet/udp_usrreq.c b/bsd/netinet/udp_usrreq.c index 4dde880ce..31ee4fb84 100644 --- a/bsd/netinet/udp_usrreq.c +++ b/bsd/netinet/udp_usrreq.c @@ -289,17 +289,26 @@ udp_input(m, iphlen) * Checksum extended UDP header and data. */ if (uh->uh_sum) { - if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { - if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) - uh->uh_sum = m->m_pkthdr.csum_data; - else - goto doudpcksum; - uh->uh_sum ^= 0xffff; - } else { + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) + uh->uh_sum = m->m_pkthdr.csum_data; + else + goto doudpcksum; + uh->uh_sum ^= 0xffff; + } else { + char b[9]; doudpcksum: + *(uint32_t*)&b[0] = *(uint32_t*)&((struct ipovly *)ip)->ih_x1[0]; + *(uint32_t*)&b[4] = *(uint32_t*)&((struct ipovly *)ip)->ih_x1[4]; + *(uint8_t*)&b[8] = *(uint8_t*)&((struct ipovly *)ip)->ih_x1[8]; + bzero(((struct ipovly *)ip)->ih_x1, 9); ((struct ipovly *)ip)->ih_len = uh->uh_ulen; uh->uh_sum = in_cksum(m, len + sizeof (struct ip)); + + *(uint32_t*)&((struct ipovly *)ip)->ih_x1[0] = *(uint32_t*)&b[0]; + *(uint32_t*)&((struct ipovly *)ip)->ih_x1[4] = *(uint32_t*)&b[4]; + *(uint8_t*)&((struct ipovly *)ip)->ih_x1[8] = *(uint8_t*)&b[8]; } if (uh->uh_sum) { udpstat.udps_badsum++; diff --git a/config/System.kext/Contents/Info.plist b/config/System.kext/Contents/Info.plist index bcb99c4b7..12f8074db 100644 --- a/config/System.kext/Contents/Info.plist +++ b/config/System.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - System Resource Pseudoextension, Apple Computer Inc, 6.5 + System Resource Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.kernel CFBundleInfoDictionaryVersion @@ -15,13 +15,13 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion - 6.5 + 6.6 OSBundleRequired Root OSKernelResource diff --git a/config/System.kext/Contents/PlugIns/AppleNMI.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/AppleNMI.kext/Contents/Info.plist index e0f769f9b..d41931cc5 100644 --- a/config/System.kext/Contents/PlugIns/AppleNMI.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/AppleNMI.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - AppleNMI Pseudoextension, Apple Computer Inc, 6.5 + AppleNMI Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.driver.AppleNMI CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleRequired Root OSKernelResource diff --git a/config/System.kext/Contents/PlugIns/ApplePlatformFamily.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/ApplePlatformFamily.kext/Contents/Info.plist index dbc990203..206d51180 100644 --- a/config/System.kext/Contents/PlugIns/ApplePlatformFamily.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/ApplePlatformFamily.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - Apple Platform Family Pseudoextension, Apple Computer Inc, 6.5 + Apple Platform Family Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.iokit.ApplePlatformFamily CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.0 OSBundleRequired diff --git a/config/System.kext/Contents/PlugIns/BSDKernel.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/BSDKernel.kext/Contents/Info.plist index 83b9aa790..894cab676 100644 --- a/config/System.kext/Contents/PlugIns/BSDKernel.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/BSDKernel.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - BSD Kernel Pseudoextension, Apple Computer Inc, 6.5 + BSD Kernel Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.kernel.bsd CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.1 OSBundleRequired diff --git a/config/System.kext/Contents/PlugIns/IOADBFamily.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/IOADBFamily.kext/Contents/Info.plist index 5fea1efd9..61364e081 100644 --- a/config/System.kext/Contents/PlugIns/IOADBFamily.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/IOADBFamily.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - ADB Family Pseudoextension, Apple Computer Inc, 6.5 + ADB Family Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.iokit.IOADBFamily CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.0.0b1 OSBundleRequired diff --git a/config/System.kext/Contents/PlugIns/IOKit.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/IOKit.kext/Contents/Info.plist index 779252504..e175b0a94 100644 --- a/config/System.kext/Contents/PlugIns/IOKit.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/IOKit.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - I/O Kit Pseudoextension, Apple Computer Inc, 6.5 + I/O Kit Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.kernel.iokit CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.0.0b1 OSBundleRequired diff --git a/config/System.kext/Contents/PlugIns/IONVRAMFamily.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/IONVRAMFamily.kext/Contents/Info.plist index 513e2a627..fd154a8c8 100644 --- a/config/System.kext/Contents/PlugIns/IONVRAMFamily.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/IONVRAMFamily.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - AppleNMI Pseudoextension, Apple Computer Inc, 6.5 + AppleNMI Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.iokit.IONVRAMFamily CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.1 OSBundleRequired diff --git a/config/System.kext/Contents/PlugIns/IOSystemManagement.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/IOSystemManagement.kext/Contents/Info.plist index 896ae7408..ab8c968e7 100644 --- a/config/System.kext/Contents/PlugIns/IOSystemManagement.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/IOSystemManagement.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - System Management Pseudoextension, Apple Computer Inc, 6.5 + System Management Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.iokit.IOSystemManagementFamily CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.0.0b1 OSBundleRequired diff --git a/config/System.kext/Contents/PlugIns/Libkern.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/Libkern.kext/Contents/Info.plist index 2f2f4c55f..76d9004f8 100644 --- a/config/System.kext/Contents/PlugIns/Libkern.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/Libkern.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - Libkern Pseudoextension, Apple Computer Inc, 6.5 + Libkern Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.kernel.libkern CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.0.0b1 OSBundleRequired diff --git a/config/System.kext/Contents/PlugIns/Mach.kext/Contents/Info.plist b/config/System.kext/Contents/PlugIns/Mach.kext/Contents/Info.plist index 69ed2ddb8..62df08afa 100644 --- a/config/System.kext/Contents/PlugIns/Mach.kext/Contents/Info.plist +++ b/config/System.kext/Contents/PlugIns/Mach.kext/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleGetInfoString - Mach Kernel Pseudoextension, Apple Computer Inc, 6.5 + Mach Kernel Pseudoextension, Apple Computer Inc, 6.6 CFBundleIdentifier com.apple.kernel.mach CFBundleInfoDictionaryVersion @@ -15,11 +15,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.5 + 6.6 CFBundleSignature ???? CFBundleVersion - 6.5 + 6.6 OSBundleCompatibleVersion 1.0.0b1 OSBundleRequired diff --git a/iokit/Kernel/IOInterruptController.cpp b/iokit/Kernel/IOInterruptController.cpp index bd3baa04d..438d93d87 100644 --- a/iokit/Kernel/IOInterruptController.cpp +++ b/iokit/Kernel/IOInterruptController.cpp @@ -96,10 +96,10 @@ IOReturn IOInterruptController::registerInterrupt(IOService *nub, int source, originalNub = vector->nub; originalSource = vector->source; - // Save the dis/enable state for the original consumer's interrupt. - // Then disable the source - wasDisabledSoft = vector->interruptDisabledSoft; - disableInterrupt(originalNub, originalSource); + // Physically disable the interrupt, but mark it as being enables in the hardware. + // The interruptDisabledSoft now indicates the driver's request for enablement. + disableVectorHard(vectorNumber, vector); + vector->interruptDisabledHard = 0; // Initialize the new shared interrupt controller. error = vector->sharedController->initInterruptController(this, @@ -125,7 +125,17 @@ IOReturn IOInterruptController::registerInterrupt(IOService *nub, int source, // put the original consumor's interrupt back to normal and // get rid of whats left of the shared controller. if (error != kIOReturnSuccess) { + // Save the driver's interrupt enablement state. + wasDisabledSoft = vector->interruptDisabledSoft; + + // Make the interrupt really hard disabled. + vector->interruptDisabledSoft = 1; + vector->interruptDisabledHard = 1; + + // Enable the original consumer's interrupt if needed. + if (!wasDisabledSoft) originalNub->enableInterrupt(originalSource); enableInterrupt(originalNub, originalSource); + vector->sharedController->release(); vector->sharedController = 0; IOUnlock(vector->interruptLock); @@ -139,6 +149,13 @@ IOReturn IOInterruptController::registerInterrupt(IOService *nub, int source, vector->target = vector->sharedController; vector->refCon = 0; + // Save the driver's interrupt enablement state. + wasDisabledSoft = vector->interruptDisabledSoft; + + // Make the interrupt really hard disabled. + vector->interruptDisabledSoft = 1; + vector->interruptDisabledHard = 1; + // Enable the original consumer's interrupt if needed. if (!wasDisabledSoft) originalNub->enableInterrupt(originalSource); } @@ -399,7 +416,7 @@ IOReturn IOSharedInterruptController::initInterruptController(IOInterruptControl } // Allocate the memory for the vectors - numVectors = 8; // For now a constant number. + numVectors = 32; // For now a constant number. vectors = (IOInterruptVector *)IOMalloc(numVectors * sizeof(IOInterruptVector)); if (vectors == NULL) { IOFree(_interruptSources, sizeof(IOInterruptSource)); diff --git a/iokit/Kernel/IONVRAM.cpp b/iokit/Kernel/IONVRAM.cpp index 738a03cfa..085d154b4 100644 --- a/iokit/Kernel/IONVRAM.cpp +++ b/iokit/Kernel/IONVRAM.cpp @@ -1421,18 +1421,23 @@ IOReturn IODTNVRAM::readNVRAMPropertyType1(IORegistryEntry *entry, nvPath = start; else if (nvName == 0) nvName = start; - else if (entry == - IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane)) { - *name = OSSymbol::withCString((const char *) nvName); - *value = unescapeBytesToData(start, where - start - 1); - if ((*name != 0) && (*value != 0)) - err = kIOReturnSuccess; - else - err = kIOReturnNoMemory; - break; - } else + else { + IORegistryEntry * compareEntry = IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane); + if (entry == compareEntry) { + if (compareEntry) + compareEntry->release(); + *name = OSSymbol::withCString((const char *) nvName); + *value = unescapeBytesToData(start, where - start - 1); + if ((*name != 0) && (*value != 0)) + err = kIOReturnSuccess; + else + err = kIOReturnNoMemory; + break; + } + if (compareEntry) + compareEntry->release(); nvPath = nvName = 0; - + } start = where; } @@ -1475,15 +1480,21 @@ IOReturn IODTNVRAM::writeNVRAMPropertyType1(IORegistryEntry *entry, nvPath = start; else if (nvName == 0) nvName = start; - else if (entry == - IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane)) { - // delete old property (nvPath -> where) - data = OSData::withBytes(propStart, nvPath - propStart); - if (data) - ok &= data->appendBytes(where, end - where); - break; - } else + else { + IORegistryEntry * compareEntry = IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane); + if (entry == compareEntry) { + if (compareEntry) + compareEntry->release(); + // delete old property (nvPath -> where) + data = OSData::withBytes(propStart, nvPath - propStart); + if (data) + ok &= data->appendBytes(where, end - where); + break; + } + if (compareEntry) + compareEntry->release(); nvPath = nvName = 0; + } start = where; } diff --git a/iokit/KernelConfigTables.cpp b/iokit/KernelConfigTables.cpp index 85db1be74..ca1e4e91d 100644 --- a/iokit/KernelConfigTables.cpp +++ b/iokit/KernelConfigTables.cpp @@ -28,16 +28,16 @@ */ const char * gIOKernelKmods = "{ - 'com.apple.kernel' = '6.5'; - 'com.apple.kernel.bsd' = '6.5'; - 'com.apple.kernel.iokit' = '6.5'; - 'com.apple.kernel.libkern' = '6.5'; - 'com.apple.kernel.mach' = '6.5'; - 'com.apple.iokit.IOADBFamily' = '6.5'; - 'com.apple.iokit.IONVRAMFamily' = '6.5'; - 'com.apple.iokit.IOSystemManagementFamily' = '6.5'; - 'com.apple.iokit.ApplePlatformFamily' = '6.5'; - 'com.apple.driver.AppleNMI' = '6.5'; + 'com.apple.kernel' = '6.6'; + 'com.apple.kernel.bsd' = '6.6'; + 'com.apple.kernel.iokit' = '6.6'; + 'com.apple.kernel.libkern' = '6.6'; + 'com.apple.kernel.mach' = '6.6'; + 'com.apple.iokit.IOADBFamily' = '6.6'; + 'com.apple.iokit.IONVRAMFamily' = '6.6'; + 'com.apple.iokit.IOSystemManagementFamily' = '6.6'; + 'com.apple.iokit.ApplePlatformFamily' = '6.6'; + 'com.apple.driver.AppleNMI' = '6.6'; }"; diff --git a/iokit/conf/version.minor b/iokit/conf/version.minor index 7ed6ff82d..1e8b31496 100644 --- a/iokit/conf/version.minor +++ b/iokit/conf/version.minor @@ -1 +1 @@ -5 +6 diff --git a/libkern/conf/version.minor b/libkern/conf/version.minor index 7ed6ff82d..1e8b31496 100644 --- a/libkern/conf/version.minor +++ b/libkern/conf/version.minor @@ -1 +1 @@ -5 +6 diff --git a/libsa/conf/version.minor b/libsa/conf/version.minor index 7ed6ff82d..1e8b31496 100644 --- a/libsa/conf/version.minor +++ b/libsa/conf/version.minor @@ -1 +1 @@ -5 +6 diff --git a/osfmk/conf/kernelversion.minor b/osfmk/conf/kernelversion.minor index 7ed6ff82d..1e8b31496 100644 --- a/osfmk/conf/kernelversion.minor +++ b/osfmk/conf/kernelversion.minor @@ -1 +1 @@ -5 +6 diff --git a/osfmk/conf/version.minor b/osfmk/conf/version.minor index 7ed6ff82d..1e8b31496 100644 --- a/osfmk/conf/version.minor +++ b/osfmk/conf/version.minor @@ -1 +1 @@ -5 +6 diff --git a/pexpert/conf/version.minor b/pexpert/conf/version.minor index 7ed6ff82d..1e8b31496 100644 --- a/pexpert/conf/version.minor +++ b/pexpert/conf/version.minor @@ -1 +1 @@ -5 +6