VirtualBox

Changeset 7130 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 25, 2008 4:44:45 PM (17 years ago)
Author:
vboxsync
Message:

Linux kmod: VBOX_REDHAT_KABI

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r7035 r7130  
    630630
    631631/**
     632 * Helper for supdrvIOCtl. Check if pszStr contains any character of pszChars.
     633 * We would use strpbrk here if this function would be contained in the RedHat kABI white
     634 * list, see http://www.kerneldrivers.org/RHEL5.
     635 *
     636 * @return 1 if pszStr does contain any character of pszChars, 0 otherwise.
     637 * @param    pszStr     String to check
     638 * @param    pszChars   Character set
     639 */
     640static int supdrvCheckInvalidChar(const char *pszStr, const char *pszChars)
     641{
     642    int chCur;
     643    while ((chCur = *pszStr++) != '\0')
     644    {
     645        int ch;
     646        const char *psz = pszChars;
     647        while ((ch = *psz++) != '\0')
     648            if (ch == chCur)
     649                return 1;
     650
     651    }
     652    return 0;
     653}
     654
     655
     656/**
    632657 * I/O Control worker.
    633658 *
     
    896921            REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, pReq->u.In.szName[0]);
    897922            REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, memchr(pReq->u.In.szName, '\0', sizeof(pReq->u.In.szName)));
    898             REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, !strpbrk(pReq->u.In.szName, ";:()[]{}/\\|&*%#@!~`\"'"));
     923            REQ_CHECK_EXPR(SUP_IOCTL_LDR_OPEN, !supdrvCheckInvalidChar(pReq->u.In.szName, ";:()[]{}/\\|&*%#@!~`\"'"));
    899924
    900925            /* execute */
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r7032 r7130  
    196196endif
    197197KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX
     198ifdef VBOX_REDHAT_KABI
     199 KFLAGS  += -DVBOX_REDHAT_KABI
     200endif
    198201ifndef CONFIG_VBOXDRV_FIXEDMAJOR
    199202 KFLAGS  += -DCONFIG_VBOXDRV_AS_MISC
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r7014 r7130  
    204204 */
    205205# if defined(RT_ARCH_AMD64)
    206 #  if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21)
     206#  if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) && !defined(VBOX_REDHAT_KABI)
    207207#   define DO_DISABLE_NMI 1
    208208#  endif
     
    506506     * we don't allow to setup an NMI watchdog.
    507507     */
    508 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
     508# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && !defined(VBOX_REDHAT_KABI)
    509509    /*
    510510     * First test: NMI actiated? Works only works with Linux 2.6 -- 2.4 does not export
     
    569569        goto nmi_activated;
    570570#  endif
    571 # endif /* >= 2.6.0 */
     571# endif /* >= 2.6.0 && !defined(VBOX_REDHAT_KABI) */
    572572
    573573    /*
     
    598598                return -EINVAL;
    599599# else /* < 2.6.19 */
    600 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
     600#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && !defined(VBOX_REDHAT_KABI)
    601601nmi_activated:
    602602#  endif
     
    13991399{
    14001400#ifdef CONFIG_SMP
    1401 # if defined(num_present_cpus)
     1401# if defined(num_present_cpus) && !defined(VBOX_REDHAT_KABI)
    14021402    return num_present_cpus();
    1403 # elif defined(num_online_cpus)
    1404     return num_online_cpus();
     1403# elif defined(num_possible_cpus)
     1404    return num_possible_cpus();
    14051405# else
    14061406    return smp_num_cpus;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette