src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp

Print this page
rev 4205 : Fix non-PCH build on Linux, Windows and MacOS X
   1 /*
   2  * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2007, 2008, 2011 Red Hat, Inc.
   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_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP
  27 #define OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP
  28 
  29 #include "orderAccess_bsd_zero.inline.hpp"
  30 #include "runtime/atomic.hpp"
  31 #include "runtime/os.hpp"
  32 #include "vm_version_zero.hpp"
  33 
  34 // Implementation of class atomic
  35 
  36 #ifdef M68K
  37 
  38 /*
  39  * __m68k_cmpxchg
  40  *
  41  * Atomically store newval in *ptr if *ptr is equal to oldval for user space.
  42  * Returns newval on success and oldval if no exchange happened.
  43  * This implementation is processor specific and works on
  44  * 68020 68030 68040 and 68060.
  45  *
  46  * It will not work on ColdFire, 68000 and 68010 since they lack the CAS
  47  * instruction.
  48  * Using a kernelhelper would be better for arch complete implementation.
  49  *


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2007, 2008, 2011 Red Hat, Inc.
   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_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP
  27 #define OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP
  28 

  29 #include "runtime/atomic.hpp"
  30 #include "runtime/os.hpp"
  31 #include "vm_version_zero.hpp"
  32 
  33 // Implementation of class atomic
  34 
  35 #ifdef M68K
  36 
  37 /*
  38  * __m68k_cmpxchg
  39  *
  40  * Atomically store newval in *ptr if *ptr is equal to oldval for user space.
  41  * Returns newval on success and oldval if no exchange happened.
  42  * This implementation is processor specific and works on
  43  * 68020 68030 68040 and 68060.
  44  *
  45  * It will not work on ColdFire, 68000 and 68010 since they lack the CAS
  46  * instruction.
  47  * Using a kernelhelper would be better for arch complete implementation.
  48  *