Print this page
8626 make pcplusmp and apix warning-free
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>


 831 
 832         int i;
 833 
 834         if (cpu_id == -1)
 835                 return ((processorid_t)0);
 836 
 837         for (i = cpu_id + 1; i < NCPU; i++) {
 838                 if (apic_cpu_in_range(i))
 839                         return (i);
 840         }
 841 
 842         return ((processorid_t)-1);
 843 }
 844 
 845 int
 846 apic_cpu_add(psm_cpu_request_t *reqp)
 847 {
 848         int i, rv = 0;
 849         ulong_t iflag;
 850         boolean_t first = B_TRUE;
 851         uchar_t localver;
 852         uint32_t localid, procid;
 853         processorid_t cpuid = (processorid_t)-1;
 854         mach_cpu_add_arg_t *ap;
 855 
 856         ASSERT(reqp != NULL);
 857         reqp->req.cpu_add.cpuid = (processorid_t)-1;
 858 
 859         /* Check whether CPU hotplug is supported. */
 860         if (!plat_dr_support_cpu() || apic_max_nproc == -1) {
 861                 return (ENOTSUP);
 862         }
 863 
 864         ap = (mach_cpu_add_arg_t *)reqp->req.cpu_add.argp;
 865         switch (ap->type) {
 866         case MACH_CPU_ARG_LOCAL_APIC:
 867                 localid = ap->arg.apic.apic_id;
 868                 procid = ap->arg.apic.proc_id;
 869                 if (localid >= 255 || procid > 255) {
 870                         cmn_err(CE_WARN,
 871                             "!apic: apicid(%u) or procid(%u) is invalid.",




 831 
 832         int i;
 833 
 834         if (cpu_id == -1)
 835                 return ((processorid_t)0);
 836 
 837         for (i = cpu_id + 1; i < NCPU; i++) {
 838                 if (apic_cpu_in_range(i))
 839                         return (i);
 840         }
 841 
 842         return ((processorid_t)-1);
 843 }
 844 
 845 int
 846 apic_cpu_add(psm_cpu_request_t *reqp)
 847 {
 848         int i, rv = 0;
 849         ulong_t iflag;
 850         boolean_t first = B_TRUE;
 851         uchar_t localver = 0;
 852         uint32_t localid, procid;
 853         processorid_t cpuid = (processorid_t)-1;
 854         mach_cpu_add_arg_t *ap;
 855 
 856         ASSERT(reqp != NULL);
 857         reqp->req.cpu_add.cpuid = (processorid_t)-1;
 858 
 859         /* Check whether CPU hotplug is supported. */
 860         if (!plat_dr_support_cpu() || apic_max_nproc == -1) {
 861                 return (ENOTSUP);
 862         }
 863 
 864         ap = (mach_cpu_add_arg_t *)reqp->req.cpu_add.argp;
 865         switch (ap->type) {
 866         case MACH_CPU_ARG_LOCAL_APIC:
 867                 localid = ap->arg.apic.apic_id;
 868                 procid = ap->arg.apic.proc_id;
 869                 if (localid >= 255 || procid > 255) {
 870                         cmn_err(CE_WARN,
 871                             "!apic: apicid(%u) or procid(%u) is invalid.",