lgrp_user.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LGRP_USER_H
#define _LGRP_USER_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* latency group definitions for user
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/inttypes.h>
#include <sys/processor.h>
/*
* lgroup interface version
*/
#define LGRP_VER_NONE 0 /* no lgroup interface version */
/*
* lgroup system call subcodes
*/
#define LGRP_SYS_MEMINFO 0 /* meminfo(2) aka MISYS_MEMINFO */
/*
* lgroup resources
*/
#define LGRP_RSRC_CPU 0 /* CPU resources */
typedef int lgrp_rsrc_t;
/*
* lgroup affinity
*/
typedef int lgrp_affinity_t;
/*
* Arguments to lgrp_affinity_{get,set}()
*/
typedef struct lgrp_affinity_args {
/*
* Flags to specify contents of lgroups desired
*/
typedef enum lgrp_content {
LGRP_CONTENT_ALL, /* everything in lgroup */
/* everything in lgroup's hierarchy (for compatability) */
LGRP_CONTENT_DIRECT /* what's directly contained in lgroup */
/*
* Flags for lgrp_latency_cookie() specifying what hardware resources to get
* latency between
*/
typedef enum lgrp_lat_between {
LGRP_LAT_CPU_TO_MEM /* latency between CPU and memory */
/*
* lgroup memory size type
*/
typedef longlong_t lgrp_mem_size_t;
/*
* lgroup memory size flags
*/
typedef enum lgrp_mem_size_flag {
LGRP_MEM_SZ_FREE, /* free memory */
LGRP_MEM_SZ_INSTALLED /* installed memory */
/*
* View of lgroups
*/
typedef enum lgrp_view {
LGRP_VIEW_CALLER, /* what's available to the caller */
LGRP_VIEW_OS /* what's available to operating system */
} lgrp_view_t;
/*
* lgroup information needed by user
*/
typedef struct lgrp_info {
int info_latency; /* latency */
int info_ncpus; /* number of CPUs */
} lgrp_info_t;
/*
* Type of lgroup cookie to use with interface routines
*/
typedef uintptr_t lgrp_cookie_t;
#define LGRP_COOKIE_NONE 0 /* no cookie */
/*
* Type of lgroup generation number
*/
typedef uint_t lgrp_gen_t;
/*
* Format of lgroup hierarchy snapshot
*/
typedef struct lgrp_snapshot_header {
int ss_version; /* lgroup interface version */
int ss_levels; /* levels of hierarchy */
int ss_nlgrps; /* number of lgroups */
int ss_nlgrps_os; /* number of lgroups (OS view) */
int ss_nlgrps_max; /* maximum number of lgroups */
int ss_root; /* root lgroup */
int ss_ncpus; /* total number of CPUs */
int **ss_latencies; /* latencies between lgroups */
#ifdef _SYSCALL32
/*
* lgroup information needed by 32-bit user
*/
typedef struct lgrp_info32 {
int info_lgrpid; /* lgroup ID */
int info_latency; /* latency */
int info_ncpus; /* number of CPUs */
/*
* Format of lgroup hierarchy snapshot for 32-bit programs
*/
typedef struct lgrp_snapshot_header32 {
int ss_version; /* lgroup interface version */
int ss_levels; /* levels of hierarchy */
int ss_nlgrps; /* number of lgroups */
int ss_nlgrps_os; /* number of lgroups (OS view) */
int ss_nlgrps_max; /* maximum number of lgroups */
int ss_root; /* root lgroup */
int ss_ncpus; /* total number of CPUs */
int ss_view; /* view of lgroup hierarchy */
int ss_pset; /* caller's pset ID */
#endif /* _SYSCALL32 */
#ifdef __STDC__
int lgrp_version(int version);
#else /* __STDC__ */
int lgrp_affinity_set();
int lgrp_children();
int lgrp_cookie_stale();
int lgrp_cpus();
int lgrp_fini();
int lgrp_init();
int lgrp_latency();
int lgrp_nlgrps();
int lgrp_parents();
int lgrp_resources();
int lgrp_version();
#endif /* __STDC__ */
#endif /* !_KERNEL && !_KMEMUSER */
#ifdef __cplusplus
}
#endif
#endif /* _LGRP_USER_H */