c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * CDDL HEADER START
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * The contents of this file are subject to the terms of the
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Common Development and Distribution License (the "License").
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * You may not use this file except in compliance with the License.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * or http://www.opensolaris.org/os/licensing.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * See the License for the specific language governing permissions
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * and limitations under the License.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * When distributing Covered Code, include this CDDL HEADER in each
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * If applicable, add the following below this CDDL HEADER, with the
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * fields enclosed by brackets "[]" replaced with your own identifying
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * information: Portions Copyright [yyyy] [name of copyright owner]
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * CDDL HEADER END
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * DESC: Generic kernel utility functions
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#include <sys/ib/clients/of/sol_ofs/sol_ofs_common.h>
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Doubly linked per user context IB resource list definitions
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Protection must occur * outside of the list.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * add_genlist()
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Adds the entry to the tail of the list.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikaradd_genlist(genlist_t *list, uintptr_t data, void *data_context)
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar new_entry = (genlist_entry_t *)(kmem_zalloc(sizeof (genlist_entry_t),
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * delete_genlist() - delete the specified entry from the list.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikarvoid delete_genlist(genlist_t *list, genlist_entry_t *entry) {
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar kmem_free((void *)entry, sizeof (genlist_entry_t));
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * remove_genlist_head() - remove the entry from the list head, but
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * don't delete it.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikargenlist_entry_t *remove_genlist_head(genlist_t *list) {
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * flush_genlist
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar kmem_free((void *)entry, sizeof (genlist_entry_t));
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * FUNCTION: insert_genlist_tail()