Print this page
XXXX pass in cpu_pause_func via pause_cpus


 203 
 204 /* Record status message, viewable from mdb */
 205 #define MPO_STATUS(args...) {                                                 \
 206         (void) snprintf(sun4v_mpo_status, sizeof (sun4v_mpo_status), args);   \
 207         MPO_DEBUG(sun4v_mpo_status);                                          \
 208 }
 209 
 210 /*
 211  * The MPO locks are to protect the MPO metadata while that
 212  * information is updated as a result of a memory DR operation.
 213  * The read lock must be acquired to read the metadata and the
 214  * write locks must be acquired to update it.
 215  */
 216 #define mpo_rd_lock     kpreempt_disable
 217 #define mpo_rd_unlock   kpreempt_enable
 218 
 219 static void
 220 mpo_wr_lock()
 221 {
 222         mutex_enter(&cpu_lock);
 223         pause_cpus(NULL);
 224         mutex_exit(&cpu_lock);
 225 }
 226 
 227 static void
 228 mpo_wr_unlock()
 229 {
 230         mutex_enter(&cpu_lock);
 231         start_cpus();
 232         mutex_exit(&cpu_lock);
 233 }
 234 
 235 /*
 236  * Routine to read a uint64_t from a given md
 237  */
 238 static  int64_t
 239 get_int(md_t md, mde_cookie_t node, char *propname, uint64_t *val)
 240 {
 241         int err = md_get_prop_val(md, node, propname, val);
 242         return (err);
 243 }




 203 
 204 /* Record status message, viewable from mdb */
 205 #define MPO_STATUS(args...) {                                                 \
 206         (void) snprintf(sun4v_mpo_status, sizeof (sun4v_mpo_status), args);   \
 207         MPO_DEBUG(sun4v_mpo_status);                                          \
 208 }
 209 
 210 /*
 211  * The MPO locks are to protect the MPO metadata while that
 212  * information is updated as a result of a memory DR operation.
 213  * The read lock must be acquired to read the metadata and the
 214  * write locks must be acquired to update it.
 215  */
 216 #define mpo_rd_lock     kpreempt_disable
 217 #define mpo_rd_unlock   kpreempt_enable
 218 
 219 static void
 220 mpo_wr_lock()
 221 {
 222         mutex_enter(&cpu_lock);
 223         pause_cpus(NULL, NULL);
 224         mutex_exit(&cpu_lock);
 225 }
 226 
 227 static void
 228 mpo_wr_unlock()
 229 {
 230         mutex_enter(&cpu_lock);
 231         start_cpus();
 232         mutex_exit(&cpu_lock);
 233 }
 234 
 235 /*
 236  * Routine to read a uint64_t from a given md
 237  */
 238 static  int64_t
 239 get_int(md_t md, mde_cookie_t node, char *propname, uint64_t *val)
 240 {
 241         int err = md_get_prop_val(md, node, propname, val);
 242         return (err);
 243 }