/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#ifndef _SYS_SWAP_H
#define _SYS_SWAP_H
#include <sys/isa_defs.h>
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
#error "Cannot use swapctl in the large files compilation environment"
#endif
/* The following are for the swapctl system call */
typedef struct swapres {
} swapres_t;
typedef struct swapent {
} swapent_t;
typedef struct swaptable {
} swaptbl_t;
#if defined(_SYSCALL32)
/* Kernel's view of user ILP32 swapres and swapent structures */
typedef struct swapres32 {
} swapres32_t;
typedef struct swapent32 {
} swapent32_t;
typedef struct swaptable32 {
} swaptbl32_t;
#endif /* _SYSCALL32 */
#if defined(_KERNEL)
extern int swapctl(int, void *, int *);
#if defined(_LP64) && defined(_SYSCALL32)
extern int swapctl32(int, void *, int *);
#endif /* _LP64 && _SYSCALL32 */
#else /* !_KERNEL */
extern int swapctl(int, void *);
#endif /* _KERNEL */
/* ste_flags values */
/* Prevents others from deleting or */
/* allocating from it */
/* Clearing during deletion signals */
/* that you want to add the file back */
/* again, and will eventually cause */
/* it to be added back */
/*
* VM - virtual swap device.
*/
struct swapinfo {
};
/*
* Stuff to convert an anon slot pointer to a page name.
* Because the address of the slot (ap) is a unique identifier, we
* use it to generate a unique (vp,off), as shown in the comment for
* swap_alloc().
*
* The off bits are shifted PAGESHIFT to directly form a page aligned
* offset; the vp index bits map 1-1 to a vnode.
*
*/
/*
* Convert from an anon slot to associated vnode and offset.
*/
{ \
}
/*
* Get a vnode name for an anon slot.
* The vnum, offset are derived from anon struct address which is
* 16 bytes aligned. anon structs may be kmem_cache_alloc'd concurrently by
* multiple threads and come from a small range of addresses (same slab), in
* which case high order AP bits do not vary much, so choose vnum from low
* order bits which vary the most. Different threads will thus get different
* vnums and vnodes, which avoids vph_mutex_contention on the subsequent
* page_hashin().
*
* +-----------...-------------------+-----------------------+----+
* | swap offset | vnum |0000|
* +-----------...-------------------+-----------------------+----+
* 63 15 14 4 3 0
*/
{ \
& AN_VPMASK); \
}
/*
* Free the page name for the specified anon slot.
* For now there's nothing to do.
*/
/* Flags for swap_phys_alloc */
/* Special error codes for swap_newphysname() */
#ifdef _KERNEL
extern int swap_debug;
#endif /* _KERNEL */
#ifdef SWAP_DEBUG
if (swap_debug & f) \
#else /* SWAP_DEBUG */
#endif /* SWAP_DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SWAP_H */