Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/include/sys/processor.h
Real path: /usr/include/sys/processor.h
Zurück
/* * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T * All Rights Reserved */ /* * Copyright (c) 1992, 2020, Oracle and/or its affiliates. All rights reserved. */ #ifndef _SYS_PROCESSOR_H #define _SYS_PROCESSOR_H #include <sys/types.h> #include <sys/procset.h> #ifdef __cplusplus extern "C" { #endif /* * Definitions for p_online, processor_info & lgrp system calls. */ /* * Type for an lgrpid */ typedef uint16_t lgrpid_t; /* * Type for processor name (CPU number). */ typedef int processorid_t; typedef int chipid_t; /* * Flags and return values for p_online(2), and pi_state for processor_info(2). * These flags are *not* for in-kernel examination of CPU states. * See <sys/cpuvar.h> for appropriate informational functions. */ #define P_OFFLINE 0x0001 /* processor is offline, as quiet as possible */ #define P_ONLINE 0x0002 /* processor is online */ #define P_STATUS 0x0003 /* value passed to p_online to request status */ #define P_FAULTED 0x0004 /* processor is offline, in faulted state */ #define P_POWEROFF 0x0005 /* processor is powered off */ #define P_NOINTR 0x0006 /* processor is online, but no I/O interrupts */ #define P_SPARE 0x0007 /* processor is offline, can be reactivated */ #define P_POWERIDLE 0x0008 /* processor is offline, for power capping */ #define P_BAD P_FAULTED /* unused but defined by USL */ #define P_FORCED 0x10000000 /* force processor offline */ /* * String names for processor states defined above. */ #define PS_OFFLINE "off-line" #define PS_ONLINE "on-line" #define PS_FAULTED "faulted" #define PS_POWEROFF "powered-off" #define PS_NOINTR "no-intr" #define PS_SPARE "spare" #define PS_POWERIDLE "power-idle" /* * Structure filled in by processor_info(2). This structure * SHOULD NOT BE MODIFIED. Changes to the structure would * negate ABI compatibility. * * The string fields are guaranteed to contain a NULL. * * The pi_fputypes field contains a (possibly empty) comma-separated * list of floating point identifier strings. */ #define PI_TYPELEN 16 /* max size of CPU type string */ #define PI_FPUTYPE 32 /* max size of FPU types string */ typedef struct { int pi_state; /* processor state, see above */ char pi_processor_type[PI_TYPELEN]; /* ASCII CPU type */ char pi_fputypes[PI_FPUTYPE]; /* ASCII FPU types */ int pi_clock; /* CPU clock freq in MHz */ } processor_info_t; /* * Binding values for processor_bind(2) */ #define PBIND_NONE (-1) /* LWP/thread is not bound */ #define PBIND_QUERY (-2) /* don't set, just return the binding */ /* * processor_sys() system call subcodes */ #define PROCESSOR_SYS_AFF (0) #define PROCESSOR_SYS_INFO (1) #define PROCESSOR_SYS_LIST (2) #define PROCESSOR_SYS_GROUP_LIST (3) #define PROCESSOR_SYS_GROUP_PROCESSOR_LIST (4) #define PROCESSOR_SYS_GET_CORE_CHIP_PSET (5) /* * processor_affinity(2) id types and flags. Note that there's a 1:1 mapping * between TS_BND_{WEAK,STRONG,INH_EXEC,INH_FORK,INH_THR) and the corresponding * flags below. This is because t_schedflag is already used for other related * binding flags. */ typedef enum { PA_QUERY = 0x000001, /* get flags and affinities */ PA_CLEAR = 0x000002, /* clear affinity */ PA_TYPE_CPU = 0x000080, /* bind to CPU(s) (default) */ PA_TYPE_PG = 0x000100, /* bind to PG(s) */ PA_TYPE_LGRP = 0x000200, /* bind to LGRP(s) */ PA_NEGATIVE = 0x000400, /* avoid running */ PA_TYPE_CORE = 0x001000, /* bind to core(s) */ PA_AFF_WEAK = 0x020000, /* prefer to run */ PA_AFF_STRONG = 0x040000, /* only run on */ PA_NO_INH_EXEC = 0x080000, /* across exec(2) */ PA_NO_INH_1EXEC = 0x100000, /* private flag, used by pbind(8) */ PA_NO_INH_FORK = 0x200000, /* across fork(2) */ PA_NO_INH_THR = 0x400000 /* across thr_create(3C) */ } pa_flags_t; /* * User-level system call interface prototypes */ #ifndef _KERNEL extern int p_online(processorid_t __processorid, int __flag); extern int processor_info(processorid_t, processor_info_t *); extern int processor_bind(idtype_t, id_t, processorid_t, processorid_t *); extern int processor_affinity(procset_t *, uint_t *, id_t *, uint32_t *); extern int processor_list(processorid_t *, uint_t *); extern int processor_group_list(id_t *, uint_t *); extern int processor_group_processor_list(id_t, processorid_t *, uint_t *); extern int processor_get_core_chip_pset(processorid_t, id_t *, id_t *, id_t *); extern processorid_t getcpuid(void); extern chipid_t getcacheid(void); extern lgrpid_t gethomelgroup(void) __ATTR_DEPRECATED; #else /* _KERNEL */ #define PA_TYPE_ALL (PA_TYPE_CPU | PA_TYPE_PG | PA_TYPE_LGRP | \ PA_TYPE_CORE) #define PA_AFF_ALL (PA_AFF_WEAK | PA_AFF_STRONG | PA_NEGATIVE) #define PA_NO_INH_ALL \ (PA_NO_INH_EXEC | PA_NO_INH_1EXEC | PA_NO_INH_FORK | PA_NO_INH_THR) #define PA_FLAGS (PA_AFF_ALL | PA_NO_INH_ALL) #define PA_FLAGS_ALL \ (PA_QUERY | PA_CLEAR | PA_TYPE_ALL | PA_AFF_ALL | PA_NO_INH_ALL) /* * Error codes for i_processor_affinity(). */ typedef enum { IPA_INVAL_FLAGS = 1, IPA_INVAL_IDS = 2, IPA_EMPTY_IDS = 3, IPA_INCORRECT_IDS = 4, IPA_BIND_FAILURE = 5 } i_processor_affinity_err; /* * Internal interface prototypes */ extern int p_online_internal(processorid_t, int, int *); extern int p_online_internal_locked(processorid_t, int, int *); extern int processor_info(processorid_t, processor_info_t *); extern int processor_bind(idtype_t, id_t, processorid_t, processorid_t *); extern int processor_affinity(procset_t *, uint_t *, id_t *, uint32_t *); extern boolean_t i_processor_affinity_check(kthread_t *, struct cpu *); extern int i_processor_affinity_one(kthread_t *, id_t, boolean_t); extern int i_processor_affinity(kthread_t *, uint_t *, id_t *, uint32_t *, boolean_t); #endif /* !_KERNEL */ #ifdef __cplusplus } #endif #endif /* _SYS_PROCESSOR_H */