Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../data-stud/../../usr/include/vm/seg_kp_impl.h
Real path: /usr/include/vm/seg_kp_impl.h
Zurück
/* * Copyright (c) 1991, 2016, Oracle and/or its affiliates. All rights reserved. */ #ifndef _VM_SEG_KP_IMPL_H #define _VM_SEG_KP_IMPL_H #include <sys/types.h> #include <sys/param.h> #include <vm/seg.h> #include <sys/vmem.h> #include <sys/sysmacros.h> #ifdef __cplusplus extern "C" { #endif #ifdef _KERNEL struct anon_map; /* * A hash table is used to aid in the lookup of a kpd's based on vaddr. * Since the heaviest use of segkp occurs from segkp_*get and segkp_*release, * the hashing is based on the vaddr used by these routines. */ #define SEGKP_HASHSHIFT 8 #define SEGKP_HASHSZ (1ul << SEGKP_HASHSHIFT) #define SEGKP_HASH(vaddr) \ ((int)XOR8(((uintptr_t)vaddr >> PAGESHIFT), SEGKP_HASHSHIFT)) typedef struct segkp_data { kmutex_t kp_lock; /* per resource lock */ caddr_t kp_base; /* starting addr of chunk */ size_t kp_len; /* # of bytes */ uint_t kp_flags; /* state info */ int kp_cookie; /* index into cache array */ struct anon_map *kp_amp; /* anon structs */ struct segkp_data *kp_next; /* cache list link */ avl_node_t kp_link; /* AVL tree link */ } segkp_data_t; /* * Private information per overall segkp segment (as opposed * to per resource within segment). */ typedef struct segkp_segdata { vmem_t *kpsd_arena; /* virtual memory descriptor */ avl_tree_t *kpsd_hash; /* hash table for lookups */ } segkp_segdata_t; #define SEGKP_VMEM(seg) (((struct segkp_segdata *)(seg)->s_data)->kpsd_arena) /* * A cache of segkp elements may be created via segkp_cache_init(). * The elements on the freelist all have the same len and flags value. * The cookie passed to the client is an index into the freelist array. */ struct segkp_cache { int kpf_max; /* max # of elements allowed */ int kpf_count; /* current no. of elments */ int kpf_inuse; /* list inuse */ uint_t kpf_flags; /* seg_kp flag value */ size_t kpf_len; /* len of resource */ struct seg *kpf_seg; /* segment */ struct segkp_data *kpf_list; /* list of kpd's */ }; #define SEGKP_MAX_CACHE 4 /* Number of caches maintained */ /* * The size of the unmapped "red zone" at the end of each kernel * thread's stack. Note that several routines in seg_kp.c depend * implicitly on this size, so it would take a bit of work to change. */ #define SEGKP_REDZONE_PAGES 1 #define SEGKP_REDZONE_BYTES (ptob(SEGKP_REDZONE_PAGES)) /* * Define redzone, and stack_to_memory macros. * The redzone is PAGESIZE bytes. */ #ifdef STACK_GROWTH_DOWN #define KPD_REDZONE(kpd) (0) #define stom(v, flags) (((flags) & KPD_HASREDZONE) ? \ (v) + SEGKP_REDZONE_BYTES : (v)) #else /* STACK_GROWTH_DOWN */ #define KPD_REDZONE(kpd) (btop(kpd->kp_len) - SEGKP_REDZONE_PAGES) #define stom(v) (v) #endif /* STACK_GROWTH_DOWN */ #define SEGKP_MAPLEN(len, flags) (((flags) & KPD_HASREDZONE) ? \ (len) - SEGKP_REDZONE_BYTES : (len)) #endif /* _KERNEL */ #ifdef __cplusplus } #endif #endif /* _VM_SEG_KP_IMPL_H */