Cpu

Describes the local Cpu (on a Cpu_Device with several Cpu cores). On Linux, it depends on certain strings from the /proc file system, so if you change these platform strings, this module may not work properly. Typical usage (no error checking):. More...

Data Structures

struct  Cpu_Attrs
 Attributes used to create a Cpu. More...

Typedefs

typedef struct Cpu_Object * Cpu_Handle
 Handle through which to reference a Cpu descriptor.

Enumerations

enum  Cpu_Device {
  Cpu_Device_DM355 = 0,
  Cpu_Device_DM365,
  Cpu_Device_DM368,
  Cpu_Device_DM6446,
  Cpu_Device_DM6467,
  Cpu_Device_DM6437,
  Cpu_Device_OMAP3530,
  Cpu_Device_OMAPL137,
  Cpu_Device_OMAPL138,
  Cpu_Device_DM3730,
  Cpu_Device_COUNT
}
 Types of devices which a Cpu may be part of. More...

Functions

Cpu_Handle Cpu_create (Cpu_Attrs *attrs)
 Creates a Cpu descriptor.
Int Cpu_getDevice (Cpu_Handle hCpu, Cpu_Device *device)
 Get the device type the application is running on.
Char * Cpu_getDeviceName (Cpu_Device device)
 Get the string name of a certain device type.
Int Cpu_getLoad (Cpu_Handle hCpu, Int *cpuLoad)
 Get the current load from the Cpu.
Int Cpu_delete (Cpu_Handle hCpu)
 Delete the Cpu descriptor.

Variables

const Cpu_Attrs Cpu_Attrs_DEFAULT
 Default attributes for a Cpu.

Detailed Description

Describes the local Cpu (on a Cpu_Device with several Cpu cores). On Linux, it depends on certain strings from the /proc file system, so if you change these platform strings, this module may not work properly. Typical usage (no error checking):.

   #include <xdc/std.h>
   #include <ti/sdo/dmai/Cpu.h>
   #include <ti/sdo/dmai/Dmai.h>
   Cpu_Device device;
   Int load;
   Cpu_Handle hCpu;
   Cpu_Attrs cpuAttrs = Cpu_Attrs_DEFAULT;

   Dmai_init();
   hCpu = Cpu_create(&cpuAttrs);
   Cpu_getDevice(hCpu, &device);

   Cpu_getLoad(hCpu, &load);
   printf("Device type is %s and cpu is loaded %d%%\n",
          Cpu_getDeviceName(device), load);
   Cpu_delete(hCpu);

Typedef Documentation

typedef struct Cpu_Object* Cpu_Handle

Handle through which to reference a Cpu descriptor.


Enumeration Type Documentation

enum Cpu_Device

Types of devices which a Cpu may be part of.

Enumerator:
Cpu_Device_DM355  TMS320DM355.
Cpu_Device_DM365  TMS320DM365.
Cpu_Device_DM368  TMS320DM368.
Cpu_Device_DM6446  TMS320DM6446.
Cpu_Device_DM6467  TMS320DM6467.
Cpu_Device_DM6437  TMS320DM6437.
Cpu_Device_OMAP3530  OMAP3530.
Cpu_Device_OMAPL137  OMAP-L137.
Cpu_Device_OMAPL138  OMAPL138.
Cpu_Device_DM3730  DM3730.
Cpu_Device_COUNT 


Function Documentation

Cpu_Handle Cpu_create ( Cpu_Attrs attrs  ) 

Creates a Cpu descriptor.

Parameters:
[in] attrs Cpu_Attrs to use for creating the Cpu descriptor.
Return values:
Handle for use in subsequent operations (see Cpu_Handle).
NULL for failure.

Int Cpu_getDevice ( Cpu_Handle  hCpu,
Cpu_Device device 
)

Get the device type the application is running on.

Parameters:
[in] hCpu The Cpu_Handle of the Cpu to get the type of. If NULL is passed in the type will be determined anyway, but it will take longer.
[out] device The Cpu_Device is returned here.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.

Char* Cpu_getDeviceName ( Cpu_Device  device  ) 

Get the string name of a certain device type.

Parameters:
[in] device The Cpu_Device to get the string name of.
Return values:
Null terminated string describing the Cpu.

Int Cpu_getLoad ( Cpu_Handle  hCpu,
Int *  cpuLoad 
)

Get the current load from the Cpu.

Parameters:
[in] hCpu The Cpu_Handle to get the cpu load from.
[out] cpuLoad The cpu load is returned here.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.

Int Cpu_delete ( Cpu_Handle  hCpu  ) 

Delete the Cpu descriptor.

Parameters:
[in] hCpu The Cpu_Handle to the descriptor to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.


Variable Documentation

Default attributes for a Cpu.


Copyright 2011, Texas Instruments Incorporated