// SCE CONFIDENTIAL
// PLAYSTATION(R)3 Programmer Tool Runtime Library 250.001
// Copyright (C) 2007 Sony Computer Entertainment Inc.
// All Rights Reserved.

#ifndef __CELL_UTIL_SPURS_TASKSET_H__
#define __CELL_UTIL_SPURS_TASKSET_H__ 1

#include <cellUtilSpursDefine.h>

#include <cell/spurs/task.h>

__CELL_UTIL_SPURS_BEGIN

class Spurs;

class Taskset : public CellSpursTaskset {
	uint8_t class1[_CELL_SPURS_TASKSET_CLASS1_EXTENDED_SIZE];

	Taskset(const Taskset&);
	Taskset& operator =(const Taskset&);

public:
	static const uint32_t ALIGN = CELL_SPURS_TASKSET_ALIGN;
	Taskset() {}

	static int create(Taskset* taskset,
					  const char *name,
					  Spurs* spurs,
					  uint64_t tasksetArgument,
					  uint8_t priority = CELL_SPURS_MAX_PRIORITY - 1,
					  uint8_t spuMask = 0xff);

	static int create(Taskset* taskset,
					  const char *name,
					  Spurs* spurs,
					  uint64_t tasksetArgument,
					  const uint8_t priority[CELL_SPURS_MAX_SPU],
					  unsigned maxContention);

	int shutdown()
		{
			return cellSpursShutdownTaskset(this);
		}
	int join()
		{
			return cellSpursJoinTaskset(this);
		}

	//
	// Information
	//
	int getTasksetId(CellSpursWorkloadId* id)
		{
			return cellSpursGetTasksetId(this, id);
		}
	int getSpursAddress(Spurs** spurs)
		{
			return cellSpursTasksetGetSpursAddress(this, (CellSpurs**)spurs);
		}
	int getInfo(CellSpursTasksetInfo* info)
		{
			return cellSpursGetTasksetInfo(this, info);
		}
} __attribute__((aligned(CELL_SPURS_TASKSET_ALIGN)));

__CELL_UTIL_SPURS_END

#endif // __CELL_UTIL_SPURS_TASKSET_H__

// Local Variables:
// mode: C++
// c-file-style: "stroustrup"
// tab-width: 4
// End:
// vim:sw=4:sts=4:ts=4
