121 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
122
123
124 // Here are some liblgrp types from sys/lgrp_user.h to be able to
125 // compile on older systems without this header file.
126
127 #ifndef MADV_ACCESS_LWP
128 #define MADV_ACCESS_LWP 7 /* next LWP to access heavily */
129 #endif
130 #ifndef MADV_ACCESS_MANY
131 #define MADV_ACCESS_MANY 8 /* many processes to access heavily */
132 #endif
133
134 #ifndef LGRP_RSRC_CPU
135 #define LGRP_RSRC_CPU 0 /* CPU resources */
136 #endif
137 #ifndef LGRP_RSRC_MEM
138 #define LGRP_RSRC_MEM 1 /* memory resources */
139 #endif
140
141 // see thr_setprio(3T) for the basis of these numbers
142 #define MinimumPriority 0
143 #define NormalPriority 64
144 #define MaximumPriority 127
145
146 // Values for ThreadPriorityPolicy == 1
147 int prio_policy1[CriticalPriority+1] = {
148 -99999, 0, 16, 32, 48, 64,
149 80, 96, 112, 124, 127, 127 };
150
151 // System parameters used internally
152 static clock_t clock_tics_per_sec = 100;
153
154 // Track if we have called enable_extended_FILE_stdio (on Solaris 10u4+)
155 static bool enabled_extended_FILE_stdio = false;
156
157 // For diagnostics to print a message once. see run_periodic_checks
158 static bool check_addr0_done = false;
159 static sigset_t check_signal_done;
160 static bool check_signals = true;
161
162 address os::Solaris::handler_start; // start pc of thr_sighndlrinfo
163 address os::Solaris::handler_end; // end pc of thr_sighndlrinfo
164
165 address os::Solaris::_main_stack_base = NULL; // 4352906 workaround
3121
3122 // sched class attributes
3123 typedef struct {
3124 int schedPolicy; // classID
3125 int maxPrio;
3126 int minPrio;
3127 } SchedInfo;
3128
3129
3130 static SchedInfo tsLimits, iaLimits, rtLimits, fxLimits;
3131
3132 #ifdef ASSERT
3133 static int ReadBackValidate = 1;
3134 #endif
3135 static int myClass = 0;
3136 static int myMin = 0;
3137 static int myMax = 0;
3138 static int myCur = 0;
3139 static bool priocntl_enable = false;
3140
3141 static const int criticalPrio = 60; // FX/60 is critical thread class/priority on T4
3142 static int java_MaxPriority_to_os_priority = 0; // Saved mapping
3143
3144
3145 // lwp_priocntl_init
3146 //
3147 // Try to determine the priority scale for our process.
3148 //
3149 // Return errno or 0 if OK.
3150 //
3151 static int lwp_priocntl_init() {
3152 int rslt;
3153 pcinfo_t ClassInfo;
3154 pcparms_t ParmInfo;
3155 int i;
3156
3157 if (!UseThreadPriorities) return 0;
3158
3159 // If ThreadPriorityPolicy is 1, switch tables
3160 if (ThreadPriorityPolicy == 1) {
3161 for (i = 0; i < CriticalPriority+1; i++)
|
121 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
122
123
124 // Here are some liblgrp types from sys/lgrp_user.h to be able to
125 // compile on older systems without this header file.
126
127 #ifndef MADV_ACCESS_LWP
128 #define MADV_ACCESS_LWP 7 /* next LWP to access heavily */
129 #endif
130 #ifndef MADV_ACCESS_MANY
131 #define MADV_ACCESS_MANY 8 /* many processes to access heavily */
132 #endif
133
134 #ifndef LGRP_RSRC_CPU
135 #define LGRP_RSRC_CPU 0 /* CPU resources */
136 #endif
137 #ifndef LGRP_RSRC_MEM
138 #define LGRP_RSRC_MEM 1 /* memory resources */
139 #endif
140
141 // Values for ThreadPriorityPolicy == 1
142 int prio_policy1[CriticalPriority+1] = {
143 -99999, 0, 16, 32, 48, 64,
144 80, 96, 112, 124, 127, 127 };
145
146 // System parameters used internally
147 static clock_t clock_tics_per_sec = 100;
148
149 // Track if we have called enable_extended_FILE_stdio (on Solaris 10u4+)
150 static bool enabled_extended_FILE_stdio = false;
151
152 // For diagnostics to print a message once. see run_periodic_checks
153 static bool check_addr0_done = false;
154 static sigset_t check_signal_done;
155 static bool check_signals = true;
156
157 address os::Solaris::handler_start; // start pc of thr_sighndlrinfo
158 address os::Solaris::handler_end; // end pc of thr_sighndlrinfo
159
160 address os::Solaris::_main_stack_base = NULL; // 4352906 workaround
3116
3117 // sched class attributes
3118 typedef struct {
3119 int schedPolicy; // classID
3120 int maxPrio;
3121 int minPrio;
3122 } SchedInfo;
3123
3124
3125 static SchedInfo tsLimits, iaLimits, rtLimits, fxLimits;
3126
3127 #ifdef ASSERT
3128 static int ReadBackValidate = 1;
3129 #endif
3130 static int myClass = 0;
3131 static int myMin = 0;
3132 static int myMax = 0;
3133 static int myCur = 0;
3134 static bool priocntl_enable = false;
3135
3136 static const int criticalPrio = FXCriticalPriority;
3137 static int java_MaxPriority_to_os_priority = 0; // Saved mapping
3138
3139
3140 // lwp_priocntl_init
3141 //
3142 // Try to determine the priority scale for our process.
3143 //
3144 // Return errno or 0 if OK.
3145 //
3146 static int lwp_priocntl_init() {
3147 int rslt;
3148 pcinfo_t ClassInfo;
3149 pcparms_t ParmInfo;
3150 int i;
3151
3152 if (!UseThreadPriorities) return 0;
3153
3154 // If ThreadPriorityPolicy is 1, switch tables
3155 if (ThreadPriorityPolicy == 1) {
3156 for (i = 0; i < CriticalPriority+1; i++)
|