Changeset 30190 in vbox for trunk/src/VBox/Runtime/r0drv/solaris
- Timestamp:
- Jun 15, 2010 11:57:37 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/i86pc/os/vbi.c
r29476 r30190 124 124 #define IS_KERNEL(v) ((uintptr_t)(v) >= kernelbase) 125 125 126 #if 0 126 127 static int vbi_verbose = 0; 127 128 128 129 #define VBI_VERBOSE(msg) {if (vbi_verbose) cmn_err(CE_WARN, msg);} 130 #endif 129 131 130 132 /* Introduced in v6 */ … … 212 214 * actual number of CPUs running in the sytem. 213 215 */ 214 if (ncpus > VBI_NCPU) 216 if (ncpus > VBI_NCPU) { 217 cmn_err(CE_NOTE, "cpu count mismatch.\n"); 215 218 return (EINVAL); 219 } 216 220 } else { 217 221 use_old = 1; … … 219 223 use_old_with_ulong = 1; 220 224 else if (max_cpuid + 1 != VBI_NCPU) 225 { 226 cmn_err(CE_NOTE, "cpuset_t size mismatch. probably too old a kernel.\n"); 221 227 return (EINVAL); /* cpuset_t size mismatch */ 228 } 222 229 } 223 230 … … 229 236 kobj_getsymvalue("contig_free", 1); 230 237 if (p_contig_free == NULL) { 231 cmn_err(CE_NOTE, " contig_free() not found in kernel ");238 cmn_err(CE_NOTE, " contig_free() not found in kernel\n"); 232 239 return (EINVAL); 233 240 } … … 237 244 * Check if this is S10 or Nevada 238 245 */ 239 if (!strncmp(utsname.release, "5.11", sizeof("5.11") - 1)) 240 { 246 if (!strncmp(utsname.release, "5.11", sizeof("5.11") - 1)) { 241 247 /* Nevada detected... */ 242 248 vbi_is_nevada = 1; … … 245 251 off_cpu_kprunrun = off_s11_cpu_kprunrun; 246 252 off_t_preempt = off_s11_t_preempt; 247 } 248 else 249 { 253 } else { 250 254 /* Solaris 10 detected... */ 251 255 vbi_is_nevada = 0; … … 263 267 char krr = VBI_CPU_KPRUNRUN; 264 268 if ( (crr < 0 || crr > 1) 265 || (krr < 0 || krr > 1)) 266 { 269 || (krr < 0 || krr > 1)) { 267 270 cmn_err(CE_NOTE, ":CPU structure sanity check failed! OS version mismatch.\n"); 268 271 return EINVAL; … … 271 274 /* Thread */ 272 275 char t_preempt = VBI_T_PREEMPT; 273 if (t_preempt < 0 || t_preempt > 32) 274 { 276 if (t_preempt < 0 || t_preempt > 32) { 275 277 cmn_err(CE_NOTE, ":Thread structure sanity check failed! OS version mismatch.\n"); 276 278 return EINVAL; 277 279 } 280 278 281 return (0); 279 282 } … … 335 338 336 339 if (ptr == NULL) { 337 VBI_VERBOSE("vbi_internal_alloc() failure");340 cmn_err(CE_NOTE, "vbi_internal_alloc() failure for %lu bytes", size); 338 341 return (NULL); 339 342 } … … 366 369 367 370 if ((pa & PAGEOFFSET) || (size & PAGEOFFSET)) { 368 VBI_VERBOSE("vbi_kernel_map() bad pa or size");371 cmn_err(CE_NOTE, "vbi_kernel_map() bad pa (0x%lx) or size (%lu)", pa, size); 369 372 return (NULL); 370 373 } … … 682 685 (caddr_t)addr, len, F_SOFTLOCK, access); 683 686 if (err != 0) { 684 VBI_VERBOSE("vbi_lock_va() failed to lock");687 cmn_err(CE_NOTE, "vbi_lock_va() failed to lock"); 685 688 return (-1); 686 689 } … … 733 736 struct segvbi_data *data; 734 737 struct as *as = seg->s_as; 735 int error = 0;736 738 caddr_t va; 737 739 ulong_t pgcnt; … … 756 758 } 757 759 758 return ( error);760 return (0); 759 761 } 760 762 … … 801 803 802 804 /* 803 * We never demand-fault for seg_vbi. 805 * We would demand fault if the (u)read() path would SEGOP_FAULT() 806 * on buffers mapped in via vbi_user_map() i.e. prefaults before DMA. 807 * Don't fail in such case where we're called directly, see #5047. 804 808 */ 805 809 static int … … 807 811 enum fault_type type, enum seg_rw rw) 808 812 { 809 return ( FC_MAKE_ERR(EFAULT));813 return (0); 810 814 } 811 815 … … 862 866 { 863 867 struct segvbi_data *data = seg->s_data; 864 return (data->prot); 868 size_t pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1; 869 if (pgno != 0) 870 { 871 do 872 { 873 pgno--; 874 protv[pgno] = data->prot; 875 } while (pgno != 0); 876 } 877 return (0); 865 878 } 866 879 … … 977 990 error = ENOMEM; 978 991 if (error) 979 VBI_VERBOSE("vbi_user_map() failed");992 cmn_err(CE_NOTE, "vbi_user_map() failed error=%d", error); 980 993 as_rangeunlock(as); 981 994 return (error);
Note:
See TracChangeset
for help on using the changeset viewer.