You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2015/06/14 00:56:02 UTC
[12/22] trafficserver git commit: TS-3689: Remove libck
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/ck_stack.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/ck_stack.h b/lib/ck/include/ck_stack.h
deleted file mode 100644
index 21d3f0f..0000000
--- a/lib/ck/include/ck_stack.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright 2009-2014 Samy Al Bahra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_STACK_H
-#define _CK_STACK_H
-
-#include <ck_cc.h>
-#include <ck_pr.h>
-#include <stdbool.h>
-#include <stddef.h>
-
-struct ck_stack_entry {
- struct ck_stack_entry *next;
-};
-typedef struct ck_stack_entry ck_stack_entry_t;
-
-struct ck_stack {
- struct ck_stack_entry *head;
- char *generation CK_CC_PACKED;
-} CK_CC_ALIASED;
-typedef struct ck_stack ck_stack_t;
-
-#define CK_STACK_INITIALIZER { NULL, NULL }
-
-#ifndef CK_F_STACK_PUSH_UPMC
-#define CK_F_STACK_PUSH_UPMC
-/*
- * Stack producer operation safe for multiple unique producers and multiple consumers.
- */
-CK_CC_INLINE static void
-ck_stack_push_upmc(struct ck_stack *target, struct ck_stack_entry *entry)
-{
- struct ck_stack_entry *stack;
-
- stack = ck_pr_load_ptr(&target->head);
- entry->next = stack;
- ck_pr_fence_store();
-
- while (ck_pr_cas_ptr_value(&target->head, stack, entry, &stack) == false) {
- entry->next = stack;
- ck_pr_fence_store();
- }
-
- return;
-}
-#endif /* CK_F_STACK_PUSH_UPMC */
-
-#ifndef CK_F_STACK_TRYPUSH_UPMC
-#define CK_F_STACK_TRYPUSH_UPMC
-/*
- * Stack producer operation for multiple unique producers and multiple consumers.
- * Returns true on success and false on failure.
- */
-CK_CC_INLINE static bool
-ck_stack_trypush_upmc(struct ck_stack *target, struct ck_stack_entry *entry)
-{
- struct ck_stack_entry *stack;
-
- stack = ck_pr_load_ptr(&target->head);
- entry->next = stack;
- ck_pr_fence_store();
-
- return ck_pr_cas_ptr(&target->head, stack, entry);
-}
-#endif /* CK_F_STACK_TRYPUSH_UPMC */
-
-#ifndef CK_F_STACK_POP_UPMC
-#define CK_F_STACK_POP_UPMC
-/*
- * Stack consumer operation safe for multiple unique producers and multiple consumers.
- */
-CK_CC_INLINE static struct ck_stack_entry *
-ck_stack_pop_upmc(struct ck_stack *target)
-{
- struct ck_stack_entry *entry, *next;
-
- entry = ck_pr_load_ptr(&target->head);
- if (entry == NULL)
- return NULL;
-
- ck_pr_fence_load();
- next = entry->next;
- while (ck_pr_cas_ptr_value(&target->head, entry, next, &entry) == false) {
- if (entry == NULL)
- break;
-
- ck_pr_fence_load();
- next = entry->next;
- }
-
- return entry;
-}
-#endif
-
-#ifndef CK_F_STACK_TRYPOP_UPMC
-#define CK_F_STACK_TRYPOP_UPMC
-/*
- * Stack production operation for multiple unique producers and multiple consumers.
- * Returns true on success and false on failure. The value pointed to by the second
- * argument is set to a valid ck_stack_entry_t reference if true is returned. If
- * false is returned, then the value pointed to by the second argument is undefined.
- */
-CK_CC_INLINE static bool
-ck_stack_trypop_upmc(struct ck_stack *target, struct ck_stack_entry **r)
-{
- struct ck_stack_entry *entry;
-
- entry = ck_pr_load_ptr(&target->head);
- if (entry == NULL)
- return false;
-
- ck_pr_fence_load();
- if (ck_pr_cas_ptr(&target->head, entry, entry->next) == true) {
- *r = entry;
- return true;
- }
-
- return false;
-}
-#endif /* CK_F_STACK_TRYPOP_UPMC */
-
-#ifndef CK_F_STACK_BATCH_POP_UPMC
-#define CK_F_STACK_BATCH_POP_UPMC
-/*
- * Pop all items off the stack.
- */
-CK_CC_INLINE static struct ck_stack_entry *
-ck_stack_batch_pop_upmc(struct ck_stack *target)
-{
- struct ck_stack_entry *entry;
-
- entry = ck_pr_fas_ptr(&target->head, NULL);
- ck_pr_fence_load();
- return entry;
-}
-#endif /* CK_F_STACK_BATCH_POP_UPMC */
-
-#ifndef CK_F_STACK_PUSH_MPMC
-#define CK_F_STACK_PUSH_MPMC
-/*
- * Stack producer operation safe for multiple producers and multiple consumers.
- */
-CK_CC_INLINE static void
-ck_stack_push_mpmc(struct ck_stack *target, struct ck_stack_entry *entry)
-{
-
- ck_stack_push_upmc(target, entry);
- return;
-}
-#endif /* CK_F_STACK_PUSH_MPMC */
-
-#ifndef CK_F_STACK_TRYPUSH_MPMC
-#define CK_F_STACK_TRYPUSH_MPMC
-/*
- * Stack producer operation safe for multiple producers and multiple consumers.
- */
-CK_CC_INLINE static bool
-ck_stack_trypush_mpmc(struct ck_stack *target, struct ck_stack_entry *entry)
-{
-
- return ck_stack_trypush_upmc(target, entry);
-}
-#endif /* CK_F_STACK_TRYPUSH_MPMC */
-
-#ifdef CK_F_PR_CAS_PTR_2_VALUE
-#ifndef CK_F_STACK_POP_MPMC
-#define CK_F_STACK_POP_MPMC
-/*
- * Stack consumer operation safe for multiple producers and multiple consumers.
- */
-CK_CC_INLINE static struct ck_stack_entry *
-ck_stack_pop_mpmc(struct ck_stack *target)
-{
- struct ck_stack original, update;
-
- original.generation = ck_pr_load_ptr(&target->generation);
- original.head = ck_pr_load_ptr(&target->head);
- if (original.head == NULL)
- return NULL;
-
- ck_pr_fence_load();
-
- update.generation = original.generation + 1;
- update.head = original.head->next;
-
- while (ck_pr_cas_ptr_2_value(target, &original, &update, &original) == false) {
- if (original.head == NULL)
- return NULL;
-
- update.generation = original.generation + 1;
-
- ck_pr_fence_load();
- update.head = original.head->next;
- }
-
- return original.head;
-}
-#endif /* CK_F_STACK_POP_MPMC */
-
-#ifndef CK_F_STACK_TRYPOP_MPMC
-#define CK_F_STACK_TRYPOP_MPMC
-CK_CC_INLINE static bool
-ck_stack_trypop_mpmc(struct ck_stack *target, struct ck_stack_entry **r)
-{
- struct ck_stack original, update;
-
- original.generation = ck_pr_load_ptr(&target->generation);
- original.head = ck_pr_load_ptr(&target->head);
- if (original.head == NULL)
- return false;
-
- update.generation = original.generation + 1;
- ck_pr_fence_load();
- update.head = original.head->next;
-
- if (ck_pr_cas_ptr_2_value(target, &original, &update, &original) == true) {
- *r = original.head;
- return true;
- }
-
- return false;
-}
-#endif /* CK_F_STACK_TRYPOP_MPMC */
-#endif /* CK_F_PR_CAS_PTR_2_VALUE */
-
-#ifndef CK_F_STACK_BATCH_POP_MPMC
-#define CK_F_STACK_BATCH_POP_MPMC
-/*
- * This is equivalent to the UP/MC version as NULL does not need a
- * a generation count.
- */
-CK_CC_INLINE static struct ck_stack_entry *
-ck_stack_batch_pop_mpmc(struct ck_stack *target)
-{
-
- return ck_stack_batch_pop_upmc(target);
-}
-#endif /* CK_F_STACK_BATCH_POP_MPMC */
-
-#ifndef CK_F_STACK_PUSH_MPNC
-#define CK_F_STACK_PUSH_MPNC
-/*
- * Stack producer operation safe with no concurrent consumers.
- */
-CK_CC_INLINE static void
-ck_stack_push_mpnc(struct ck_stack *target, struct ck_stack_entry *entry)
-{
- struct ck_stack_entry *stack;
-
- entry->next = NULL;
- ck_pr_fence_store();
- stack = ck_pr_fas_ptr(&target->head, entry);
- ck_pr_store_ptr(&entry->next, stack);
- ck_pr_fence_store();
-
- return;
-}
-#endif /* CK_F_STACK_PUSH_MPNC */
-
-/*
- * Stack producer operation for single producer and no concurrent consumers.
- */
-CK_CC_INLINE static void
-ck_stack_push_spnc(struct ck_stack *target, struct ck_stack_entry *entry)
-{
-
- entry->next = target->head;
- target->head = entry;
-
- return;
-}
-
-/*
- * Stack consumer operation for no concurrent producers and single consumer.
- */
-CK_CC_INLINE static struct ck_stack_entry *
-ck_stack_pop_npsc(struct ck_stack *target)
-{
- struct ck_stack_entry *n;
-
- if (target->head == NULL)
- return NULL;
-
- n = target->head;
- target->head = n->next;
-
- return n;
-}
-
-/*
- * Pop all items off a stack.
- */
-CK_CC_INLINE static struct ck_stack_entry *
-ck_stack_batch_pop_npsc(struct ck_stack *target)
-{
- struct ck_stack_entry *n;
-
- n = target->head;
- target->head = NULL;
-
- return n;
-}
-
-/*
- * Stack initialization function. Guarantees initialization across processors.
- */
-CK_CC_INLINE static void
-ck_stack_init(struct ck_stack *stack)
-{
-
- stack->head = NULL;
- stack->generation = NULL;
- return;
-}
-
-/* Defines a container_of functions for */
-#define CK_STACK_CONTAINER(T, M, N) CK_CC_CONTAINER(ck_stack_entry_t, T, M, N)
-
-#define CK_STACK_ISEMPTY(m) ((m)->head == NULL)
-#define CK_STACK_FIRST(s) ((s)->head)
-#define CK_STACK_NEXT(m) ((m)->next)
-#define CK_STACK_FOREACH(stack, entry) \
- for ((entry) = CK_STACK_FIRST(stack); \
- (entry) != NULL; \
- (entry) = CK_STACK_NEXT(entry))
-#define CK_STACK_FOREACH_SAFE(stack, entry, T) \
- for ((entry) = CK_STACK_FIRST(stack); \
- (entry) != NULL && ((T) = (entry)->next, 1); \
- (entry) = (T))
-
-#endif /* _CK_STACK_H */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/ck_stdint.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/ck_stdint.h b/lib/ck/include/ck_stdint.h
deleted file mode 100644
index e62cafa..0000000
--- a/lib/ck/include/ck_stdint.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010-2014 Samy Al Bahra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(__linux__) && defined(__KERNEL__)
-#include <linux/kernel.h>
-#include <linux/types.h>
-#else
-#include <stdint.h>
-#endif /* __linux__ && __KERNEL__ */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/ck_swlock.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/ck_swlock.h b/lib/ck/include/ck_swlock.h
deleted file mode 100644
index d880aaf..0000000
--- a/lib/ck/include/ck_swlock.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright 2014 Jaidev Sridhar.
- * Copyright 2014 Samy Al Bahra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_SWLOCK_H
-#define _CK_SWLOCK_H
-
-#include <ck_elide.h>
-#include <ck_limits.h>
-#include <ck_pr.h>
-#include <stdbool.h>
-#include <stddef.h>
-
-struct ck_swlock {
- uint32_t value;
-};
-typedef struct ck_swlock ck_swlock_t;
-
-#define CK_SWLOCK_INITIALIZER {0}
-#define CK_SWLOCK_WRITER_BIT (1UL << 31)
-#define CK_SWLOCK_LATCH_BIT (1UL << 30)
-#define CK_SWLOCK_WRITER_MASK (CK_SWLOCK_LATCH_BIT | CK_SWLOCK_WRITER_BIT)
-#define CK_SWLOCK_READER_MASK (UINT32_MAX ^ CK_SWLOCK_WRITER_MASK)
-
-CK_CC_INLINE static void
-ck_swlock_init(struct ck_swlock *rw)
-{
-
- rw->value = 0;
- ck_pr_barrier();
- return;
-}
-
-CK_CC_INLINE static void
-ck_swlock_write_unlock(ck_swlock_t *rw)
-{
-
- ck_pr_fence_release();
- ck_pr_and_32(&rw->value, CK_SWLOCK_READER_MASK);
- return;
-}
-
-CK_CC_INLINE static bool
-ck_swlock_locked_writer(ck_swlock_t *rw)
-{
-
- ck_pr_fence_load();
- return ck_pr_load_32(&rw->value) & CK_SWLOCK_WRITER_BIT;
-}
-
-CK_CC_INLINE static void
-ck_swlock_write_downgrade(ck_swlock_t *rw)
-{
-
- ck_pr_inc_32(&rw->value);
- ck_swlock_write_unlock(rw);
- return;
-}
-
-CK_CC_INLINE static bool
-ck_swlock_locked(ck_swlock_t *rw)
-{
-
- ck_pr_fence_load();
- return ck_pr_load_32(&rw->value);
-}
-
-CK_CC_INLINE static bool
-ck_swlock_write_trylock(ck_swlock_t *rw)
-{
-
- ck_pr_fence_acquire();
- return ck_pr_cas_32(&rw->value, 0, CK_SWLOCK_WRITER_BIT);
-}
-
-CK_ELIDE_TRYLOCK_PROTOTYPE(ck_swlock_write, ck_swlock_t,
- ck_swlock_locked, ck_swlock_write_trylock)
-
-CK_CC_INLINE static void
-ck_swlock_write_lock(ck_swlock_t *rw)
-{
-
- ck_pr_or_32(&rw->value, CK_SWLOCK_WRITER_BIT);
- while (ck_pr_load_32(&rw->value) & CK_SWLOCK_READER_MASK)
- ck_pr_stall();
-
- ck_pr_fence_acquire();
- return;
-}
-
-CK_CC_INLINE static void
-ck_swlock_write_latch(ck_swlock_t *rw)
-{
-
- /* Publish intent to acquire lock. */
- ck_pr_or_32(&rw->value, CK_SWLOCK_WRITER_BIT);
-
- /* Stall until readers have seen the seen writer and cleared. */
- while (ck_pr_cas_32(&rw->value, CK_SWLOCK_WRITER_BIT,
- CK_SWLOCK_WRITER_MASK) == false) {
- do {
- ck_pr_stall();
- } while (ck_pr_load_32(&rw->value) != CK_SWLOCK_WRITER_BIT);
- }
-
- ck_pr_fence_acquire();
- return;
-}
-
-CK_CC_INLINE static void
-ck_swlock_write_unlatch(ck_swlock_t *rw)
-{
-
- ck_pr_fence_release();
- ck_pr_store_32(&rw->value, 0);
- return;
-}
-
-CK_ELIDE_PROTOTYPE(ck_swlock_write, ck_swlock_t,
- ck_swlock_locked, ck_swlock_write_lock,
- ck_swlock_locked_writer, ck_swlock_write_unlock)
-
-CK_ELIDE_TRYLOCK_PROTOTYPE(ck_swlock_read, ck_swlock_t,
- ck_swlock_locked_writer, ck_swlock_read_trylock)
-
-CK_CC_INLINE static bool
-ck_swlock_read_trylock(ck_swlock_t *rw)
-{
- uint32_t l = ck_pr_load_32(&rw->value);
-
- if (l & CK_SWLOCK_WRITER_BIT)
- return false;
-
- l = ck_pr_faa_32(&rw->value, 1) & CK_SWLOCK_WRITER_MASK;
- if (l == 0) {
- ck_pr_fence_acquire();
- return true;
- }
-
- if (l == CK_SWLOCK_WRITER_BIT)
- ck_pr_dec_32(&rw->value);
-
- return false;
-}
-
-CK_CC_INLINE static void
-ck_swlock_read_lock(ck_swlock_t *rw)
-{
- uint32_t l;
-
- for (;;) {
- while (ck_pr_load_32(&rw->value) & CK_SWLOCK_WRITER_BIT)
- ck_pr_stall();
-
- l = ck_pr_faa_32(&rw->value, 1) & CK_SWLOCK_WRITER_MASK;
- if (l == 0)
- break;
-
- /*
- * If the latch bit has not been set, then the writer would
- * have observed the reader and will wait to completion of
- * read-side critical section.
- */
- if (l == CK_SWLOCK_WRITER_BIT)
- ck_pr_dec_32(&rw->value);
- }
-
- ck_pr_fence_acquire();
- return;
-}
-
-
-CK_CC_INLINE static bool
-ck_swlock_locked_reader(ck_swlock_t *rw)
-{
-
- ck_pr_fence_load();
- return ck_pr_load_32(&rw->value) & CK_SWLOCK_READER_MASK;
-}
-
-CK_CC_INLINE static void
-ck_swlock_read_unlock(ck_swlock_t *rw)
-{
-
- ck_pr_fence_release();
- ck_pr_dec_32(&rw->value);
- return;
-}
-
-CK_ELIDE_PROTOTYPE(ck_swlock_read, ck_swlock_t,
- ck_swlock_locked_writer, ck_swlock_read_lock,
- ck_swlock_locked_reader, ck_swlock_read_unlock)
-
-#endif /* _CK_SWLOCK_H */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/ck_tflock.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/ck_tflock.h b/lib/ck/include/ck_tflock.h
deleted file mode 100644
index 3bb43d5..0000000
--- a/lib/ck/include/ck_tflock.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2014 Samy Al Bahra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_TFLOCK_TICKET_H
-#define _CK_TFLOCK_TICKET_H
-
-/*
- * This is an implementation of task-fair locks derived from the work
- * described in:
- * John M. Mellor-Crummey and Michael L. Scott. 1991.
- * Scalable reader-writer synchronization for shared-memory
- * multiprocessors. SIGPLAN Not. 26, 7 (April 1991), 106-113.
- */
-
-#include <ck_cc.h>
-#include <ck_pr.h>
-
-struct ck_tflock_ticket {
- uint32_t request;
- uint32_t completion;
-};
-typedef struct ck_tflock_ticket ck_tflock_ticket_t;
-
-#define CK_TFLOCK_TICKET_INITIALIZER { 0, 0 }
-
-#define CK_TFLOCK_TICKET_RC_INCR 0x10000U /* Read-side increment. */
-#define CK_TFLOCK_TICKET_WC_INCR 0x1U /* Write-side increment. */
-#define CK_TFLOCK_TICKET_W_MASK 0xffffU /* Write-side mask. */
-#define CK_TFLOCK_TICKET_WC_TOPMSK 0x8000U /* Write clear mask for overflow. */
-#define CK_TFLOCK_TICKET_RC_TOPMSK 0x80000000U /* Read clear mask for overflow. */
-
-CK_CC_INLINE static uint32_t
-ck_tflock_ticket_fca_32(uint32_t *target, uint32_t mask, uint32_t delta)
-{
- uint32_t snapshot = ck_pr_load_32(target);
- uint32_t goal;
-
- for (;;) {
- goal = (snapshot & ~mask) + delta;
- if (ck_pr_cas_32_value(target, snapshot, goal, &snapshot) == true)
- break;
-
- ck_pr_stall();
- }
-
- return snapshot;
-}
-
-CK_CC_INLINE static void
-ck_tflock_ticket_init(struct ck_tflock_ticket *pf)
-{
-
- pf->request = pf->completion = 0;
- ck_pr_barrier();
- return;
-}
-
-CK_CC_INLINE static void
-ck_tflock_ticket_write_lock(struct ck_tflock_ticket *lock)
-{
- uint32_t previous;
-
- previous = ck_tflock_ticket_fca_32(&lock->request, CK_TFLOCK_TICKET_WC_TOPMSK,
- CK_TFLOCK_TICKET_WC_INCR);
- ck_pr_fence_atomic_load();
- while (ck_pr_load_32(&lock->completion) != previous)
- ck_pr_stall();
-
- ck_pr_fence_acquire();
- return;
-}
-
-CK_CC_INLINE static void
-ck_tflock_ticket_write_unlock(struct ck_tflock_ticket *lock)
-{
-
- ck_pr_fence_release();
- ck_tflock_ticket_fca_32(&lock->completion, CK_TFLOCK_TICKET_WC_TOPMSK,
- CK_TFLOCK_TICKET_WC_INCR);
- return;
-}
-
-CK_CC_INLINE static void
-ck_tflock_ticket_read_lock(struct ck_tflock_ticket *lock)
-{
- uint32_t previous;
-
- previous = ck_tflock_ticket_fca_32(&lock->request, CK_TFLOCK_TICKET_RC_TOPMSK,
- CK_TFLOCK_TICKET_RC_INCR) & CK_TFLOCK_TICKET_W_MASK;
-
- ck_pr_fence_atomic_load();
-
- while ((ck_pr_load_uint(&lock->completion) & CK_TFLOCK_TICKET_W_MASK) != previous)
- ck_pr_stall();
-
- ck_pr_fence_acquire();
- return;
-}
-
-CK_CC_INLINE static void
-ck_tflock_ticket_read_unlock(struct ck_tflock_ticket *lock)
-{
-
- ck_pr_fence_release();
- ck_tflock_ticket_fca_32(&lock->completion, CK_TFLOCK_TICKET_RC_TOPMSK,
- CK_TFLOCK_TICKET_RC_INCR);
- return;
-}
-
-#endif /* _CK_TFLOCK_TICKET_H */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/arm/ck_f_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/arm/ck_f_pr.h b/lib/ck/include/gcc/arm/ck_f_pr.h
deleted file mode 100644
index c06684c..0000000
--- a/lib/ck/include/gcc/arm/ck_f_pr.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/* DO NOT EDIT. This is auto-generated from feature.sh */
-#define CK_F_PR_ADD_16
-#define CK_F_PR_ADD_32
-#define CK_F_PR_ADD_8
-#define CK_F_PR_ADD_CHAR
-#define CK_F_PR_ADD_INT
-#define CK_F_PR_ADD_PTR
-#define CK_F_PR_ADD_SHORT
-#define CK_F_PR_ADD_UINT
-#define CK_F_PR_AND_16
-#define CK_F_PR_AND_32
-#define CK_F_PR_AND_8
-#define CK_F_PR_AND_CHAR
-#define CK_F_PR_AND_INT
-#define CK_F_PR_AND_PTR
-#define CK_F_PR_AND_SHORT
-#define CK_F_PR_AND_UINT
-#define CK_F_PR_BARRIER
-#define CK_F_PR_CAS_16
-#define CK_F_PR_CAS_16_VALUE
-#define CK_F_PR_CAS_32
-#define CK_F_PR_CAS_32_VALUE
-#define CK_F_PR_CAS_64
-#define CK_F_PR_CAS_64_VALUE
-#define CK_F_PR_CAS_8
-#define CK_F_PR_CAS_8_VALUE
-#define CK_F_PR_CAS_CHAR
-#define CK_F_PR_CAS_CHAR_VALUE
-#define CK_F_PR_CAS_INT
-#define CK_F_PR_CAS_INT_VALUE
-#define CK_F_PR_CAS_PTR
-#define CK_F_PR_CAS_PTR_2
-#define CK_F_PR_CAS_PTR_2_VALUE
-#define CK_F_PR_CAS_PTR_VALUE
-#define CK_F_PR_CAS_SHORT
-#define CK_F_PR_CAS_SHORT_VALUE
-#define CK_F_PR_CAS_UINT
-#define CK_F_PR_CAS_UINT_VALUE
-#define CK_F_PR_DEC_16
-#define CK_F_PR_DEC_32
-#define CK_F_PR_DEC_8
-#define CK_F_PR_DEC_CHAR
-#define CK_F_PR_DEC_INT
-#define CK_F_PR_DEC_PTR
-#define CK_F_PR_DEC_SHORT
-#define CK_F_PR_DEC_UINT
-#define CK_F_PR_FAA_16
-#define CK_F_PR_FAA_32
-#define CK_F_PR_FAA_8
-#define CK_F_PR_FAA_CHAR
-#define CK_F_PR_FAA_INT
-#define CK_F_PR_FAA_PTR
-#define CK_F_PR_FAA_SHORT
-#define CK_F_PR_FAA_UINT
-#define CK_F_PR_FAS_16
-#define CK_F_PR_FAS_32
-#define CK_F_PR_FAS_8
-#define CK_F_PR_FAS_CHAR
-#define CK_F_PR_FAS_INT
-#define CK_F_PR_FAS_PTR
-#define CK_F_PR_FAS_SHORT
-#define CK_F_PR_FAS_UINT
-#define CK_F_PR_FENCE_ATOMIC
-#define CK_F_PR_FENCE_ATOMIC_LOAD
-#define CK_F_PR_FENCE_ATOMIC_STORE
-#define CK_F_PR_FENCE_LOAD
-#define CK_F_PR_FENCE_LOAD_ATOMIC
-#define CK_F_PR_FENCE_LOAD_DEPENDS
-#define CK_F_PR_FENCE_LOAD_STORE
-#define CK_F_PR_FENCE_MEMORY
-#define CK_F_PR_FENCE_STORE
-#define CK_F_PR_FENCE_STORE_ATOMIC
-#define CK_F_PR_FENCE_STORE_LOAD
-#define CK_F_PR_FENCE_STRICT_ATOMIC
-#define CK_F_PR_FENCE_STRICT_ATOMIC_LOAD
-#define CK_F_PR_FENCE_STRICT_ATOMIC_STORE
-#define CK_F_PR_FENCE_STRICT_LOAD
-#define CK_F_PR_FENCE_STRICT_LOAD_ATOMIC
-#define CK_F_PR_FENCE_STRICT_LOAD_STORE
-#define CK_F_PR_FENCE_STRICT_MEMORY
-#define CK_F_PR_FENCE_STRICT_STORE
-#define CK_F_PR_FENCE_STRICT_STORE_ATOMIC
-#define CK_F_PR_FENCE_STRICT_STORE_LOAD
-#define CK_F_PR_INC_16
-#define CK_F_PR_INC_32
-#define CK_F_PR_INC_8
-#define CK_F_PR_INC_CHAR
-#define CK_F_PR_INC_INT
-#define CK_F_PR_INC_PTR
-#define CK_F_PR_INC_SHORT
-#define CK_F_PR_INC_UINT
-#define CK_F_PR_LOAD_16
-#define CK_F_PR_LOAD_32
-#define CK_F_PR_LOAD_64
-#define CK_F_PR_LOAD_8
-#define CK_F_PR_LOAD_CHAR
-#define CK_F_PR_LOAD_INT
-#define CK_F_PR_LOAD_PTR
-#define CK_F_PR_LOAD_SHORT
-#define CK_F_PR_LOAD_UINT
-#define CK_F_PR_NEG_16
-#define CK_F_PR_NEG_32
-#define CK_F_PR_NEG_8
-#define CK_F_PR_NEG_CHAR
-#define CK_F_PR_NEG_INT
-#define CK_F_PR_NEG_PTR
-#define CK_F_PR_NEG_SHORT
-#define CK_F_PR_NEG_UINT
-#define CK_F_PR_NOT_16
-#define CK_F_PR_NOT_32
-#define CK_F_PR_NOT_8
-#define CK_F_PR_NOT_CHAR
-#define CK_F_PR_NOT_INT
-#define CK_F_PR_NOT_PTR
-#define CK_F_PR_NOT_SHORT
-#define CK_F_PR_NOT_UINT
-#define CK_F_PR_OR_16
-#define CK_F_PR_OR_32
-#define CK_F_PR_OR_8
-#define CK_F_PR_OR_CHAR
-#define CK_F_PR_OR_INT
-#define CK_F_PR_OR_PTR
-#define CK_F_PR_OR_SHORT
-#define CK_F_PR_OR_UINT
-#define CK_F_PR_STALL
-#define CK_F_PR_STORE_16
-#define CK_F_PR_STORE_32
-#define CK_F_PR_STORE_64
-#define CK_F_PR_STORE_8
-#define CK_F_PR_STORE_CHAR
-#define CK_F_PR_STORE_INT
-#define CK_F_PR_STORE_PTR
-#define CK_F_PR_STORE_SHORT
-#define CK_F_PR_STORE_UINT
-#define CK_F_PR_SUB_16
-#define CK_F_PR_SUB_32
-#define CK_F_PR_SUB_8
-#define CK_F_PR_SUB_CHAR
-#define CK_F_PR_SUB_INT
-#define CK_F_PR_SUB_PTR
-#define CK_F_PR_SUB_SHORT
-#define CK_F_PR_SUB_UINT
-#define CK_F_PR_XOR_16
-#define CK_F_PR_XOR_32
-#define CK_F_PR_XOR_8
-#define CK_F_PR_XOR_CHAR
-#define CK_F_PR_XOR_INT
-#define CK_F_PR_XOR_PTR
-#define CK_F_PR_XOR_SHORT
-#define CK_F_PR_XOR_UINT
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/arm/ck_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/arm/ck_pr.h b/lib/ck/include/gcc/arm/ck_pr.h
deleted file mode 100644
index d2a34e1..0000000
--- a/lib/ck/include/gcc/arm/ck_pr.h
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
- * Copyright 2009-2014 Samy Al Bahra.
- * Copyright 2013-2014 Olivier Houchard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_PR_ARM_H
-#define _CK_PR_ARM_H
-
-#ifndef _CK_PR_H
-#error Do not include this file directly, use ck_pr.h
-#endif
-
-#include <ck_cc.h>
-#include <ck_md.h>
-
-/*
- * The following represent supported atomic operations.
- * These operations may be emulated.
- */
-#include "ck_f_pr.h"
-
-/*
- * Minimum interface requirement met.
- */
-#define CK_F_PR
-
-CK_CC_INLINE static void
-ck_pr_stall(void)
-{
-
- __asm__ __volatile__("" ::: "memory");
- return;
-}
-
-#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
-#define __CK_ISB __asm __volatile("isb" : : "r" (0) : "memory")
-#define _CK_DMB __asm __volatile("dmb" : : "r" (0) : "memory")
-#define _CK_DSB __asm __volatile("dsb" : : "r" (0) : "memory")
-/* FreeBSD's toolchain doesn't accept dmb st, so use the opcode instead */
-#ifdef __FreeBSD__
-#define _CK_DMB_ST __asm __volatile(".word 0xf57ff05e" : : "r" (0) : "memory")
-#else
-#define _CK_DMB_ST __asm __volatile("dmb st" : : "r" (0) : "memory")
-#endif /* __FreeBSD__ */
-#else
-/* armv6 doesn't have dsb/dmb/isb, and no way to wait only for stores */
-#define _CK_ISB \
- __asm __volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) : "memory")
-#define _CK_DSB \
- __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory")
-#define _CK_DMB \
- __asm __volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory")
-#define _CK_DMB_ST _CK_DMB
-#endif
-
-#define CK_PR_FENCE(T, I) \
- CK_CC_INLINE static void \
- ck_pr_fence_strict_##T(void) \
- { \
- I; \
- }
-
-CK_PR_FENCE(atomic, _CK_DMB_ST)
-CK_PR_FENCE(atomic_store, _CK_DMB_ST)
-CK_PR_FENCE(atomic_load, _CK_DMB_ST)
-CK_PR_FENCE(store_atomic, _CK_DMB_ST)
-CK_PR_FENCE(load_atomic, _CK_DMB)
-CK_PR_FENCE(store, _CK_DMB_ST)
-CK_PR_FENCE(store_load, _CK_DMB_ST)
-CK_PR_FENCE(load, _CK_DMB)
-CK_PR_FENCE(load_store, _CK_DMB)
-CK_PR_FENCE(memory, _CK_DMB)
-CK_PR_FENCE(acquire, _CK_DMB)
-CK_PR_FENCE(release, _CK_DMB)
-
-#undef CK_PR_FENCE
-
-#undef _CK_ISB
-#undef _CK_DSB
-#undef _CK_DMB
-#undef _CK_DMB_ST
-
-#define CK_PR_LOAD(S, M, T, C, I) \
- CK_CC_INLINE static T \
- ck_pr_load_##S(const M *target) \
- { \
- long r = 0; \
- __asm__ __volatile__(I " %0, [%1];" \
- : "=r" (r) \
- : "r" (target) \
- : "memory"); \
- return ((T)r); \
- }
-
-CK_PR_LOAD(ptr, void, void *, uint32_t, "ldr")
-
-#define CK_PR_LOAD_S(S, T, I) CK_PR_LOAD(S, T, T, T, I)
-
-CK_PR_LOAD_S(32, uint32_t, "ldr")
-CK_PR_LOAD_S(16, uint16_t, "ldrh")
-CK_PR_LOAD_S(8, uint8_t, "ldrb")
-CK_PR_LOAD_S(uint, unsigned int, "ldr")
-CK_PR_LOAD_S(int, int, "ldr")
-CK_PR_LOAD_S(short, short, "ldrh")
-CK_PR_LOAD_S(char, char, "ldrb")
-
-#undef CK_PR_LOAD_S
-#undef CK_PR_LOAD
-
-CK_CC_INLINE static uint64_t
-ck_pr_load_64(const uint64_t *target)
-{
- register uint64_t ret asm("r0");
-
- __asm __volatile("ldrd %0, [%1]" : "+r" (ret)
- : "r" (target)
- : "memory", "cc");
- return (ret);
-}
-
-#define CK_PR_STORE(S, M, T, C, I) \
- CK_CC_INLINE static void \
- ck_pr_store_##S(M *target, T v) \
- { \
- __asm__ __volatile__(I " %1, [%0]" \
- : \
- : "r" (target), \
- "r" (v) \
- : "memory"); \
- return; \
- }
-
-CK_PR_STORE(ptr, void, const void *, uint32_t, "str")
-
-#define CK_PR_STORE_S(S, T, I) CK_PR_STORE(S, T, T, T, I)
-
-CK_PR_STORE_S(32, uint32_t, "str")
-CK_PR_STORE_S(16, uint16_t, "strh")
-CK_PR_STORE_S(8, uint8_t, "strb")
-CK_PR_STORE_S(uint, unsigned int, "str")
-CK_PR_STORE_S(int, int, "str")
-CK_PR_STORE_S(short, short, "strh")
-CK_PR_STORE_S(char, char, "strb")
-
-#undef CK_PR_STORE_S
-#undef CK_PR_STORE
-
-CK_CC_INLINE static void
-ck_pr_store_64(const uint64_t *target, uint64_t value)
-{
-
- __asm __volatile("strd %0, [%1]"
- :
- : "r" (value), "r" (target)
- : "memory", "cc");
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_64_value(uint64_t *target, uint64_t compare, uint64_t set, uint64_t *value)
-{
- uint64_t previous;
- int tmp;
-
- __asm__ __volatile__("1:"
- "ldrexd %0, [%4];"
- "cmp %Q0, %Q2;"
- "ittt eq;"
- "cmpeq %R0, %R2;"
- "strexdeq %1, %3, [%4];"
- "cmpeq %1, #1;"
- "beq 1b;"
- :"=&r" (previous), "=&r" (tmp)
- : "r" (compare), "r" (set) ,
- "r"(target)
- : "memory", "cc", "r4", "r5", "r6");
- *value = previous;
- return (*value == compare);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value)
-{
- uint32_t *_compare = compare;
- uint32_t *_set = set;
- uint64_t __compare = ((uint64_t)_compare[0]) | ((uint64_t)_compare[1] << 32);
- uint64_t __set = ((uint64_t)_set[0]) | ((uint64_t)_set[1] << 32);
-
- return (ck_pr_cas_64_value(target, __compare, __set, value));
-}
-
-
-CK_CC_INLINE static bool
-ck_pr_cas_64(uint64_t *target, uint64_t compare, uint64_t set)
-{
- int ret;
- uint64_t tmp;
-
- __asm__ __volatile__("1:"
- "mov %0, #0;"
- "ldrexd %1, [%4];"
- "cmp %Q1, %Q2;"
- "itttt eq;"
- "cmpeq %R1, %R2;"
- "strexdeq %1, %3, [%4];"
- "moveq %0, #1;"
- "cmpeq %1, #1;"
- "beq 1b;"
- : "=&r" (ret), "=&r" (tmp)
- : "r" (compare), "r" (set) ,
- "r"(target)
- : "memory", "cc", "r4", "r5", "r6");
-
- return (ret);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr_2(void *target, void *compare, void *set)
-{
- uint32_t *_compare = compare;
- uint32_t *_set = set;
- uint64_t __compare = ((uint64_t)_compare[0]) | ((uint64_t)_compare[1] << 32);
- uint64_t __set = ((uint64_t)_set[0]) | ((uint64_t)_set[1] << 32);
- return (ck_pr_cas_64(target, __compare, __set));
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr_value(void *target, void *compare, void *set, void *value)
-{
- void *previous, *tmp;
- __asm__ __volatile__("1:"
- "ldrex %0, [%2];"
- "cmp %0, %4;"
- "itt eq;"
- "strexeq %1, %3, [%2];"
- "cmpeq %1, #1;"
- "beq 1b;"
- : "=&r" (previous),
- "=&r" (tmp)
- : "r" (target),
- "r" (set),
- "r" (compare)
- : "memory", "cc");
- *(void **)value = previous;
- return (previous == compare);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr(void *target, void *compare, void *set)
-{
- void *previous, *tmp;
- __asm__ __volatile__("1:"
- "ldrex %0, [%2];"
- "cmp %0, %4;"
- "itt eq;"
- "strexeq %1, %3, [%2];"
- "cmpeq %1, #1;"
- "beq 1b;"
- : "=&r" (previous),
- "=&r" (tmp)
- : "r" (target),
- "r" (set),
- "r" (compare)
- : "memory", "cc");
- return (previous == compare);
-}
-
-#define CK_PR_CAS(N, T, W) \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N##_value(T *target, T compare, T set, T *value) \
- { \
- T previous = 0, tmp = 0; \
- __asm__ __volatile__("1:" \
- "ldrex" W " %0, [%2];" \
- "cmp %0, %4;" \
- "itt eq;" \
- "strex" W "eq %1, %3, [%2];" \
- "cmpeq %1, #1;" \
- "beq 1b;" \
- /* \
- * Using "+&" instead of "=&" to avoid bogus \
- * clang warnings. \
- */ \
- : "+&r" (previous), \
- "+&r" (tmp) \
- : "r" (target), \
- "r" (set), \
- "r" (compare) \
- : "memory", "cc"); \
- *value = previous; \
- return (previous == compare); \
- } \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N(T *target, T compare, T set) \
- { \
- T previous = 0, tmp = 0; \
- __asm__ __volatile__("1:" \
- "ldrex" W " %0, [%2];" \
- "cmp %0, %4;" \
- "itt eq;" \
- "strex" W "eq %1, %3, [%2];" \
- "cmpeq %1, #1;" \
- "beq 1b;" \
- : "+&r" (previous), \
- "+&r" (tmp) \
- : "r" (target), \
- "r" (set), \
- "r" (compare) \
- : "memory", "cc"); \
- return (previous == compare); \
- }
-
-CK_PR_CAS(32, uint32_t, "")
-CK_PR_CAS(uint, unsigned int, "")
-CK_PR_CAS(int, int, "")
-CK_PR_CAS(16, uint16_t, "h")
-CK_PR_CAS(8, uint8_t, "b")
-CK_PR_CAS(short, short, "h")
-CK_PR_CAS(char, char, "b")
-
-
-#undef CK_PR_CAS_S
-#undef CK_PR_CAS
-
-#define CK_PR_FAS(N, M, T, W) \
- CK_CC_INLINE static T \
- ck_pr_fas_##N(M *target, T v) \
- { \
- T previous = 0; \
- T tmp = 0; \
- __asm__ __volatile__("1:" \
- "ldrex" W " %0, [%2];" \
- "strex" W " %1, %3, [%2];" \
- "cmp %1, #0;" \
- "bne 1b;" \
- : "+&r" (previous), \
- "+&r" (tmp) \
- : "r" (target), \
- "r" (v) \
- : "memory", "cc"); \
- return (previous); \
- }
-
-CK_PR_FAS(32, uint32_t, uint32_t, "")
-CK_PR_FAS(ptr, void, void *, "")
-CK_PR_FAS(int, int, int, "")
-CK_PR_FAS(uint, unsigned int, unsigned int, "")
-CK_PR_FAS(16, uint16_t, uint16_t, "h")
-CK_PR_FAS(8, uint8_t, uint8_t, "b")
-CK_PR_FAS(short, short, short, "h")
-CK_PR_FAS(char, char, char, "b")
-
-
-#undef CK_PR_FAS
-
-#define CK_PR_UNARY(O, N, M, T, I, W) \
- CK_CC_INLINE static void \
- ck_pr_##O##_##N(M *target) \
- { \
- T previous = 0; \
- T tmp = 0; \
- __asm__ __volatile__("1:" \
- "ldrex" W " %0, [%2];" \
- I ";" \
- "strex" W " %1, %0, [%2];" \
- "cmp %1, #0;" \
- "bne 1b;" \
- : "+&r" (previous), \
- "+&r" (tmp) \
- : "r" (target) \
- : "memory", "cc"); \
- return; \
- }
-
-CK_PR_UNARY(inc, ptr, void, void *, "add %0, %0, #1", "")
-CK_PR_UNARY(dec, ptr, void, void *, "sub %0, %0, #1", "")
-CK_PR_UNARY(not, ptr, void, void *, "mvn %0, %0", "")
-CK_PR_UNARY(neg, ptr, void, void *, "neg %0, %0", "")
-
-#define CK_PR_UNARY_S(S, T, W) \
- CK_PR_UNARY(inc, S, T, T, "add %0, %0, #1", W) \
- CK_PR_UNARY(dec, S, T, T, "sub %0, %0, #1", W) \
- CK_PR_UNARY(not, S, T, T, "mvn %0, %0", W) \
- CK_PR_UNARY(neg, S, T, T, "neg %0, %0", W) \
-
-CK_PR_UNARY_S(32, uint32_t, "")
-CK_PR_UNARY_S(uint, unsigned int, "")
-CK_PR_UNARY_S(int, int, "")
-CK_PR_UNARY_S(16, uint16_t, "h")
-CK_PR_UNARY_S(8, uint8_t, "b")
-CK_PR_UNARY_S(short, short, "h")
-CK_PR_UNARY_S(char, char, "b")
-
-#undef CK_PR_UNARY_S
-#undef CK_PR_UNARY
-
-#define CK_PR_BINARY(O, N, M, T, I, W) \
- CK_CC_INLINE static void \
- ck_pr_##O##_##N(M *target, T delta) \
- { \
- T previous = 0; \
- T tmp = 0; \
- __asm__ __volatile__("1:" \
- "ldrex" W " %0, [%2];" \
- I " %0, %0, %3;" \
- "strex" W " %1, %0, [%2];" \
- "cmp %1, #0;" \
- "bne 1b;" \
- : "+&r" (previous), \
- "+&r" (tmp) \
- : "r" (target), \
- "r" (delta) \
- : "memory", "cc"); \
- return; \
- }
-
-CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "")
-CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "")
-CK_PR_BINARY(or, ptr, void, uintptr_t, "orr", "")
-CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "")
-CK_PR_BINARY(xor, ptr, void, uintptr_t, "eor", "")
-
-#define CK_PR_BINARY_S(S, T, W) \
- CK_PR_BINARY(and, S, T, T, "and", W) \
- CK_PR_BINARY(add, S, T, T, "add", W) \
- CK_PR_BINARY(or, S, T, T, "orr", W) \
- CK_PR_BINARY(sub, S, T, T, "sub", W) \
- CK_PR_BINARY(xor, S, T, T, "eor", W)
-
-CK_PR_BINARY_S(32, uint32_t, "")
-CK_PR_BINARY_S(uint, unsigned int, "")
-CK_PR_BINARY_S(int, int, "")
-CK_PR_BINARY_S(16, uint16_t, "h")
-CK_PR_BINARY_S(8, uint8_t, "b")
-CK_PR_BINARY_S(short, short, "h")
-CK_PR_BINARY_S(char, char, "b")
-
-#undef CK_PR_BINARY_S
-#undef CK_PR_BINARY
-
-CK_CC_INLINE static void *
-ck_pr_faa_ptr(void *target, uintptr_t delta)
-{
- uintptr_t previous, r, tmp;
-
- __asm__ __volatile__("1:"
- "ldrex %0, [%3];"
- "add %1, %4, %0;"
- "strex %2, %1, [%3];"
- "cmp %2, #0;"
- "bne 1b;"
- : "=&r" (previous),
- "=&r" (r),
- "=&r" (tmp)
- : "r" (target),
- "r" (delta)
- : "memory", "cc");
-
- return (void *)(previous);
-}
-
-#define CK_PR_FAA(S, T, W) \
- CK_CC_INLINE static T \
- ck_pr_faa_##S(T *target, T delta) \
- { \
- T previous = 0, r = 0, tmp = 0; \
- __asm__ __volatile__("1:" \
- "ldrex" W " %0, [%3];" \
- "add %1, %4, %0;" \
- "strex" W " %2, %1, [%3];" \
- "cmp %2, #0;" \
- "bne 1b;" \
- : "+&r" (previous), \
- "+&r" (r), \
- "+&r" (tmp) \
- : "r" (target), \
- "r" (delta) \
- : "memory", "cc"); \
- return (previous); \
- }
-
-CK_PR_FAA(32, uint32_t, "")
-CK_PR_FAA(uint, unsigned int, "")
-CK_PR_FAA(int, int, "")
-CK_PR_FAA(16, uint16_t, "h")
-CK_PR_FAA(8, uint8_t, "b")
-CK_PR_FAA(short, short, "h")
-CK_PR_FAA(char, char, "b")
-
-#undef CK_PR_FAA
-
-#endif /* _CK_PR_ARM_H */
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/ck_cc.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/ck_cc.h b/lib/ck/include/gcc/ck_cc.h
deleted file mode 100644
index 084e7bf..0000000
--- a/lib/ck/include/gcc/ck_cc.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2009-2014 Samy Al Bahra.
- * Copyright 2014 Paul Khuong.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_GCC_CC_H
-#define _CK_GCC_CC_H
-
-#include <ck_md.h>
-
-#ifdef __SUNPRO_C
-#define CK_CC_UNUSED
-#define CK_CC_USED
-#define CK_CC_IMM
-#define CK_CC_IMM_U32
-#else
-#define CK_CC_UNUSED __attribute__((unused))
-#define CK_CC_USED __attribute__((used))
-#define CK_CC_IMM "i"
-#if defined(__x86_64__) || defined(__x86__)
-#define CK_CC_IMM_U32 "Z"
-#define CK_CC_IMM_S32 "e"
-#else
-#define CK_CC_IMM_U32 CK_CC_IMM
-#define CK_CC_IMM_S32 CK_CC_IMM
-#endif /* __x86_64__ || __x86__ */
-#endif
-
-/*
- * If optimizations are turned on, then force inlining.
- */
-#ifdef __OPTIMIZE__
-#define CK_CC_INLINE CK_CC_UNUSED inline
-#else
-#define CK_CC_INLINE CK_CC_UNUSED
-#endif
-
-/*
- * Packed attribute.
- */
-#define CK_CC_PACKED __attribute__((packed))
-
-/*
- * Weak reference.
- */
-#define CK_CC_WEAKREF __attribute__((weakref))
-
-/*
- * Alignment attribute.
- */
-#define CK_CC_ALIGN(B) __attribute__((aligned(B)))
-
-/*
- * Cache align.
- */
-#define CK_CC_CACHELINE CK_CC_ALIGN(CK_MD_CACHELINE)
-
-/*
- * These are functions which should be avoided.
- */
-#ifdef __freestanding__
-#pragma GCC poison malloc free
-#endif
-
-/*
- * Branch execution hints.
- */
-#define CK_CC_LIKELY(x) (__builtin_expect(!!(x), 1))
-#define CK_CC_UNLIKELY(x) (__builtin_expect(!!(x), 0))
-
-/*
- * Some compilers are overly strict regarding aliasing semantics.
- * Unfortunately, in many cases it makes more sense to pay aliasing
- * cost rather than overly expensive register spillage.
- */
-#define CK_CC_ALIASED __attribute__((__may_alias__))
-
-/*
- * Portability wrappers for bitwise ops.
- */
-
-#define CK_F_CC_FFS
-#define CK_F_CC_CLZ
-#define CK_F_CC_CTZ
-#define CK_F_CC_POPCOUNT
-
-CK_CC_INLINE static int
-ck_cc_ffs(unsigned int x)
-{
-
- return __builtin_ffs(x);
-}
-
-CK_CC_INLINE static int
-ck_cc_clz(unsigned int x)
-{
-
- return __builtin_clz(x);
-}
-
-CK_CC_INLINE static int
-ck_cc_ctz(unsigned int x)
-{
-
- return __builtin_ctz(x);
-}
-
-CK_CC_INLINE static int
-ck_cc_popcount(unsigned int x)
-{
-
- return __builtin_popcount(x);
-}
-
-#endif /* _CK_GCC_CC_H */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/ck_f_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/ck_f_pr.h b/lib/ck/include/gcc/ck_f_pr.h
deleted file mode 100644
index a858c80..0000000
--- a/lib/ck/include/gcc/ck_f_pr.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* DO NOT EDIT. This is auto-generated from feature.sh */
-#define CK_F_PR_ADD_16
-#define CK_F_PR_ADD_32
-#define CK_F_PR_ADD_64
-#define CK_F_PR_ADD_8
-#define CK_F_PR_ADD_CHAR
-#define CK_F_PR_ADD_INT
-#define CK_F_PR_ADD_PTR
-#define CK_F_PR_ADD_UINT
-#define CK_F_PR_AND_16
-#define CK_F_PR_AND_32
-#define CK_F_PR_AND_64
-#define CK_F_PR_AND_8
-#define CK_F_PR_AND_CHAR
-#define CK_F_PR_AND_INT
-#define CK_F_PR_AND_PTR
-#define CK_F_PR_AND_UINT
-#define CK_F_PR_CAS_16
-#define CK_F_PR_CAS_16_VALUE
-#define CK_F_PR_CAS_32
-#define CK_F_PR_CAS_32_VALUE
-#define CK_F_PR_CAS_64
-#define CK_F_PR_CAS_64_VALUE
-#define CK_F_PR_CAS_8
-#define CK_F_PR_CAS_8_VALUE
-#define CK_F_PR_CAS_CHAR
-#define CK_F_PR_CAS_CHAR_VALUE
-#define CK_F_PR_CAS_INT
-#define CK_F_PR_CAS_INT_VALUE
-#define CK_F_PR_CAS_PTR
-#define CK_F_PR_CAS_PTR_VALUE
-#define CK_F_PR_CAS_UINT
-#define CK_F_PR_CAS_UINT_VALUE
-#define CK_F_PR_DEC_16
-#define CK_F_PR_DEC_32
-#define CK_F_PR_DEC_64
-#define CK_F_PR_DEC_8
-#define CK_F_PR_DEC_CHAR
-#define CK_F_PR_DEC_INT
-#define CK_F_PR_DEC_PTR
-#define CK_F_PR_DEC_UINT
-#define CK_F_PR_FAA_16
-#define CK_F_PR_FAA_32
-#define CK_F_PR_FAA_64
-#define CK_F_PR_FAA_8
-#define CK_F_PR_FAA_CHAR
-#define CK_F_PR_FAA_INT
-#define CK_F_PR_FAA_PTR
-#define CK_F_PR_FAA_UINT
-#define CK_F_PR_FENCE_LOAD
-#define CK_F_PR_FENCE_LOAD_DEPENDS
-#define CK_F_PR_FENCE_MEMORY
-#define CK_F_PR_FENCE_STORE
-#define CK_F_PR_FENCE_STRICT_LOAD
-#define CK_F_PR_FENCE_STRICT_MEMORY
-#define CK_F_PR_FENCE_STRICT_STORE
-#define CK_F_PR_INC_16
-#define CK_F_PR_INC_32
-#define CK_F_PR_INC_64
-#define CK_F_PR_INC_8
-#define CK_F_PR_INC_CHAR
-#define CK_F_PR_INC_INT
-#define CK_F_PR_INC_PTR
-#define CK_F_PR_INC_UINT
-#define CK_F_PR_LOAD_16
-#define CK_F_PR_LOAD_32
-#define CK_F_PR_LOAD_64
-#define CK_F_PR_LOAD_8
-#define CK_F_PR_LOAD_CHAR
-#define CK_F_PR_LOAD_INT
-#define CK_F_PR_LOAD_PTR
-#define CK_F_PR_LOAD_UINT
-#define CK_F_PR_OR_16
-#define CK_F_PR_OR_32
-#define CK_F_PR_OR_64
-#define CK_F_PR_OR_8
-#define CK_F_PR_OR_CHAR
-#define CK_F_PR_OR_INT
-#define CK_F_PR_OR_PTR
-#define CK_F_PR_OR_UINT
-#define CK_F_PR_STALL
-#define CK_F_PR_STORE_16
-#define CK_F_PR_STORE_32
-#define CK_F_PR_STORE_64
-#define CK_F_PR_STORE_8
-#define CK_F_PR_STORE_CHAR
-#define CK_F_PR_STORE_INT
-#define CK_F_PR_STORE_PTR
-#define CK_F_PR_STORE_UINT
-#define CK_F_PR_SUB_16
-#define CK_F_PR_SUB_32
-#define CK_F_PR_SUB_64
-#define CK_F_PR_SUB_8
-#define CK_F_PR_SUB_CHAR
-#define CK_F_PR_SUB_INT
-#define CK_F_PR_SUB_PTR
-#define CK_F_PR_SUB_UINT
-#define CK_F_PR_XOR_16
-#define CK_F_PR_XOR_32
-#define CK_F_PR_XOR_64
-#define CK_F_PR_XOR_8
-#define CK_F_PR_XOR_CHAR
-#define CK_F_PR_XOR_INT
-#define CK_F_PR_XOR_PTR
-#define CK_F_PR_XOR_UINT
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/ck_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/ck_pr.h b/lib/ck/include/gcc/ck_pr.h
deleted file mode 100644
index 6ebadd8..0000000
--- a/lib/ck/include/gcc/ck_pr.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright 2010 Samy Al Bahra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_PR_GCC_H
-#define _CK_PR_GCC_H
-
-#ifndef _CK_PR_H
-#error Do not include this file directly, use ck_pr.h
-#endif
-
-#include <ck_cc.h>
-
-CK_CC_INLINE static void
-ck_pr_barrier(void)
-{
-
- __asm__ __volatile__("" ::: "memory");
- return;
-}
-
-#ifndef CK_F_PR
-#define CK_F_PR
-
-#include <stdbool.h>
-#include <ck_stdint.h>
-
-/*
- * The following represent supported atomic operations.
- * These operations may be emulated.
- */
-#include "ck_f_pr.h"
-
-#define CK_PR_ACCESS(x) (*(volatile typeof(x) *)&(x))
-
-#define CK_PR_LOAD(S, M, T) \
- CK_CC_INLINE static T \
- ck_pr_load_##S(const M *target) \
- { \
- T r; \
- r = CK_PR_ACCESS(*(T *)target); \
- return (r); \
- } \
- CK_CC_INLINE static void \
- ck_pr_store_##S(M *target, T v) \
- { \
- CK_PR_ACCESS(*(T *)target) = v; \
- return; \
- }
-
-CK_CC_INLINE static void *
-ck_pr_load_ptr(const void *target)
-{
-
- return CK_PR_ACCESS(*(void **)target);
-}
-
-CK_CC_INLINE static void
-ck_pr_store_ptr(void *target, const void *v)
-{
-
- CK_PR_ACCESS(*(void **)target) = (void *)v;
- return;
-}
-
-#define CK_PR_LOAD_S(S, T) CK_PR_LOAD(S, T, T)
-
-CK_PR_LOAD_S(char, char)
-CK_PR_LOAD_S(uint, unsigned int)
-CK_PR_LOAD_S(int, int)
-CK_PR_LOAD_S(double, double)
-CK_PR_LOAD_S(64, uint64_t)
-CK_PR_LOAD_S(32, uint32_t)
-CK_PR_LOAD_S(16, uint16_t)
-CK_PR_LOAD_S(8, uint8_t)
-
-#undef CK_PR_LOAD_S
-#undef CK_PR_LOAD
-
-CK_CC_INLINE static void
-ck_pr_stall(void)
-{
- return;
-}
-
-/*
- * Load and store fences are equivalent to full fences in the GCC port.
- */
-#define CK_PR_FENCE(T) \
- CK_CC_INLINE static void \
- ck_pr_fence_strict_##T(void) \
- { \
- __sync_synchronize(); \
- }
-
-CK_PR_FENCE(atomic)
-CK_PR_FENCE(atomic_atomic)
-CK_PR_FENCE(atomic_load)
-CK_PR_FENCE(atomic_store)
-CK_PR_FENCE(store_atomic)
-CK_PR_FENCE(load_atomic)
-CK_PR_FENCE(load)
-CK_PR_FENCE(load_load)
-CK_PR_FENCE(load_store)
-CK_PR_FENCE(store)
-CK_PR_FENCE(store_store)
-CK_PR_FENCE(store_load)
-CK_PR_FENCE(memory)
-CK_PR_FENCE(acquire)
-CK_PR_FENCE(release)
-
-#undef CK_PR_FENCE
-
-/*
- * Atomic compare and swap.
- */
-#define CK_PR_CAS(S, M, T) \
- CK_CC_INLINE static bool \
- ck_pr_cas_##S(M *target, T compare, T set) \
- { \
- bool z; \
- z = __sync_bool_compare_and_swap((T *)target, compare, set); \
- return z; \
- }
-
-CK_PR_CAS(ptr, void, void *)
-
-#define CK_PR_CAS_S(S, T) CK_PR_CAS(S, T, T)
-
-CK_PR_CAS_S(char, char)
-CK_PR_CAS_S(int, int)
-CK_PR_CAS_S(uint, unsigned int)
-CK_PR_CAS_S(64, uint64_t)
-CK_PR_CAS_S(32, uint32_t)
-CK_PR_CAS_S(16, uint16_t)
-CK_PR_CAS_S(8, uint8_t)
-
-#undef CK_PR_CAS_S
-#undef CK_PR_CAS
-
-/*
- * Compare and swap, set *v to old value of target.
- */
-CK_CC_INLINE static bool
-ck_pr_cas_ptr_value(void *target, void *compare, void *set, void *v)
-{
- set = __sync_val_compare_and_swap((void **)target, compare, set);
- *(void **)v = set;
- return (set == compare);
-}
-
-#define CK_PR_CAS_O(S, T) \
- CK_CC_INLINE static bool \
- ck_pr_cas_##S##_value(T *target, T compare, T set, T *v) \
- { \
- set = __sync_val_compare_and_swap(target, compare, set);\
- *v = set; \
- return (set == compare); \
- }
-
-CK_PR_CAS_O(char, char)
-CK_PR_CAS_O(int, int)
-CK_PR_CAS_O(uint, unsigned int)
-CK_PR_CAS_O(64, uint64_t)
-CK_PR_CAS_O(32, uint32_t)
-CK_PR_CAS_O(16, uint16_t)
-CK_PR_CAS_O(8, uint8_t)
-
-#undef CK_PR_CAS_O
-
-/*
- * Atomic fetch-and-add operations.
- */
-#define CK_PR_FAA(S, M, T) \
- CK_CC_INLINE static T \
- ck_pr_faa_##S(M *target, T d) \
- { \
- d = __sync_fetch_and_add((T *)target, d); \
- return (d); \
- }
-
-CK_PR_FAA(ptr, void, void *)
-
-#define CK_PR_FAA_S(S, T) CK_PR_FAA(S, T, T)
-
-CK_PR_FAA_S(char, char)
-CK_PR_FAA_S(uint, unsigned int)
-CK_PR_FAA_S(int, int)
-CK_PR_FAA_S(64, uint64_t)
-CK_PR_FAA_S(32, uint32_t)
-CK_PR_FAA_S(16, uint16_t)
-CK_PR_FAA_S(8, uint8_t)
-
-#undef CK_PR_FAA_S
-#undef CK_PR_FAA
-
-/*
- * Atomic store-only binary operations.
- */
-#define CK_PR_BINARY(K, S, M, T) \
- CK_CC_INLINE static void \
- ck_pr_##K##_##S(M *target, T d) \
- { \
- d = __sync_fetch_and_##K((T *)target, d); \
- return; \
- }
-
-#define CK_PR_BINARY_S(K, S, T) CK_PR_BINARY(K, S, T, T)
-
-#define CK_PR_GENERATE(K) \
- CK_PR_BINARY(K, ptr, void, void *) \
- CK_PR_BINARY_S(K, char, char) \
- CK_PR_BINARY_S(K, int, int) \
- CK_PR_BINARY_S(K, uint, unsigned int) \
- CK_PR_BINARY_S(K, 64, uint64_t) \
- CK_PR_BINARY_S(K, 32, uint32_t) \
- CK_PR_BINARY_S(K, 16, uint16_t) \
- CK_PR_BINARY_S(K, 8, uint8_t)
-
-CK_PR_GENERATE(add)
-CK_PR_GENERATE(sub)
-CK_PR_GENERATE(and)
-CK_PR_GENERATE(or)
-CK_PR_GENERATE(xor)
-
-#undef CK_PR_GENERATE
-#undef CK_PR_BINARY_S
-#undef CK_PR_BINARY
-
-#define CK_PR_UNARY(S, M, T) \
- CK_CC_INLINE static void \
- ck_pr_inc_##S(M *target) \
- { \
- ck_pr_add_##S(target, (T)1); \
- return; \
- } \
- CK_CC_INLINE static void \
- ck_pr_dec_##S(M *target) \
- { \
- ck_pr_sub_##S(target, (T)1); \
- return; \
- }
-
-#define CK_PR_UNARY_S(S, M) CK_PR_UNARY(S, M, M)
-
-CK_PR_UNARY(ptr, void, void *)
-CK_PR_UNARY_S(char, char)
-CK_PR_UNARY_S(int, int)
-CK_PR_UNARY_S(uint, unsigned int)
-CK_PR_UNARY_S(64, uint64_t)
-CK_PR_UNARY_S(32, uint32_t)
-CK_PR_UNARY_S(16, uint16_t)
-CK_PR_UNARY_S(8, uint8_t)
-
-#undef CK_PR_UNARY_S
-#undef CK_PR_UNARY
-#endif /* !CK_F_PR */
-#endif /* _CK_PR_GCC_H */
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/ppc/ck_f_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/ppc/ck_f_pr.h b/lib/ck/include/gcc/ppc/ck_f_pr.h
deleted file mode 100644
index 0aec33e..0000000
--- a/lib/ck/include/gcc/ppc/ck_f_pr.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* DO NOT EDIT. This is auto-generated from feature.sh */
-#define CK_F_PR_ADD_32
-#define CK_F_PR_ADD_INT
-#define CK_F_PR_ADD_PTR
-#define CK_F_PR_ADD_UINT
-#define CK_F_PR_AND_32
-#define CK_F_PR_AND_INT
-#define CK_F_PR_AND_PTR
-#define CK_F_PR_AND_UINT
-#define CK_F_PR_CAS_32
-#define CK_F_PR_CAS_32_VALUE
-#define CK_F_PR_CAS_INT
-#define CK_F_PR_CAS_INT_VALUE
-#define CK_F_PR_CAS_PTR
-#define CK_F_PR_CAS_PTR_VALUE
-#define CK_F_PR_CAS_UINT
-#define CK_F_PR_CAS_UINT_VALUE
-#define CK_F_PR_DEC_32
-#define CK_F_PR_DEC_INT
-#define CK_F_PR_DEC_PTR
-#define CK_F_PR_DEC_UINT
-#define CK_F_PR_FAA_32
-#define CK_F_PR_FAA_INT
-#define CK_F_PR_FAA_PTR
-#define CK_F_PR_FAA_UINT
-#define CK_F_PR_FAS_32
-#define CK_F_PR_FAS_INT
-#define CK_F_PR_FAS_PTR
-#define CK_F_PR_FAS_UINT
-#define CK_F_PR_FENCE_LOAD
-#define CK_F_PR_FENCE_LOAD_DEPENDS
-#define CK_F_PR_FENCE_MEMORY
-#define CK_F_PR_FENCE_STORE
-#define CK_F_PR_FENCE_STRICT_LOAD
-#define CK_F_PR_FENCE_STRICT_LOAD_DEPENDS
-#define CK_F_PR_FENCE_STRICT_MEMORY
-#define CK_F_PR_FENCE_STRICT_STORE
-#define CK_F_PR_INC_32
-#define CK_F_PR_INC_INT
-#define CK_F_PR_INC_PTR
-#define CK_F_PR_INC_UINT
-#define CK_F_PR_LOAD_16
-#define CK_F_PR_LOAD_32
-#define CK_F_PR_LOAD_8
-#define CK_F_PR_LOAD_CHAR
-#define CK_F_PR_LOAD_INT
-#define CK_F_PR_LOAD_PTR
-#define CK_F_PR_LOAD_SHORT
-#define CK_F_PR_LOAD_UINT
-#define CK_F_PR_NEG_32
-#define CK_F_PR_NEG_INT
-#define CK_F_PR_NEG_PTR
-#define CK_F_PR_NEG_UINT
-#define CK_F_PR_NOT_32
-#define CK_F_PR_NOT_INT
-#define CK_F_PR_NOT_PTR
-#define CK_F_PR_NOT_UINT
-#define CK_F_PR_OR_32
-#define CK_F_PR_OR_INT
-#define CK_F_PR_OR_PTR
-#define CK_F_PR_OR_UINT
-#define CK_F_PR_STALL
-#define CK_F_PR_STORE_16
-#define CK_F_PR_STORE_32
-#define CK_F_PR_STORE_8
-#define CK_F_PR_STORE_CHAR
-#define CK_F_PR_STORE_INT
-#define CK_F_PR_STORE_PTR
-#define CK_F_PR_STORE_SHORT
-#define CK_F_PR_STORE_UINT
-#define CK_F_PR_SUB_32
-#define CK_F_PR_SUB_INT
-#define CK_F_PR_SUB_PTR
-#define CK_F_PR_SUB_UINT
-#define CK_F_PR_XOR_32
-#define CK_F_PR_XOR_INT
-#define CK_F_PR_XOR_PTR
-#define CK_F_PR_XOR_UINT
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/ppc/ck_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/ppc/ck_pr.h b/lib/ck/include/gcc/ppc/ck_pr.h
deleted file mode 100644
index a1b98f5..0000000
--- a/lib/ck/include/gcc/ppc/ck_pr.h
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright 2009-2014 Samy Al Bahra.
- * Copyright 2012 João Fernandes.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_PR_PPC_H
-#define _CK_PR_PPC_H
-
-#ifndef _CK_PR_H
-#error Do not include this file directly, use ck_pr.h
-#endif
-
-#include <ck_cc.h>
-#include <ck_md.h>
-
-/*
- * The following represent supported atomic operations.
- * These operations may be emulated.
- */
-#include "ck_f_pr.h"
-
-/*
- * Minimum interface requirement met.
- */
-#define CK_F_PR
-
-/*
- * This bounces the hardware thread from low to medium
- * priority. I am unsure of the benefits of this approach
- * but it is used by the Linux kernel.
- */
-CK_CC_INLINE static void
-ck_pr_stall(void)
-{
-
- __asm__ __volatile__("or 1, 1, 1;"
- "or 2, 2, 2;" ::: "memory");
- return;
-}
-
-#define CK_PR_FENCE(T, I) \
- CK_CC_INLINE static void \
- ck_pr_fence_strict_##T(void) \
- { \
- __asm__ __volatile__(I ::: "memory"); \
- }
-
-CK_PR_FENCE(atomic, "lwsync")
-CK_PR_FENCE(atomic_store, "lwsync")
-CK_PR_FENCE(atomic_load, "sync")
-CK_PR_FENCE(store_atomic, "lwsync")
-CK_PR_FENCE(load_atomic, "lwsync")
-CK_PR_FENCE(store, "lwsync")
-CK_PR_FENCE(store_load, "sync")
-CK_PR_FENCE(load, "lwsync")
-CK_PR_FENCE(load_store, "lwsync")
-CK_PR_FENCE(memory, "sync")
-CK_PR_FENCE(acquire, "lwsync")
-CK_PR_FENCE(release, "lwsync")
-
-#undef CK_PR_FENCE
-
-#define CK_PR_LOAD(S, M, T, C, I) \
- CK_CC_INLINE static T \
- ck_pr_load_##S(const M *target) \
- { \
- T r; \
- __asm__ __volatile__(I "%U1%X1 %0, %1" \
- : "=r" (r) \
- : "m" (*(C *)target) \
- : "memory"); \
- return (r); \
- }
-
-CK_PR_LOAD(ptr, void, void *, uint32_t, "lwz")
-
-#define CK_PR_LOAD_S(S, T, I) CK_PR_LOAD(S, T, T, T, I)
-
-CK_PR_LOAD_S(32, uint32_t, "lwz")
-CK_PR_LOAD_S(16, uint16_t, "lhz")
-CK_PR_LOAD_S(8, uint8_t, "lbz")
-CK_PR_LOAD_S(uint, unsigned int, "lwz")
-CK_PR_LOAD_S(int, int, "lwz")
-CK_PR_LOAD_S(short, short, "lhz")
-CK_PR_LOAD_S(char, char, "lbz")
-
-#undef CK_PR_LOAD_S
-#undef CK_PR_LOAD
-
-#define CK_PR_STORE(S, M, T, C, I) \
- CK_CC_INLINE static void \
- ck_pr_store_##S(M *target, T v) \
- { \
- __asm__ __volatile__(I "%U0%X0 %1, %0" \
- : "=m" (*(C *)target) \
- : "r" (v) \
- : "memory"); \
- return; \
- }
-
-CK_PR_STORE(ptr, void, const void *, uint32_t, "stw")
-
-#define CK_PR_STORE_S(S, T, I) CK_PR_STORE(S, T, T, T, I)
-
-CK_PR_STORE_S(32, uint32_t, "stw")
-CK_PR_STORE_S(16, uint16_t, "sth")
-CK_PR_STORE_S(8, uint8_t, "stb")
-CK_PR_STORE_S(uint, unsigned int, "stw")
-CK_PR_STORE_S(int, int, "stw")
-CK_PR_STORE_S(short, short, "sth")
-CK_PR_STORE_S(char, char, "stb")
-
-#undef CK_PR_STORE_S
-#undef CK_PR_STORE
-
-#define CK_PR_CAS(N, T) \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N##_value(T *target, T compare, T set, T *value) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "lwarx %0, 0, %1;" \
- "cmpw 0, %0, %3;" \
- "bne- 2f;" \
- "stwcx. %2, 0, %1;" \
- "bne- 1b;" \
- "2:" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (set), \
- "r" (compare) \
- : "memory", "cc"); \
- *value = previous; \
- return (previous == compare); \
- } \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N(T *target, T compare, T set) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "lwarx %0, 0, %1;" \
- "cmpw 0, %0, %3;" \
- "bne- 2f;" \
- "stwcx. %2, 0, %1;" \
- "bne- 1b;" \
- "2:" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (set), \
- "r" (compare) \
- : "memory", "cc"); \
- return (previous == compare); \
- }
-
-CK_PR_CAS(ptr, void *)
-CK_PR_CAS(32, uint32_t)
-CK_PR_CAS(uint, unsigned int)
-CK_PR_CAS(int, int)
-
-#undef CK_PR_CAS
-
-#define CK_PR_FAS(N, M, T, W) \
- CK_CC_INLINE static T \
- ck_pr_fas_##N(M *target, T v) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %1;" \
- "st" W "cx. %2, 0, %1;" \
- "bne- 1b;" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (v) \
- : "memory", "cc"); \
- return (previous); \
- }
-
-CK_PR_FAS(32, uint32_t, uint32_t, "w")
-CK_PR_FAS(ptr, void, void *, "w")
-CK_PR_FAS(int, int, int, "w")
-CK_PR_FAS(uint, unsigned int, unsigned int, "w")
-
-#undef CK_PR_FAS
-
-#define CK_PR_UNARY(O, N, M, T, I, W) \
- CK_CC_INLINE static void \
- ck_pr_##O##_##N(M *target) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %1;" \
- I ";" \
- "st" W "cx. %0, 0, %1;" \
- "bne- 1b;" \
- : "=&r" (previous) \
- : "r" (target) \
- : "memory", "cc"); \
- return; \
- }
-
-CK_PR_UNARY(inc, ptr, void, void *, "addic %0, %0, 1", "w")
-CK_PR_UNARY(dec, ptr, void, void *, "addic %0, %0, -1", "w")
-CK_PR_UNARY(not, ptr, void, void *, "not %0, %0", "w")
-CK_PR_UNARY(neg, ptr, void, void *, "neg %0, %0", "w")
-
-#define CK_PR_UNARY_S(S, T, W) \
- CK_PR_UNARY(inc, S, T, T, "addic %0, %0, 1", W) \
- CK_PR_UNARY(dec, S, T, T, "addic %0, %0, -1", W) \
- CK_PR_UNARY(not, S, T, T, "not %0, %0", W) \
- CK_PR_UNARY(neg, S, T, T, "neg %0, %0", W)
-
-CK_PR_UNARY_S(32, uint32_t, "w")
-CK_PR_UNARY_S(uint, unsigned int, "w")
-CK_PR_UNARY_S(int, int, "w")
-
-#undef CK_PR_UNARY_S
-#undef CK_PR_UNARY
-
-#define CK_PR_BINARY(O, N, M, T, I, W) \
- CK_CC_INLINE static void \
- ck_pr_##O##_##N(M *target, T delta) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %1;" \
- I " %0, %2, %0;" \
- "st" W "cx. %0, 0, %1;" \
- "bne- 1b;" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (delta) \
- : "memory", "cc"); \
- return; \
- }
-
-CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "w")
-CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "w")
-CK_PR_BINARY(or, ptr, void, uintptr_t, "or", "w")
-CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "w")
-CK_PR_BINARY(xor, ptr, void, uintptr_t, "xor", "w")
-
-#define CK_PR_BINARY_S(S, T, W) \
- CK_PR_BINARY(and, S, T, T, "and", W) \
- CK_PR_BINARY(add, S, T, T, "add", W) \
- CK_PR_BINARY(or, S, T, T, "or", W) \
- CK_PR_BINARY(sub, S, T, T, "subf", W) \
- CK_PR_BINARY(xor, S, T, T, "xor", W)
-
-CK_PR_BINARY_S(32, uint32_t, "w")
-CK_PR_BINARY_S(uint, unsigned int, "w")
-CK_PR_BINARY_S(int, int, "w")
-
-#undef CK_PR_BINARY_S
-#undef CK_PR_BINARY
-
-CK_CC_INLINE static void *
-ck_pr_faa_ptr(void *target, uintptr_t delta)
-{
- uintptr_t previous, r;
-
- __asm__ __volatile__("1:"
- "lwarx %0, 0, %2;"
- "add %1, %3, %0;"
- "stwcx. %1, 0, %2;"
- "bne- 1b;"
- : "=&r" (previous),
- "=&r" (r)
- : "r" (target),
- "r" (delta)
- : "memory", "cc");
-
- return (void *)(previous);
-}
-
-#define CK_PR_FAA(S, T, W) \
- CK_CC_INLINE static T \
- ck_pr_faa_##S(T *target, T delta) \
- { \
- T previous, r; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %2;" \
- "add %1, %3, %0;" \
- "st" W "cx. %1, 0, %2;" \
- "bne- 1b;" \
- : "=&r" (previous), \
- "=&r" (r) \
- : "r" (target), \
- "r" (delta) \
- : "memory", "cc"); \
- return (previous); \
- }
-
-CK_PR_FAA(32, uint32_t, "w")
-CK_PR_FAA(uint, unsigned int, "w")
-CK_PR_FAA(int, int, "w")
-
-#undef CK_PR_FAA
-
-#endif /* _CK_PR_PPC_H */
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/ppc64/ck_f_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/ppc64/ck_f_pr.h b/lib/ck/include/gcc/ppc64/ck_f_pr.h
deleted file mode 100644
index cd54a28..0000000
--- a/lib/ck/include/gcc/ppc64/ck_f_pr.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* DO NOT EDIT. This is auto-generated from feature.sh */
-#define CK_F_PR_ADD_32
-#define CK_F_PR_ADD_64
-#define CK_F_PR_ADD_INT
-#define CK_F_PR_ADD_PTR
-#define CK_F_PR_ADD_UINT
-#define CK_F_PR_AND_32
-#define CK_F_PR_AND_64
-#define CK_F_PR_AND_INT
-#define CK_F_PR_AND_PTR
-#define CK_F_PR_AND_UINT
-#define CK_F_PR_CAS_32
-#define CK_F_PR_CAS_32_VALUE
-#define CK_F_PR_CAS_64
-#define CK_F_PR_CAS_64_VALUE
-#define CK_F_PR_CAS_INT
-#define CK_F_PR_CAS_INT_VALUE
-#define CK_F_PR_CAS_PTR
-#define CK_F_PR_CAS_PTR_VALUE
-#define CK_F_PR_CAS_UINT
-#define CK_F_PR_CAS_UINT_VALUE
-#define CK_F_PR_DEC_32
-#define CK_F_PR_DEC_64
-#define CK_F_PR_DEC_INT
-#define CK_F_PR_DEC_PTR
-#define CK_F_PR_DEC_UINT
-#define CK_F_PR_FAA_32
-#define CK_F_PR_FAA_64
-#define CK_F_PR_FAA_INT
-#define CK_F_PR_FAA_PTR
-#define CK_F_PR_FAA_UINT
-#define CK_F_PR_FAS_32
-#define CK_F_PR_FAS_64
-#define CK_F_PR_FAS_INT
-#define CK_F_PR_FAS_PTR
-#define CK_F_PR_FAS_UINT
-#define CK_F_PR_FAS_DOUBLE
-#define CK_F_PR_FENCE_LOAD
-#define CK_F_PR_FENCE_LOAD_DEPENDS
-#define CK_F_PR_FENCE_MEMORY
-#define CK_F_PR_FENCE_STORE
-#define CK_F_PR_FENCE_STRICT_LOAD
-#define CK_F_PR_FENCE_STRICT_LOAD_DEPENDS
-#define CK_F_PR_FENCE_STRICT_MEMORY
-#define CK_F_PR_FENCE_STRICT_STORE
-#define CK_F_PR_INC_32
-#define CK_F_PR_INC_64
-#define CK_F_PR_INC_INT
-#define CK_F_PR_INC_PTR
-#define CK_F_PR_INC_UINT
-#define CK_F_PR_LOAD_16
-#define CK_F_PR_LOAD_32
-#define CK_F_PR_LOAD_64
-#define CK_F_PR_LOAD_8
-#define CK_F_PR_LOAD_CHAR
-#define CK_F_PR_LOAD_DOUBLE
-#define CK_F_PR_LOAD_INT
-#define CK_F_PR_LOAD_PTR
-#define CK_F_PR_LOAD_SHORT
-#define CK_F_PR_LOAD_UINT
-#define CK_F_PR_NEG_32
-#define CK_F_PR_NEG_64
-#define CK_F_PR_NEG_INT
-#define CK_F_PR_NEG_PTR
-#define CK_F_PR_NEG_UINT
-#define CK_F_PR_NOT_32
-#define CK_F_PR_NOT_64
-#define CK_F_PR_NOT_INT
-#define CK_F_PR_NOT_PTR
-#define CK_F_PR_NOT_UINT
-#define CK_F_PR_OR_32
-#define CK_F_PR_OR_64
-#define CK_F_PR_OR_INT
-#define CK_F_PR_OR_PTR
-#define CK_F_PR_OR_UINT
-#define CK_F_PR_STALL
-#define CK_F_PR_STORE_16
-#define CK_F_PR_STORE_32
-#define CK_F_PR_STORE_64
-#define CK_F_PR_STORE_8
-#define CK_F_PR_STORE_CHAR
-#define CK_F_PR_STORE_DOUBLE
-#define CK_F_PR_STORE_INT
-#define CK_F_PR_STORE_PTR
-#define CK_F_PR_STORE_SHORT
-#define CK_F_PR_STORE_UINT
-#define CK_F_PR_SUB_32
-#define CK_F_PR_SUB_64
-#define CK_F_PR_SUB_INT
-#define CK_F_PR_SUB_PTR
-#define CK_F_PR_SUB_UINT
-#define CK_F_PR_XOR_32
-#define CK_F_PR_XOR_64
-#define CK_F_PR_XOR_INT
-#define CK_F_PR_XOR_PTR
-#define CK_F_PR_XOR_UINT
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/ppc64/ck_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/ppc64/ck_pr.h b/lib/ck/include/gcc/ppc64/ck_pr.h
deleted file mode 100644
index 69da1b9..0000000
--- a/lib/ck/include/gcc/ppc64/ck_pr.h
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright 2009-2014 Samy Al Bahra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_PR_PPC64_H
-#define _CK_PR_PPC64_H
-
-#ifndef _CK_PR_H
-#error Do not include this file directly, use ck_pr.h
-#endif
-
-#include <ck_cc.h>
-#include <ck_md.h>
-
-/*
- * The following represent supported atomic operations.
- * These operations may be emulated.
- */
-#include "ck_f_pr.h"
-
-/*
- * Minimum interface requirement met.
- */
-#define CK_F_PR
-
-/*
- * This bounces the hardware thread from low to medium
- * priority. I am unsure of the benefits of this approach
- * but it is used by the Linux kernel.
- */
-CK_CC_INLINE static void
-ck_pr_stall(void)
-{
-
- __asm__ __volatile__("or 1, 1, 1;"
- "or 2, 2, 2;" ::: "memory");
- return;
-}
-
-#define CK_PR_FENCE(T, I) \
- CK_CC_INLINE static void \
- ck_pr_fence_strict_##T(void) \
- { \
- __asm__ __volatile__(I ::: "memory"); \
- }
-
-/*
- * These are derived from:
- * http://www.ibm.com/developerworks/systems/articles/powerpc.html
- */
-CK_PR_FENCE(atomic, "lwsync")
-CK_PR_FENCE(atomic_store, "lwsync")
-CK_PR_FENCE(atomic_load, "sync")
-CK_PR_FENCE(store_atomic, "lwsync")
-CK_PR_FENCE(load_atomic, "lwsync")
-CK_PR_FENCE(store, "lwsync")
-CK_PR_FENCE(store_load, "sync")
-CK_PR_FENCE(load, "lwsync")
-CK_PR_FENCE(load_store, "lwsync")
-CK_PR_FENCE(memory, "sync")
-CK_PR_FENCE(acquire, "lwsync")
-CK_PR_FENCE(release, "lwsync")
-
-#undef CK_PR_FENCE
-
-#define CK_PR_LOAD(S, M, T, C, I) \
- CK_CC_INLINE static T \
- ck_pr_load_##S(const M *target) \
- { \
- T r; \
- __asm__ __volatile__(I "%U1%X1 %0, %1" \
- : "=r" (r) \
- : "m" (*(C *)target) \
- : "memory"); \
- return (r); \
- }
-
-CK_PR_LOAD(ptr, void, void *, uint64_t, "ld")
-
-#define CK_PR_LOAD_S(S, T, I) CK_PR_LOAD(S, T, T, T, I)
-
-CK_PR_LOAD_S(64, uint64_t, "ld")
-CK_PR_LOAD_S(32, uint32_t, "lwz")
-CK_PR_LOAD_S(16, uint16_t, "lhz")
-CK_PR_LOAD_S(8, uint8_t, "lbz")
-CK_PR_LOAD_S(uint, unsigned int, "lwz")
-CK_PR_LOAD_S(int, int, "lwz")
-CK_PR_LOAD_S(short, short, "lhz")
-CK_PR_LOAD_S(char, char, "lbz")
-CK_PR_LOAD_S(double, double, "ld")
-
-#undef CK_PR_LOAD_S
-#undef CK_PR_LOAD
-
-#define CK_PR_STORE(S, M, T, C, I) \
- CK_CC_INLINE static void \
- ck_pr_store_##S(M *target, T v) \
- { \
- __asm__ __volatile__(I "%U0%X0 %1, %0" \
- : "=m" (*(C *)target) \
- : "r" (v) \
- : "memory"); \
- return; \
- }
-
-CK_PR_STORE(ptr, void, const void *, uint64_t, "std")
-
-#define CK_PR_STORE_S(S, T, I) CK_PR_STORE(S, T, T, T, I)
-
-CK_PR_STORE_S(64, uint64_t, "std")
-CK_PR_STORE_S(32, uint32_t, "stw")
-CK_PR_STORE_S(16, uint16_t, "sth")
-CK_PR_STORE_S(8, uint8_t, "stb")
-CK_PR_STORE_S(uint, unsigned int, "stw")
-CK_PR_STORE_S(int, int, "stw")
-CK_PR_STORE_S(short, short, "sth")
-CK_PR_STORE_S(char, char, "stb")
-CK_PR_STORE_S(double, double, "std")
-
-#undef CK_PR_STORE_S
-#undef CK_PR_STORE
-
-CK_CC_INLINE static bool
-ck_pr_cas_64_value(uint64_t *target, uint64_t compare, uint64_t set, uint64_t *value)
-{
- uint64_t previous;
-
- __asm__ __volatile__("1:"
- "ldarx %0, 0, %1;"
- "cmpd 0, %0, %3;"
- "bne- 2f;"
- "stdcx. %2, 0, %1;"
- "bne- 1b;"
- "2:"
- : "=&r" (previous)
- : "r" (target),
- "r" (set),
- "r" (compare)
- : "memory", "cc");
-
- *value = previous;
- return (previous == compare);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr_value(void *target, void *compare, void *set, void *value)
-{
- void *previous;
-
- __asm__ __volatile__("1:"
- "ldarx %0, 0, %1;"
- "cmpd 0, %0, %3;"
- "bne- 2f;"
- "stdcx. %2, 0, %1;"
- "bne- 1b;"
- "2:"
- : "=&r" (previous)
- : "r" (target),
- "r" (set),
- "r" (compare)
- : "memory", "cc");
-
- ck_pr_store_ptr(value, previous);
- return (previous == compare);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_64(uint64_t *target, uint64_t compare, uint64_t set)
-{
- uint64_t previous;
-
- __asm__ __volatile__("1:"
- "ldarx %0, 0, %1;"
- "cmpd 0, %0, %3;"
- "bne- 2f;"
- "stdcx. %2, 0, %1;"
- "bne- 1b;"
- "2:"
- : "=&r" (previous)
- : "r" (target),
- "r" (set),
- "r" (compare)
- : "memory", "cc");
-
- return (previous == compare);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr(void *target, void *compare, void *set)
-{
- void *previous;
-
- __asm__ __volatile__("1:"
- "ldarx %0, 0, %1;"
- "cmpd 0, %0, %3;"
- "bne- 2f;"
- "stdcx. %2, 0, %1;"
- "bne- 1b;"
- "2:"
- : "=&r" (previous)
- : "r" (target),
- "r" (set),
- "r" (compare)
- : "memory", "cc");
-
- return (previous == compare);
-}
-
-#define CK_PR_CAS(N, T) \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N##_value(T *target, T compare, T set, T *value) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "lwarx %0, 0, %1;" \
- "cmpw 0, %0, %3;" \
- "bne- 2f;" \
- "stwcx. %2, 0, %1;" \
- "bne- 1b;" \
- "2:" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (set), \
- "r" (compare) \
- : "memory", "cc"); \
- *value = previous; \
- return (previous == compare); \
- } \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N(T *target, T compare, T set) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "lwarx %0, 0, %1;" \
- "cmpw 0, %0, %3;" \
- "bne- 2f;" \
- "stwcx. %2, 0, %1;" \
- "bne- 1b;" \
- "2:" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (set), \
- "r" (compare) \
- : "memory", "cc"); \
- return (previous == compare); \
- }
-
-CK_PR_CAS(32, uint32_t)
-CK_PR_CAS(uint, unsigned int)
-CK_PR_CAS(int, int)
-
-#undef CK_PR_CAS
-
-#define CK_PR_FAS(N, M, T, W) \
- CK_CC_INLINE static T \
- ck_pr_fas_##N(M *target, T v) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %1;" \
- "st" W "cx. %2, 0, %1;" \
- "bne- 1b;" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (v) \
- : "memory", "cc"); \
- return (previous); \
- }
-
-CK_PR_FAS(64, uint64_t, uint64_t, "d")
-CK_PR_FAS(32, uint32_t, uint32_t, "w")
-CK_PR_FAS(double, double, double, "d")
-CK_PR_FAS(ptr, void, void *, "d")
-CK_PR_FAS(int, int, int, "w")
-CK_PR_FAS(uint, unsigned int, unsigned int, "w")
-
-#undef CK_PR_FAS
-
-#define CK_PR_UNARY(O, N, M, T, I, W) \
- CK_CC_INLINE static void \
- ck_pr_##O##_##N(M *target) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %1;" \
- I ";" \
- "st" W "cx. %0, 0, %1;" \
- "bne- 1b;" \
- : "=&r" (previous) \
- : "r" (target) \
- : "memory", "cc"); \
- return; \
- }
-
-CK_PR_UNARY(inc, ptr, void, void *, "addic %0, %0, 1", "d")
-CK_PR_UNARY(dec, ptr, void, void *, "addic %0, %0, -1", "d")
-CK_PR_UNARY(not, ptr, void, void *, "not %0, %0", "d")
-CK_PR_UNARY(neg, ptr, void, void *, "neg %0, %0", "d")
-
-#define CK_PR_UNARY_S(S, T, W) \
- CK_PR_UNARY(inc, S, T, T, "addic %0, %0, 1", W) \
- CK_PR_UNARY(dec, S, T, T, "addic %0, %0, -1", W) \
- CK_PR_UNARY(not, S, T, T, "not %0, %0", W) \
- CK_PR_UNARY(neg, S, T, T, "neg %0, %0", W)
-
-CK_PR_UNARY_S(64, uint64_t, "d")
-CK_PR_UNARY_S(32, uint32_t, "w")
-CK_PR_UNARY_S(uint, unsigned int, "w")
-CK_PR_UNARY_S(int, int, "w")
-
-#undef CK_PR_UNARY_S
-#undef CK_PR_UNARY
-
-#define CK_PR_BINARY(O, N, M, T, I, W) \
- CK_CC_INLINE static void \
- ck_pr_##O##_##N(M *target, T delta) \
- { \
- T previous; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %1;" \
- I " %0, %2, %0;" \
- "st" W "cx. %0, 0, %1;" \
- "bne- 1b;" \
- : "=&r" (previous) \
- : "r" (target), \
- "r" (delta) \
- : "memory", "cc"); \
- return; \
- }
-
-CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "d")
-CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "d")
-CK_PR_BINARY(or, ptr, void, uintptr_t, "or", "d")
-CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "d")
-CK_PR_BINARY(xor, ptr, void, uintptr_t, "xor", "d")
-
-#define CK_PR_BINARY_S(S, T, W) \
- CK_PR_BINARY(and, S, T, T, "and", W) \
- CK_PR_BINARY(add, S, T, T, "add", W) \
- CK_PR_BINARY(or, S, T, T, "or", W) \
- CK_PR_BINARY(sub, S, T, T, "subf", W) \
- CK_PR_BINARY(xor, S, T, T, "xor", W)
-
-CK_PR_BINARY_S(64, uint64_t, "d")
-CK_PR_BINARY_S(32, uint32_t, "w")
-CK_PR_BINARY_S(uint, unsigned int, "w")
-CK_PR_BINARY_S(int, int, "w")
-
-#undef CK_PR_BINARY_S
-#undef CK_PR_BINARY
-
-CK_CC_INLINE static void *
-ck_pr_faa_ptr(void *target, uintptr_t delta)
-{
- uintptr_t previous, r;
-
- __asm__ __volatile__("1:"
- "ldarx %0, 0, %2;"
- "add %1, %3, %0;"
- "stdcx. %1, 0, %2;"
- "bne- 1b;"
- : "=&r" (previous),
- "=&r" (r)
- : "r" (target),
- "r" (delta)
- : "memory", "cc");
-
- return (void *)(previous);
-}
-
-#define CK_PR_FAA(S, T, W) \
- CK_CC_INLINE static T \
- ck_pr_faa_##S(T *target, T delta) \
- { \
- T previous, r; \
- __asm__ __volatile__("1:" \
- "l" W "arx %0, 0, %2;" \
- "add %1, %3, %0;" \
- "st" W "cx. %1, 0, %2;" \
- "bne- 1b;" \
- : "=&r" (previous), \
- "=&r" (r) \
- : "r" (target), \
- "r" (delta) \
- : "memory", "cc"); \
- return (previous); \
- }
-
-CK_PR_FAA(64, uint64_t, "d")
-CK_PR_FAA(32, uint32_t, "w")
-CK_PR_FAA(uint, unsigned int, "w")
-CK_PR_FAA(int, int, "w")
-
-#undef CK_PR_FAA
-
-#endif /* _CK_PR_PPC64_H */
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/sparcv9/ck_f_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/sparcv9/ck_f_pr.h b/lib/ck/include/gcc/sparcv9/ck_f_pr.h
deleted file mode 100644
index 0398680..0000000
--- a/lib/ck/include/gcc/sparcv9/ck_f_pr.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#define CK_F_PR_CAS_64
-#define CK_F_PR_CAS_64_VALUE
-#define CK_F_PR_CAS_PTR
-#define CK_F_PR_CAS_PTR_VALUE
-#define CK_F_PR_FAS_32
-#define CK_F_PR_FAS_UINT
-#define CK_F_PR_FAS_INT
-#define CK_F_PR_CAS_32
-#define CK_F_PR_CAS_32_VALUE
-#define CK_F_PR_CAS_UINT
-#define CK_F_PR_CAS_INT
-#define CK_F_PR_CAS_UINT_VALUE
-#define CK_F_PR_CAS_INT_VALUE
-#define CK_F_PR_STORE_64
-#define CK_F_PR_STORE_32
-#define CK_F_PR_STORE_DOUBLE
-#define CK_F_PR_STORE_UINT
-#define CK_F_PR_STORE_INT
-#define CK_F_PR_STORE_PTR
-#define CK_F_PR_LOAD_64
-#define CK_F_PR_LOAD_32
-#define CK_F_PR_LOAD_DOUBLE
-#define CK_F_PR_LOAD_UINT
-#define CK_F_PR_LOAD_INT
-#define CK_F_PR_LOAD_PTR
-
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/025a4550/lib/ck/include/gcc/sparcv9/ck_pr.h
----------------------------------------------------------------------
diff --git a/lib/ck/include/gcc/sparcv9/ck_pr.h b/lib/ck/include/gcc/sparcv9/ck_pr.h
deleted file mode 100644
index 253c8ef..0000000
--- a/lib/ck/include/gcc/sparcv9/ck_pr.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright 2009, 2010 Samy Al Bahra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CK_PR_SPARCV9_H
-#define _CK_PR_SPARCV9_H
-
-#ifndef _CK_PR_H
-#error Do not include this file directly, use ck_pr.h
-#endif
-
-#include <ck_cc.h>
-#include <ck_md.h>
-
-/*
- * The following represent supported atomic operations.
- * These operations may be emulated.
- */
-#include "ck_f_pr.h"
-
-/*
- * Minimum interface requirement met.
- */
-#define CK_F_PR
-
-/*
- * Order loads at the least.
- */
-CK_CC_INLINE static void
-ck_pr_stall(void)
-{
-
- __asm__ __volatile__("membar #LoadLoad" ::: "memory");
- return;
-}
-
-#define CK_PR_FENCE(T, I) \
- CK_CC_INLINE static void \
- ck_pr_fence_strict_##T(void) \
- { \
- __asm__ __volatile__(I ::: "memory"); \
- }
-
-/*
- * Atomic operations are treated as both load and store
- * operations on SPARCv9.
- */
-CK_PR_FENCE(atomic, "membar #StoreStore")
-CK_PR_FENCE(atomic_store, "membar #StoreStore")
-CK_PR_FENCE(atomic_load, "membar #StoreLoad")
-CK_PR_FENCE(store_atomic, "membar #StoreStore")
-CK_PR_FENCE(load_atomic, "membar #LoadStore")
-CK_PR_FENCE(store, "membar #StoreStore")
-CK_PR_FENCE(store_load, "membar #StoreLoad")
-CK_PR_FENCE(load, "membar #LoadLoad")
-CK_PR_FENCE(load_store, "membar #LoadStore")
-CK_PR_FENCE(memory, "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
-CK_PR_FENCE(acquire, "membar #LoadLoad | #LoadStore")
-CK_PR_FENCE(release, "membar #LoadStore | #StoreStore")
-
-#undef CK_PR_FENCE
-
-#define CK_PR_LOAD(S, M, T, C, I) \
- CK_CC_INLINE static T \
- ck_pr_load_##S(const M *target) \
- { \
- T r; \
- __asm__ __volatile__(I " [%1], %0" \
- : "=&r" (r) \
- : "r" (target) \
- : "memory"); \
- return (r); \
- }
-
-CK_PR_LOAD(ptr, void, void *, uint64_t, "ldx")
-
-#define CK_PR_LOAD_S(S, T, I) CK_PR_LOAD(S, T, T, T, I)
-
-CK_PR_LOAD_S(64, uint64_t, "ldx")
-CK_PR_LOAD_S(32, uint32_t, "lduw")
-CK_PR_LOAD_S(uint, unsigned int, "lduw")
-CK_PR_LOAD_S(double, double, "ldx")
-CK_PR_LOAD_S(int, int, "ldsw")
-
-#undef CK_PR_LOAD_S
-#undef CK_PR_LOAD
-
-#define CK_PR_STORE(S, M, T, C, I) \
- CK_CC_INLINE static void \
- ck_pr_store_##S(M *target, T v) \
- { \
- __asm__ __volatile__(I " %0, [%1]" \
- : \
- : "r" (v), \
- "r" (target) \
- : "memory"); \
- return; \
- }
-
-CK_PR_STORE(ptr, void, const void *, uint64_t, "stx")
-
-#define CK_PR_STORE_S(S, T, I) CK_PR_STORE(S, T, T, T, I)
-
-CK_PR_STORE_S(8, uint8_t, "stub")
-CK_PR_STORE_S(64, uint64_t, "stx")
-CK_PR_STORE_S(32, uint32_t, "stuw")
-CK_PR_STORE_S(uint, unsigned int, "stuw")
-CK_PR_STORE_S(double, double, "stx")
-CK_PR_STORE_S(int, int, "stsw")
-
-#undef CK_PR_STORE_S
-#undef CK_PR_STORE
-
-CK_CC_INLINE static bool
-ck_pr_cas_64_value(uint64_t *target, uint64_t compare, uint64_t set, uint64_t *value)
-{
-
- __asm__ __volatile__("casx [%1], %2, %0"
- : "+&r" (set)
- : "r" (target),
- "r" (compare)
- : "memory");
-
- *value = set;
- return (compare == set);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_64(uint64_t *target, uint64_t compare, uint64_t set)
-{
-
- __asm__ __volatile__("casx [%1], %2, %0"
- : "+&r" (set)
- : "r" (target),
- "r" (compare)
- : "memory");
-
- return (compare == set);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr(void *target, void *compare, void *set)
-{
-
- return ck_pr_cas_64(target, (uint64_t)compare, (uint64_t)set);
-}
-
-CK_CC_INLINE static bool
-ck_pr_cas_ptr_value(void *target, void *compare, void *set, void *previous)
-{
-
- return ck_pr_cas_64_value(target, (uint64_t)compare, (uint64_t)set, previous);
-}
-
-#define CK_PR_CAS(N, T) \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N##_value(T *target, T compare, T set, T *value) \
- { \
- __asm__ __volatile__("cas [%1], %2, %0" \
- : "+&r" (set) \
- : "r" (target), \
- "r" (compare) \
- : "memory"); \
- *value = set; \
- return (compare == set); \
- } \
- CK_CC_INLINE static bool \
- ck_pr_cas_##N(T *target, T compare, T set) \
- { \
- __asm__ __volatile__("cas [%1], %2, %0" \
- : "+&r" (set) \
- : "r" (target), \
- "r" (compare) \
- : "memory"); \
- return (compare == set); \
- }
-
-CK_PR_CAS(32, uint32_t)
-CK_PR_CAS(uint, unsigned int)
-CK_PR_CAS(int, int)
-
-#undef CK_PR_CAS
-
-#define CK_PR_FAS(N, T) \
- CK_CC_INLINE static T \
- ck_pr_fas_##N(T *target, T update) \
- { \
- \
- __asm__ __volatile__("swap [%1], %0" \
- : "+&r" (update) \
- : "r" (target) \
- : "memory"); \
- return (update); \
- }
-
-CK_PR_FAS(int, int)
-CK_PR_FAS(uint, unsigned int)
-CK_PR_FAS(32, uint32_t)
-
-#undef CK_PR_FAS
-
-#endif /* _CK_PR_SPARCV9_H */
-