> +++ b/platform/linux-generic/include/odp_llqueue.h > @@ -0,0 +1,309 @@ > +/* Copyright (c) 2017, ARM Limited. > + * All rights reserved. > + * > + * SPDX-License-Identifier: BSD-3-Clause > + */ > + > +#ifndef ODP_LLQUEUE_H_ > +#define ODP_LLQUEUE_H_ > + > +#include <odp/api/cpu.h> > +#include <odp/api/hints.h> > +#include <odp/api/spinlock.h> > + > +#include <odp_config_internal.h> > +#include <odp_debug_internal.h> > +#include <odp_cpu.h> > + > +#include <stdint.h> > +#include <stdlib.h> > + > +/************************************************************************ > ****** > + * Linked list queues > + > ************************************************************************** > ***/ > + > +struct llqueue; > +struct llnode; > + > +static struct llnode *llq_head(struct llqueue *llq); > +static void llqueue_init(struct llqueue *llq); > +static void llq_enqueue(struct llqueue *llq, struct llnode *node); > +static struct llnode *llq_dequeue(struct llqueue *llq); > +static odp_bool_t llq_dequeue_cond(struct llqueue *llq, struct llnode > *exp); > +static odp_bool_t llq_cond_rotate(struct llqueue *llq, struct llnode > *node); > +static odp_bool_t llq_on_queue(struct llnode *node); > + > +/************************************************************************ > ****** > + * The implementation(s) > + > ************************************************************************** > ***/ > + > +#define SENTINEL ((void *)~(uintptr_t)0) > + > +#ifdef CONFIG_LLDSCD > +/* Implement queue operations using double-word LL/SC */
> + > +#else > +/* Implement queue operations protected by a spin lock */ > + There's a lot of ifdef'ed code in this file, basically two full parallel implementations. The first is built only for ARM and the second for the rest. Would there be a way to build both always ? -Petri
