!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.4.18 (Ubuntu). PHP/7.0.33-0ubuntu0.16.04.16 

uname -a: Linux digifus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/src/linux-headers-4.4.0-210/arch/mn10300/include/asm/   drwxr-xr-x
Free 9.68 GB of 29.4 GB (32.93%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     cmpxchg.h (2.65 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* MN10300 Atomic xchg/cmpxchg operations
 *
 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public Licence
 * as published by the Free Software Foundation; either version
 * 2 of the Licence, or (at your option) any later version.
 */
#ifndef _ASM_CMPXCHG_H
#define _ASM_CMPXCHG_H

#include <asm/irqflags.h>

#ifdef CONFIG_SMP
#ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT
static inline
unsigned long __xchg(volatile unsigned long *m, unsigned long val)
{
    unsigned long status;
    unsigned long oldval;

    asm volatile(
        "1:    mov    %4,(_AAR,%3)    \n"
        "    mov    (_ADR,%3),%1    \n"
        "    mov    %5,(_ADR,%3)    \n"
        "    mov    (_ADR,%3),%0    \n"    /* flush */
        "    mov    (_ASR,%3),%0    \n"
        "    or    %0,%0        \n"
        "    bne    1b        \n"
        : "=&r"(status), "=&r"(oldval), "=m"(*m)
        : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m), "r"(val)
        : "memory", "cc");

    return oldval;
}

static inline unsigned long __cmpxchg(volatile unsigned long *m,
                      unsigned long old, unsigned long new)
{
    unsigned long status;
    unsigned long oldval;

    asm volatile(
        "1:    mov    %4,(_AAR,%3)    \n"
        "    mov    (_ADR,%3),%1    \n"
        "    cmp    %5,%1        \n"
        "    bne    2f        \n"
        "    mov    %6,(_ADR,%3)    \n"
        "2:    mov    (_ADR,%3),%0    \n"    /* flush */
        "    mov    (_ASR,%3),%0    \n"
        "    or    %0,%0        \n"
        "    bne    1b        \n"
        : "=&r"(status), "=&r"(oldval), "=m"(*m)
        : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m),
          "r"(old), "r"(new)
        : "memory", "cc");

    return oldval;
}
#else  /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
#error "No SMP atomic operation support!"
#endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */

#else  /* CONFIG_SMP */

/*
 * Emulate xchg for non-SMP MN10300
 */
struct __xchg_dummy { unsigned long a[100]; };
#define __xg(x) ((struct __xchg_dummy *)(x))

static inline
unsigned long __xchg(volatile unsigned long *m, unsigned long val)
{
    unsigned long oldval;
    unsigned long flags;

    flags = arch_local_cli_save();
    oldval = *m;
    *m = val;
    arch_local_irq_restore(flags);
    return oldval;
}

/*
 * Emulate cmpxchg for non-SMP MN10300
 */
static inline unsigned long __cmpxchg(volatile unsigned long *m,
                      unsigned long old, unsigned long new)
{
    unsigned long oldval;
    unsigned long flags;

    flags = arch_local_cli_save();
    oldval = *m;
    if (oldval == old)
        *m = new;
    arch_local_irq_restore(flags);
    return oldval;
}

#endif /* CONFIG_SMP */

#define xchg(ptr, v)                        \
    ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr),    \
                     (unsigned long)(v)))

#define cmpxchg(ptr, o, n)                    \
    ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
                    (unsigned long)(o),    \
                    (unsigned long)(n)))

#endif /* _ASM_CMPXCHG_H */

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0167 ]--