3 * Copyright 2007 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef INCLUDED_GCELL_GC_JD_STACK_H
23 #define INCLUDED_GCELL_GC_JD_STACK_H
25 #include <gcell/gc_types.h>
26 #include <gcell/gc_job_desc.h>
31 * \brief Lock free stack for job descriptors (used for free list)
33 * This is aligned to a cache line, and fills the cache line,
34 * to avoid inadvertently losing reservations created with
35 * the load-and-reserve instructions.
38 typedef struct gc_jd_stack
42 // pad out to a full cache line
43 uint8_t _pad[128 - sizeof(gc_eaddr_t)];
44 } _AL128 gc_jd_stack_t;
48 * \brief Initialize the stack to empty.
51 gc_jd_stack_init(gc_jd_stack_t *stack);
55 * \brief Add \p item to the top of \p stack.
58 gc_jd_stack_push(gc_jd_stack_t *stack, gc_job_desc_t *item);
62 * \brief pop and return top item on stack, or 0 if stack is empty
65 gc_jd_stack_pop(gc_jd_stack_t *stack);
70 #endif /* INCLUDED_GCELL_GC_JD_STACK_H */