Userspace Resource Manager
Loading...
Searching...
No Matches
Resource.h
1// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2// SPDX-License-Identifier: BSD-3-Clause-Clear
3
4#ifndef RESOURCE_TUNER_RESOURCE_H
5#define RESOURCE_TUNER_RESOURCE_H
6
7#include <cstdint>
8#include <vector>
9
10#include "DLManager.h"
11
16class Resource {
17private:
24 uint32_t mResCode;
25
32 uint32_t mResInfo;
33 int32_t mOptionalInfo;
38 int32_t mNumValues;
39
40 union {
41 int32_t values[2];
42 int32_t* valueArr;
44
45public:
47 mResValue.valueArr = nullptr;
48 }
49 // Copy Constructor
50 Resource(const Resource& resource);
51
52 ~Resource();
53
54 int32_t getCoreValue() const;
55 int32_t getClusterValue() const;
56 int32_t getResInfo() const;
57 int32_t getOptionalInfo() const;
58 uint32_t getResCode() const;
59 int32_t getValuesCount() const;
60 int32_t getValueAt(int32_t index) const;
61
62 void setCoreValue(int32_t core);
63 void setClusterValue(int32_t cluster);
64 void setResCode(uint32_t resCode);
65 void setResInfo(int32_t resInfo);
66 void setOptionalInfo(int32_t optionalInfo);
67 void setNumValues(int32_t numValues);
68 ErrCode setValueAt(int32_t index, int32_t value);
69};
70
71typedef ExtIterable1<Resource*> ResIterable;
72
73#endif
ErrCode
Custom Error Codes used by Resource Tuner APIs and Internal Functions.
Definition ErrCodes.h:19
Used to store information regarding Resources / Tunables which need to be Provisioned as part of the ...
Definition Resource.h:16
int32_t mOptionalInfo
Field to hold optional information for Request Processing.
Definition Resource.h:33
int32_t * valueArr
Dynamically Allocated Array, for >= 3 values.
Definition Resource.h:42
union Resource::@0 mResValue
The value to be Configured for this Resource Node.
uint32_t mResCode
A uniqued 32-bit (unsigned) identifier for the Resource.
Definition Resource.h:24
uint32_t mResInfo
Holds Logical Core and Cluster Information:
Definition Resource.h:32
int32_t mNumValues
Number of values to be configured for the Resource, both single-valued and multi-valued Resources are...
Definition Resource.h:38
int32_t values[2]
Use this field for storing upto 2 Values.
Definition Resource.h:41