#ifndef h_uvaffin #define h_uvaffin /****************************************************************************** * * Header file for UniVerse Processor Affinity Control Subsystem (PACS) * * Module %M% Version %I% Date %H% * * (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved * This is unpublished proprietary source code of Ardent Software Inc. * The copyright notice above does not evidence any actual or intended * publication of such source code. * ******************************************************************************* * * Maintenence log - insert most recent change descriptions at top * * Date.... GTAR# WHO Description......................................... * 10/14/98 23801 SAP Change copyrights. * 05/20/96 18477 DGC Port PACS to Release 9 (FiiRESTORM III) * ******************************************************************************/ #include #include #define TRUE 1 #define FALSE 0 #define MAXBUF 81 #define MAXCPUS 32 #define GETAFFIN 1 #define SETAFFIN 2 /* * Affinity Macros */ /* * Physical Hardware Information */ #define VM_INFO struct dg_sys_info_pm_info #define CPU_INFO struct dg_cpu_info #define CPU_INFO_INIT(x) dg_cpu_info_init(&x) #define GET_SYS_INFO_PM(x) dg_sys_info((long*)&x,\ DG_SYS_INFO_PM_INFO_TYPE,\ DG_SYS_INFO_MACHINE_CURRENT_VERSION) #define GET_CPU_INFO(x,y) dg_cpu_info(DG_CPU_INFO_CURRENT_VERSION,\ DG_CPU_INFO_SELECT_NEXT_CPU,NULL,&x,&y) #define CPU_INFO_DESTROY(x) dg_cpu_info_destroy(&x) #define GET_CPU_COUNT(x) x.idle_vp_count #define GET_BOUND_PROCS(x) x.bound_process_count #define GET_UNBOUND_PROCS(x) x.unbound_process_count #define GET_PROCS(x) x.process_count /* * CPU Set Manipulation */ #define CPU_ID_SET dg_cpu_id_set_t #define CPU_ID_SET_INIT(x) dg_cpu_id_set_init(x) #define IS_CPU_MEMBER(x,y) dg_cpu_id_set_is_member(x,(dg_cpu_id_t)y) #define CPU_ADD_ID(x,y) dg_cpu_id_set_add_id(x,y) #define CPU_ID_SET_DESTROY(x) dg_cpu_id_set_destroy(x) /* * Affinity Attribute Structure Manipulation */ #define CPU_AFFIN_ATTR dg_cpu_affinity_attr_t #define CPU_AFFIN_INIT(x) dg_cpu_affinity_attr_init(x) #define CPU_GET_AFFINITY(x,y) dg_cpu_get_affinity(\ DG_CPU_AFFINITY_CURRENT_VERSION,\ DG_CPU_AFFINITY_SELECT_PID_INIT_LWP_GROUP,\ x,NULL,y) #define CPU_SET_AFFINITY(x,y) dg_cpu_set_affinity(\ DG_CPU_AFFINITY_CURRENT_VERSION,\ DG_CPU_AFFINITY_SELECT_PID_INIT_LWP_GROUP,\ x,NULL,y) #define AFF_CPU_ID_GET(x,y) dg_cpu_affinity_attr_get_cpu_id_set(x,y) #define AFF_CPU_ID_SET(x,y) dg_cpu_affinity_attr_set_cpu_id_set(x,y) #define AFFIN_ATTR_DESTROY(x) dg_cpu_affinity_attr_destroy(x) /* * Affinity errors */ #define _GET_SYS_INFO_PM "dg_sys_info" #define _CPU_INFO_INIT "dg_cpu_info_init" #define _CPU_INFO_DESTROY "dg_cpu_info_destroy" #define _CPU_ID_SET_INIT "dg_cpu_id_set_init" #define _IS_CPU_MEMBER "dg_cpu_id_set_is_member" #define _CPU_ADD_ID "dg_cpu_id_set_add_id" #define _CPU_ID_SET_DESTROY "dg_cpu_id_set_destroy" #define _CPU_AFFIN_INIT "dg_cpu_affinity_attr_init" #define _CPU_GET_AFFINITY "dg_cpu_get_affinity" #define _CPU_SET_AFFINITY "dg_cpu_set_affinity" #define _AFF_CPU_ID_GET "dg_cpu_affinity_attr_get_cpu_id_set" #define _AFF_CPU_ID_SET "dg_cpu_affinity_attr_set_cpu_id_set" #define _AFFIN_ATTR_DESTROY "dg_cpu_affinity_attr_destroy" extern void reset_affinity(), fin_PACS(); extern int init_PACS(), get_affnmode(), set_affinity(); extern char *getuvhome(); extern int AFFNMODE; /* PACS Mode */ extern int AFFNOVRD; /* PACS Precedence Override */ #endif /* end of uvaffin.h */