!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/include/asm-mips64/   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:     semaphore-helper.h (2.87 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * SMP- and interrupt-safe semaphores helper functions.
 *
 * (C) Copyright 1996 Linus Torvalds
 * (C) Copyright 1999 Andrea Arcangeli
 * (C) Copyright 1999, 2001 Ralf Baechle
 * (C) Copyright 1999, 2001 Silicon Graphics, Inc.
 */
#ifndef _ASM_SEMAPHORE_HELPER_H
#define _ASM_SEMAPHORE_HELPER_H

/*
 * These two _must_ execute atomically wrt each other.
 */
static inline void wake_one_more(struct semaphore * sem)
{
    atomic_inc(&sem->waking);
}

static inline int
waking_non_zero(struct semaphore *sem)
{
    int ret, tmp;

    __asm__ __volatile__(
    "1:\tll\t%1, %2\n\t"
    "blez\t%1, 2f\n\t"
    "subu\t%0, %1, 1\n\t"
    "sc\t%0, %2\n\t"
    "beqz\t%0, 1b\n\t"
    "2:"
    ".text"
    : "=r" (ret), "=r" (tmp), "=m" (sem->waking)
    : "0" (0));

    return ret;
}

/*
 * waking_non_zero_interruptible:
 *    1    got the lock
 *    0    go to sleep
 *    -EINTR    interrupted
 *
 * We must undo the sem->count down_interruptible decrement
 * simultaneously and atomicly with the sem->waking adjustment,
 * otherwise we can race with wake_one_more.
 *
 * This is accomplished by doing a 64-bit ll/sc on the 2 32-bit words.
 *
 * Pseudocode:
 *
 * If(sem->waking > 0) {
 *    Decrement(sem->waking)
 *    Return(SUCCESS)
 * } else If(segnal_pending(tsk)) {
 *    Increment(sem->count)
 *    Return(-EINTR)
 * } else {
 *    Return(SLEEP)
 * }
 */

static inline int
waking_non_zero_interruptible(struct semaphore *sem, struct task_struct *tsk)
{
    long ret, tmp;

#ifdef __MIPSEB__

        __asm__ __volatile__(
    ".set\tpush\t\t\t# waking_non_zero_interruptible\n\t"
    ".set\tnoat\n\t"
    "0:\tlld\t%1, %2\n\t"
    "li\t%0, 0\n\t"
    "sll\t$1, %1, 0\n\t"
    "blez\t$1, 1f\n\t"
    "daddiu\t%1, %1, -1\n\t"
    "li\t%0, 1\n\t"
    "b\t2f\n\t"
    "1:\tbeqz\t%3, 2f\n\t"
    "li\t%0, %4\n\t"
    "dli\t$1, 0x0000000100000000\n\t"
    "daddu\t%1, %1, $1\n\t"
    "2:\tscd\t%1, %2\n\t"
    "beqz\t%1, 0b\n\t"
    ".set\tpop"
    : "=&r" (ret), "=&r" (tmp), "=m" (*sem)
    : "r" (signal_pending(tsk)), "i" (-EINTR));

#elif defined(__MIPSEL__)

    __asm__ __volatile__(
    ".set\tpush\t\t\t# waking_non_zero_interruptible\n\t"
    ".set\t    noat\n"
    "0:\tlld\t%1, %2\n\t"
    "li\t%0, 0\n\t"
    "blez\t%1, 1f\n\t"
    "dli\t$1, 0x0000000100000000\n\t"
    "dsubu\t%1, %1, $1\n\t"
    "li\t%0, 1\n\t"
    "b\t2f\n"
    "1:\tbeqz\t%3, 2f\n\t"
    "li\t%0, %4\n\t"
    /* 
     * It would be nice to assume that sem->count
     * is != -1, but we will guard against that case
     */
    "daddiu\t$1, %1, 1\n\t"
    "dsll32\t$1, $1, 0\n\t"
    "dsrl32\t$1, $1, 0\n\t"
    "dsrl32\t%1, %1, 0\n\t"
    "dsll32\t%1, %1, 0\n\t"
    "or\t%1, %1, $1\n"
    "2:\tscd\t%1, %2\n\t"
    "beqz\t    %1, 0b\n\t"
    ".set\tpop"
    : "=&r" (ret), "=&r" (tmp), "=m" (*sem)
    : "r" (signal_pending(tsk)), "i" (-EINTR));

#endif

    return ret;
}

/*
 * waking_non_zero_trylock is unused.  we do everything in 
 * down_trylock and let non-ll/sc hosts bounce around.
 */

static inline int
waking_non_zero_trylock(struct semaphore *sem)
{
#if WAITQUEUE_DEBUG
    CHECK_MAGIC(sem->__magic);
#endif

    return 0;
}

#endif /* _ASM_SEMAPHORE_HELPER_H */

:: 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.0046 ]--