XCube Stream Reader SDK
x3c/include/xcTaskTools.h
00001 //============================================================================
00002 // Name        : xcTaskTools.h
00003 // Author      : John Roberts
00004 // Version     :
00005 // Copyright   : (C) Copyright 2010 XCube Research and Development
00006 //               All rights reserved.
00007 //
00008 // Description : Tools to deal with task names and addresses
00009 //
00010 // HISTORY     :
00011 //       01/14/2011 - initial Version
00012 //============================================================================
00013 #ifndef XCTASKTOOL_H_
00014 #define XCTASKTOOL_H_
00015 
00016 #include <string.h>
00017 #include <ctype.h>
00018 #include <stdio.h>
00019 #include <stdlib.h>
00020 #include <time.h>
00021 #include <sched.h>
00022 #include <errno.h>
00023 #include <sys/resource.h>
00024 #include <unistd.h>
00025 #include "xcTypes.h"
00026 
00027 // These values are to be used with the 'nice()' system call
00028 // The default nice priority is 0
00029 //
00030 typedef enum _X3C_TASK_PRIORITY_
00031 {
00032         X3C_TASK_PRIORITY_MIN = 0,
00033         X3C_TASK_PRIORITY_0 =  0,
00034         X3C_TASK_PRIORITY_1 = -2,
00035         X3C_TASK_PRIORITY_2 = -4,
00036         X3C_TASK_PRIORITY_3 = -6,
00037         X3C_TASK_PRIORITY_4 = -8,
00038         X3C_TASK_PRIORITY_5 = -10,
00039         X3C_TASK_PRIORITY_6 = -12,
00040         X3C_TASK_PRIORITY_7 = -14,
00041         X3C_TASK_PRIORITY_MAX = -20
00042 } X3C_TASK_PRIORITY;
00043 
00044 UINT32  addr_to_type(UINT32 addr);
00045 UINT32 addr_to_enum(UINT32 addr);
00046 UINT32 type_enum_to_addr(UINT32 ttype, UINT32 tenum);
00047 
00048 int setAffinity(unsigned int cpuMask);
00049 int getAffinity(unsigned int * currentCpuMask);
00050 int setPriority(X3C_TASK_PRIORITY priority);
00051 int getPriority(int  * priority);
00052 
00053 #endif /* XCTASKTOOL_H_ */
 All Classes Files Functions Variables Typedefs Friends Defines