OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [osf-share/] [cma_list.h] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/*
/*
 * (c) Copyright 1990-1996 OPEN SOFTWARE FOUNDATION, INC.
 * (c) Copyright 1990-1996 OPEN SOFTWARE FOUNDATION, INC.
 * (c) Copyright 1990-1996 HEWLETT-PACKARD COMPANY
 * (c) Copyright 1990-1996 HEWLETT-PACKARD COMPANY
 * (c) Copyright 1990-1996 DIGITAL EQUIPMENT CORPORATION
 * (c) Copyright 1990-1996 DIGITAL EQUIPMENT CORPORATION
 * (c) Copyright 1991, 1992 Siemens-Nixdorf Information Systems
 * (c) Copyright 1991, 1992 Siemens-Nixdorf Information Systems
 * To anyone who acknowledges that this file is provided "AS IS" without
 * To anyone who acknowledges that this file is provided "AS IS" without
 * any express or implied warranty: permission to use, copy, modify, and
 * any express or implied warranty: permission to use, copy, modify, and
 * distribute this file for any purpose is hereby granted without fee,
 * distribute this file for any purpose is hereby granted without fee,
 * provided that the above copyright notices and this notice appears in
 * provided that the above copyright notices and this notice appears in
 * all source code copies, and that none of the names listed above be used
 * all source code copies, and that none of the names listed above be used
 * in advertising or publicity pertaining to distribution of the software
 * in advertising or publicity pertaining to distribution of the software
 * without specific, written prior permission.  None of these organizations
 * without specific, written prior permission.  None of these organizations
 * makes any representations about the suitability of this software for
 * makes any representations about the suitability of this software for
 * any purpose.
 * any purpose.
 */
 */
/*
/*
 *      Header file for generic list functions operating on singly linked
 *      Header file for generic list functions operating on singly linked
 *      null-terminated lists.  Items may not be REMOVED from the list!  The
 *      null-terminated lists.  Items may not be REMOVED from the list!  The
 *      intent is that the list can be traversed (for read-only operations)
 *      intent is that the list can be traversed (for read-only operations)
 *      without locking, since insertion is "safe" (though not truely
 *      without locking, since insertion is "safe" (though not truely
 *      atomic).  THIS ASSUMES THAT THE HARDWARE MAKES WRITES VISIBLE TO READS
 *      atomic).  THIS ASSUMES THAT THE HARDWARE MAKES WRITES VISIBLE TO READS
 *      IN THE ORDER IN WHICH THEY OCCURRED!  WITHOUT SUCH READ/WRITE
 *      IN THE ORDER IN WHICH THEY OCCURRED!  WITHOUT SUCH READ/WRITE
 *      ORDERING, IT MAY BE NECESSARY TO INSERT "BARRIERS" TO PRODUCE THE
 *      ORDERING, IT MAY BE NECESSARY TO INSERT "BARRIERS" TO PRODUCE THE
 *      REQUIRED VISIBILITY!
 *      REQUIRED VISIBILITY!
 */
 */
 
 
#ifndef CMA_LIST
#ifndef CMA_LIST
#define CMA_LIST
#define CMA_LIST
 
 
/*
/*
 *  INCLUDE FILES
 *  INCLUDE FILES
 */
 */
 
 
#include <cma.h>
#include <cma.h>
 
 
/*
/*
 * CONSTANTS AND MACROS
 * CONSTANTS AND MACROS
 */
 */
 
 
#define cma__c_null_list        ((cma__t_list *)cma_c_null_ptr)
#define cma__c_null_list        ((cma__t_list *)cma_c_null_ptr)
 
 
/*
/*
 * Test whether a list is empty.  Return cma_c_true if so, else
 * Test whether a list is empty.  Return cma_c_true if so, else
 * cma_c_false.
 * cma_c_false.
 */
 */
#define cma__list_empty(head)   ((head)->link == cma__c_null_list)
#define cma__list_empty(head)   ((head)->link == cma__c_null_list)
 
 
/*
/*
 * Initialize a queue header to empty.
 * Initialize a queue header to empty.
 */
 */
#define cma__list_init(head)    (void)((head)->link = cma__c_null_list)
#define cma__list_init(head)    (void)((head)->link = cma__c_null_list)
 
 
/*
/*
 * Insert an element in a list following the specified item (or at the
 * Insert an element in a list following the specified item (or at the
 * beginning of the list if "list" is the list head).  NOTE: insertion
 * beginning of the list if "list" is the list head).  NOTE: insertion
 * operations should be interlocked by the caller!
 * operations should be interlocked by the caller!
 */
 */
#define cma__list_insert(element,list)    (void)(       \
#define cma__list_insert(element,list)    (void)(       \
    (element)->link             = (list)->link,         \
    (element)->link             = (list)->link,         \
    (list)->link                = (element))
    (list)->link                = (element))
 
 
/*
/*
 * Return the next item in a list (or the first, if the address is of the
 * Return the next item in a list (or the first, if the address is of the
 * list header)
 * list header)
 */
 */
#define cma__list_next(element)    ((element)->link)
#define cma__list_next(element)    ((element)->link)
 
 
/*
/*
 * TYPEDEFS
 * TYPEDEFS
 */
 */
 
 
typedef struct CMA__T_LIST {
typedef struct CMA__T_LIST {
    struct CMA__T_LIST  *link;          /* Forward link */
    struct CMA__T_LIST  *link;          /* Forward link */
    } cma__t_list;
    } cma__t_list;
 
 
/*
/*
 *  GLOBAL DATA
 *  GLOBAL DATA
 */
 */
 
 
/*
/*
 * INTERNAL INTERFACES
 * INTERNAL INTERFACES
 */
 */
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.