[Cbe-oss-dev] [PATCH 8/10] MARS: workload counter use defines and prevent overflow

Geoff Levand geoffrey.levand at am.sony.com
Wed Aug 6 10:51:59 EST 2008


Yuji Mano wrote:
> This defines new macros for workload counter min/max, increases the workload
> counter size, and prevents integer wraparound/overflow.
> 
> Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
> 
> ---
>  include/common/mars/mars_workload_types.h |    5 ++++-
>  src/host/lib/mars_workload_queue.c        |    6 +++---
>  src/mpu/kernel/mars_kernel_scheduler.c    |    5 +++--
>  src/mpu/kernel/mars_kernel_workload.c     |    2 +-
>  4 files changed, 11 insertions(+), 7 deletions(-)
> 
> --- a/include/common/mars/mars_workload_types.h
> +++ b/include/common/mars/mars_workload_types.h
> @@ -59,6 +59,9 @@ extern "C" {
>  #define MARS_WORKLOAD_PRIORITY_MIN		0x00	/* minimum priority */
>  #define MARS_WORKLOAD_PRIORITY_MAX		0xff	/* maximum priority */
>  
> +#define MARS_WORKLOAD_COUNTER_MIN		0x0000	/* minimum counter */
> +#define MARS_WORKLOAD_COUNTER_MAX		0xffff	/* maximum counter */
> +

These all really should be enums.

>  #define MARS_WORKLOAD_MAX			1024	/* wl max */
>  #define MARS_WORKLOAD_PER_BLOCK			16	/* wl per block */
>  #define MARS_WORKLOAD_NUM_BLOCKS		64	/* wl max / per block */







More information about the cbe-oss-dev mailing list