Please #ifdef the bodies of the functions, rather than adding wrappers
afterwards.

> Some functions dealing with pegging procs to CPUs and migration costs
> are only meaningful if we are running a multiprocessor kernel. Leave
> dummy versions in to avoid ifdef mazes elsewhere.
> 
> Index: kern_sched.c
> ===================================================================
> RCS file: /cvs/src/sys/kern/kern_sched.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 kern_sched.c
> --- kern_sched.c      10 Jul 2012 18:20:37 -0000      1.27
> +++ kern_sched.c      15 Apr 2013 08:54:54 -0000
> @@ -473,6 +473,7 @@ sched_steal_proc(struct cpu_info *self)
>       return (best);
>  }
>  
> +#ifdef MULTIPROCESSOR
>  /*
>   * Base 2 logarithm of an int. returns 0 for 0 (yeye, I know).
>   */
> @@ -565,8 +566,6 @@ sched_peg_curproc(struct cpu_info *ci)
>       SCHED_UNLOCK(s);
>  }
>  
> -#ifdef MULTIPROCESSOR
> -
>  void
>  sched_start_secondary_cpus(void)
>  {
> @@ -615,6 +614,22 @@ sched_stop_secondary_cpus(void)
>       }
>  }
>  
> +#else
> +
> +/*
> + * dummy versions for SP
> + */
> +int
> +sched_proc_to_cpu_cost(struct cpu_info *ci, struct proc *p)
> +{
> +     return (0);
> +}
> +
> +void
> +sched_peg_curproc(struct cpu_info *ci)
> +{
> +
> +}
>  #endif
>  
>  /*
> 

Reply via email to