!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/drivers/s390/   drwxr-xr-x
Free 318.36 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     s390dyn.c (3.66 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 *  arch/s390/kernel/s390dyn.c
 *   S/390 dynamic device attachment
 *
 *  S390 version
 *    Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
 *    Author(s): Ingo Adlung (adlung@de.ibm.com)
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/smp_lock.h>

#include <asm/irq.h>
#include <asm/s390io.h>
#include <asm/s390dyn.h>

static struct list_head devreg_anchor = LIST_HEAD_INIT(devreg_anchor);
static spinlock_t  dyn_lock           = SPIN_LOCK_UNLOCKED;

static inline int s390_device_register_internal(devreg_t *drinfo)
{
    struct list_head *p;

        list_for_each(p, &devreg_anchor) {
                devreg_t *pdevreg = list_entry(p, devreg_t, list);
                
                if (pdevreg == drinfo)
                        return -EINVAL;
                /*
                 * We don't allow multiple drivers to register
                 * for the same device number
                 */
                if (pdevreg->ci.devno == drinfo->ci.devno &&
                    (pdevreg->flag & DEVREG_TYPE_DEVNO) &&
                    (drinfo->flag & DEVREG_TYPE_DEVNO))
            return -EBUSY;

                if (drinfo->flag == (DEVREG_TYPE_DEVCHARS | 
                     DEVREG_EXACT_MATCH) &&
                    !memcmp(&drinfo->ci.hc, &pdevreg->ci.hc,
                    sizeof(devreg_hc_t))) 
            return -EBUSY;
        }

        /*
         * no collision found, enqueue
         */
        list_add (&drinfo->list, &devreg_anchor);
    
    return 0;
}

int s390_device_register( devreg_t *drinfo )
{
    unsigned long flags;
    int ret;

    if (drinfo == NULL ||
            !(drinfo->flag & (DEVREG_TYPE_DEVNO | DEVREG_TYPE_DEVCHARS)))
        return -EINVAL;

    spin_lock_irqsave (&dyn_lock, flags);     
    ret = s390_device_register_internal(drinfo);
    spin_unlock_irqrestore( &dyn_lock, flags );     
     
    return ret;
}

static inline int s390_device_unregister_internal(devreg_t *dreg)
{
    struct list_head *p;

        list_for_each(p, &devreg_anchor) {
                devreg_t *pdevreg = list_entry(p, devreg_t, list);

        if (pdevreg == dreg) {
            list_del (&dreg->list);
            return 0;
        }
        }
    return -EINVAL;
}

int s390_device_unregister(devreg_t *dreg)
{
    unsigned long  flags;
    int ret;

    if (dreg == NULL)
        return -EINVAL;

    spin_lock_irqsave(&dyn_lock, flags);     
    ret = s390_device_unregister_internal(dreg);
    spin_unlock_irqrestore(&dyn_lock, flags);     
     
    return ret;
}

static inline devreg_t *s390_search_devreg_internal(ioinfo_t *ioinfo)
{
    struct list_head *p;
    
        list_for_each(p, &devreg_anchor) {
                devreg_t *pdevreg = list_entry(p, devreg_t, list);
        senseid_t *sid;
        int flag;

        flag = pdevreg->flag;
        sid = &ioinfo->senseid;
        if (flag & DEVREG_TYPE_DEVNO) {
                        if (ioinfo->ui.flags.dval != 1 ||
                    ioinfo->devno != pdevreg->ci.devno)
                continue;
        } else if (flag & DEVREG_TYPE_DEVCHARS) {
            if ( (flag & DEVREG_MATCH_CU_TYPE) &&
                 pdevreg->ci.hc.ctype != sid->cu_type )
                continue;
            if ( (flag & DEVREG_MATCH_CU_MODEL) &&
                 pdevreg->ci.hc.cmode != sid->cu_model )
                continue;
            if ( (flag & DEVREG_MATCH_DEV_TYPE) &&
                 pdevreg->ci.hc.dtype != sid->dev_type )
                continue;
            if ( (flag & DEVREG_MATCH_DEV_MODEL) &&
                 pdevreg->ci.hc.dmode != sid->dev_model )
                continue;
        } else {
            continue;
        }
        
        return pdevreg;
    }
    return NULL;
}

devreg_t * s390_search_devreg( ioinfo_t *ioinfo )
{
    unsigned long  flags;
    devreg_t *pdevreg;

    if (ioinfo == NULL)
        return NULL;

    spin_lock_irqsave(&dyn_lock, flags);     
    pdevreg = s390_search_devreg_internal(ioinfo);
    spin_unlock_irqrestore(&dyn_lock, flags);     
     
    return pdevreg;
}

EXPORT_SYMBOL(s390_device_register);
EXPORT_SYMBOL(s390_device_unregister);


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0225 ]--