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#include "MemoryPool.h"
12
17class Resource {
18private:
25 uint32_t mResCode;
26
33 uint32_t mResInfo;
34 int32_t mOptionalInfo;
39 int32_t mNumValues;
40
41 union {
42 int32_t values[2];
43 int32_t* valueArr;
45
46public:
48 mResValue.valueArr = nullptr;
49 }
50 // Copy Constructor
51 Resource(const Resource& resource);
52
53 ~Resource();
54
55 int32_t getCoreValue() const;
56 int32_t getClusterValue() const;
57 int32_t getResInfo() const;
58 int32_t getOptionalInfo() const;
59 uint32_t getResCode() const;
60 int32_t getValuesCount() const;
61 int32_t getValueAt(int32_t index) const;
62
63 void setCoreValue(int32_t core);
64 void setClusterValue(int32_t cluster);
65 void setResCode(uint32_t resCode);
66 void setResInfo(int32_t resInfo);
67 void setOptionalInfo(int32_t optionalInfo);
68 void setNumValues(int32_t numValues);
69 ErrCode setValueAt(int32_t index, int32_t value);
70};
71
72typedef ExtIterable1<Resource*> ResIterable;
73
74#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:17
int32_t mOptionalInfo
Field to hold optional information for Request Processing.
Definition Resource.h:34
int32_t * valueArr
Dynamically Allocated Array, for >= 3 values.
Definition Resource.h:43
union Resource::@1 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:25
uint32_t mResInfo
Holds Logical Core and Cluster Information:
Definition Resource.h:33
int32_t mNumValues
Number of values to be configured for the Resource, both single-valued and multi-valued Resources are...
Definition Resource.h:39
int32_t values[2]
Use this field for storing upto 2 Values.
Definition Resource.h:42