878
879 return (B_TRUE);
880 }
881
882 static int
883 drmach_init(void)
884 {
885 DRMACH_HANDLE hdl;
886 drmachid_t id;
887 uint_t bnum;
888
889 if (MAX_BOARDS > SHRT_MAX) {
890 cmn_err(CE_WARN, "!drmach_init: system has too many (%d) "
891 "hotplug capable boards.", MAX_BOARDS);
892 return (ENXIO);
893 } else if (MAX_CMP_UNITS_PER_BOARD > 1) {
894 cmn_err(CE_WARN, "!drmach_init: DR doesn't support multiple "
895 "(%d) physical processors on one board.",
896 MAX_CMP_UNITS_PER_BOARD);
897 return (ENXIO);
898 } else if (MAX_CORES_PER_CMP & (MAX_CORES_PER_CMP - 1)) {
899 cmn_err(CE_WARN, "!drmach_init: number of logical CPUs (%d) in "
900 "physical processor is not power of 2.",
901 MAX_CORES_PER_CMP);
902 return (ENXIO);
903 } else if (MAX_CPU_UNITS_PER_BOARD > DEVSET_CPU_NUMBER ||
904 MAX_MEM_UNITS_PER_BOARD > DEVSET_MEM_NUMBER ||
905 MAX_IO_UNITS_PER_BOARD > DEVSET_IO_NUMBER) {
906 cmn_err(CE_WARN, "!drmach_init: system has more CPU/memory/IO "
907 "units than the DR driver can handle.");
908 return (ENXIO);
909 }
910
911 rw_init(&drmach_cpr_rwlock, NULL, RW_DEFAULT, NULL);
912 drmach_cpr_cid = callb_add(drmach_cpr_callb, NULL,
913 CB_CL_CPR_PM, "drmach");
914
915 rw_init(&drmach_boards_rwlock, NULL, RW_DEFAULT, NULL);
916 drmach_boards = drmach_array_new(0, MAX_BOARDS - 1);
917 drmach_domain.allow_dr = acpidev_dr_capable();
918
|
878
879 return (B_TRUE);
880 }
881
882 static int
883 drmach_init(void)
884 {
885 DRMACH_HANDLE hdl;
886 drmachid_t id;
887 uint_t bnum;
888
889 if (MAX_BOARDS > SHRT_MAX) {
890 cmn_err(CE_WARN, "!drmach_init: system has too many (%d) "
891 "hotplug capable boards.", MAX_BOARDS);
892 return (ENXIO);
893 } else if (MAX_CMP_UNITS_PER_BOARD > 1) {
894 cmn_err(CE_WARN, "!drmach_init: DR doesn't support multiple "
895 "(%d) physical processors on one board.",
896 MAX_CMP_UNITS_PER_BOARD);
897 return (ENXIO);
898 } else if (!ISP2(MAX_CORES_PER_CMP)) {
899 cmn_err(CE_WARN, "!drmach_init: number of logical CPUs (%d) in "
900 "physical processor is not power of 2.",
901 MAX_CORES_PER_CMP);
902 return (ENXIO);
903 } else if (MAX_CPU_UNITS_PER_BOARD > DEVSET_CPU_NUMBER ||
904 MAX_MEM_UNITS_PER_BOARD > DEVSET_MEM_NUMBER ||
905 MAX_IO_UNITS_PER_BOARD > DEVSET_IO_NUMBER) {
906 cmn_err(CE_WARN, "!drmach_init: system has more CPU/memory/IO "
907 "units than the DR driver can handle.");
908 return (ENXIO);
909 }
910
911 rw_init(&drmach_cpr_rwlock, NULL, RW_DEFAULT, NULL);
912 drmach_cpr_cid = callb_add(drmach_cpr_callb, NULL,
913 CB_CL_CPR_PM, "drmach");
914
915 rw_init(&drmach_boards_rwlock, NULL, RW_DEFAULT, NULL);
916 drmach_boards = drmach_array_new(0, MAX_BOARDS - 1);
917 drmach_domain.allow_dr = acpidev_dr_capable();
918
|