* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: i386native.c
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
* ========== Copyright Header End ============================================
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
#pragma ident "@(#)i386native.c 1.1 07/01/16 SMI"
#include "tsparcv9internal.h"
#include "sparcv9decode.h"
#include "sunmedia_intrin.h"
/* For now, map to Solaris 10 C-library implementations */
host_atomic_get128be(uint64_t *ptr
, uint64_t *r1p
, uint64_t *r2p
)
ux
.x
= _mm_load_si128((__m128i
*)ptr
);
host_swap(uint32_t *ptr
, uint32_t val
)
return (atomic_swap_32(ptr
, val
));
host_ldstub(uint8_t *ptr
, uint8_t v1
, uint8_t v2
)
return (atomic_swap_8(ptr
, 0xff));
host_cas32(uint32_t *target
, uint32_t cmp
, uint32_t newval
)
return (atomic_cas_32(target
, cmp
, newval
));
host_cas64(uint64_t *target
, uint64_t cmp
, uint64_t newval
)
return (atomic_cas_64(target
, cmp
, newval
));
sim_atomic_add_32_nv(uint32_t *target
, int32_t delta
)
return (atomic_add_32_nv(target
, delta
));