src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp

Print this page
rev 6670 : 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
Reviewed-by: lfoltan, coleenp, dholmes
   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2012, 2013 SAP AG. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
  27 #define OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
  28 
  29 #include "runtime/atomic.hpp"
  30 #include "runtime/os.hpp"
  31 #include "vm_version_ppc.hpp"
  32 
  33 #ifndef PPC64
  34 #error "Atomic currently only implemented for PPC64"
  35 #endif
  36 
  37 // Implementation of class atomic
  38 
  39 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
  40 inline void Atomic::store    (jshort   store_value, jshort*   dest) { *dest = store_value; }
  41 inline void Atomic::store    (jint     store_value, jint*     dest) { *dest = store_value; }
  42 inline void Atomic::store    (jlong    store_value, jlong*    dest) { *dest = store_value; }
  43 inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; }
  44 inline void Atomic::store_ptr(void*    store_value, void*     dest) { *(void**)dest = store_value; }
  45 
  46 inline void Atomic::store    (jbyte    store_value, volatile jbyte*    dest) { *dest = store_value; }
  47 inline void Atomic::store    (jshort   store_value, volatile jshort*   dest) { *dest = store_value; }
  48 inline void Atomic::store    (jint     store_value, volatile jint*     dest) { *dest = store_value; }
  49 inline void Atomic::store    (jlong    store_value, volatile jlong*    dest) { *dest = store_value; }
  50 inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; }
  51 inline void Atomic::store_ptr(void*    store_value, volatile void*     dest) { *(void* volatile *)dest = store_value; }


   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2012, 2014, SAP AG. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
  27 #define OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
  28 
  29 #include "runtime/atomic.hpp"
  30 #include "runtime/os.hpp"

  31 
  32 #ifndef PPC64
  33 #error "Atomic currently only implemented for PPC64"
  34 #endif
  35 
  36 // Implementation of class atomic
  37 
  38 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
  39 inline void Atomic::store    (jshort   store_value, jshort*   dest) { *dest = store_value; }
  40 inline void Atomic::store    (jint     store_value, jint*     dest) { *dest = store_value; }
  41 inline void Atomic::store    (jlong    store_value, jlong*    dest) { *dest = store_value; }
  42 inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; }
  43 inline void Atomic::store_ptr(void*    store_value, void*     dest) { *(void**)dest = store_value; }
  44 
  45 inline void Atomic::store    (jbyte    store_value, volatile jbyte*    dest) { *dest = store_value; }
  46 inline void Atomic::store    (jshort   store_value, volatile jshort*   dest) { *dest = store_value; }
  47 inline void Atomic::store    (jint     store_value, volatile jint*     dest) { *dest = store_value; }
  48 inline void Atomic::store    (jlong    store_value, volatile jlong*    dest) { *dest = store_value; }
  49 inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; }
  50 inline void Atomic::store_ptr(void*    store_value, volatile void*     dest) { *(void* volatile *)dest = store_value; }