The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sun4v/include/tte_hash.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2006 Kip Macy
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  *
   14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   24  * SUCH DAMAGE.
   25  *
   26  * $FreeBSD$
   27  */
   28 
   29 #ifndef _MACHINE_TTE_HASH_H_
   30 #define _MACHINE_TTE_HASH_H_
   31 
   32 #define HASH_ENTRY_SHIFT   2
   33 #define HASH_ENTRIES       ((1 << HASH_ENTRY_SHIFT) - 1)
   34 #define THE_SHIFT          (TTE_SHIFT + HASH_ENTRY_SHIFT)  /* size of TSB entry * #entries */
   35 #define TH_COLLISION_SHIFT 47                          /* bit 47 will never be set for a valid tag */
   36 #define TH_COLLISION       (1UL << TH_COLLISION_SHIFT)  
   37 #define TH_INVALID_SHIFT   46                          /* bit 47 will never be set for a valid tag */
   38 #define TH_INVALID         (1UL << TH_INVALID_SHIFT)  
   39 
   40 
   41 struct tte_hash;
   42 typedef struct tte_hash *tte_hash_t;
   43 
   44 void tte_hash_init(void);
   45 
   46 void tte_hash_clear(tte_hash_t hash);
   47 
   48 tte_t tte_hash_clear_bits(tte_hash_t hash, vm_offset_t va, uint64_t flags);
   49 
   50 tte_hash_t tte_hash_kernel_create(vm_offset_t, uint16_t, vm_paddr_t);
   51 
   52 tte_hash_t tte_hash_create(uint64_t context, uint64_t *scratchval);
   53 
   54 void tte_hash_destroy(tte_hash_t th);
   55 
   56 tte_t tte_hash_delete(tte_hash_t hash, vm_offset_t va);
   57 
   58 void tte_hash_delete_all(tte_hash_t hash);
   59 
   60 void tte_hash_insert(tte_hash_t hash, vm_offset_t va, tte_t data);
   61 
   62 tte_t tte_hash_lookup(tte_hash_t hash, vm_offset_t va);
   63 
   64 tte_t tte_hash_lookup_nolock(tte_hash_t hash, vm_offset_t va);
   65 
   66 tte_hash_t tte_hash_reset(tte_hash_t hash, uint64_t *scratchval);
   67 
   68 uint64_t tte_hash_set_scratchpad_kernel(tte_hash_t th);
   69 
   70 uint64_t tte_hash_set_scratchpad_user(tte_hash_t th, uint64_t context);
   71 
   72 tte_t tte_hash_update(tte_hash_t hash, vm_offset_t va, tte_t tte_data);
   73 
   74 int tte_hash_needs_resize(tte_hash_t th);
   75 
   76 tte_hash_t  tte_hash_resize(tte_hash_t th);
   77 
   78 #endif /* _MACHINE_TTE_HASH_H_ */

Cache object: 832632b856c5d36e62ec01b4a28c3506


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.