summaryrefslogtreecommitdiff
authorXindong Xu <xindong.xu@amlogic.com>2018-01-11 11:22:20 (GMT)
committer Xindong Xu <xindong.xu@amlogic.com>2018-01-12 01:51:20 (GMT)
commitcf15f941e9fa19e351b43856d62325c7ed0174f7 (patch)
tree7327529a2de117c8aa22a94801ff5f4b46b79a46
parent3aeae37c9f868a4354b2183893d23b1c374291ee (diff)
downloadkeymaster-cf15f941e9fa19e351b43856d62325c7ed0174f7.zip
keymaster-cf15f941e9fa19e351b43856d62325c7ed0174f7.tar.gz
keymaster-cf15f941e9fa19e351b43856d62325c7ed0174f7.tar.bz2
keymaster: bringup 8.0 ref [5/6]
PD# 158574 bringup 8.0 ref Change-Id: I3a8fb7e78db03436bff6c74a24d76ef28c08d59c
Diffstat
-rw-r--r--Android.mk12
-rw-r--r--aml_keymaster_device.h27
2 files changed, 39 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index d96d7ed..4395a85 100644
--- a/Android.mk
+++ b/Android.mk
@@ -48,6 +48,12 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo OK),OK)
LOCAL_PROPRIETARY_MODULE := true
endif
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -le 26 && echo OK),OK)
+LOCAL_SHARED_LIBRARIES += libkeymaster1
+endif
+
+LOCAL_CFLAGS += -DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
+
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_REQUIRED_MODULES := $(KEYMASTER_TA_BINARY)
include $(BUILD_SHARED_LIBRARY)
@@ -111,6 +117,12 @@ LOCAL_SHARED_LIBRARIES := \
libkeymaster_portable \
libhardware
+LOCAL_CFLAGS += -DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
+
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -le 26 && echo OK),OK)
+LOCAL_SHARED_LIBRARIES += libkeymaster1
+endif
+
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
include $(BUILD_NATIVE_TEST)
diff --git a/aml_keymaster_device.h b/aml_keymaster_device.h
index fb2a052..2066a7c 100644
--- a/aml_keymaster_device.h
+++ b/aml_keymaster_device.h
@@ -162,6 +162,33 @@ class AmlKeymasterDevice {
TEEC_Session KM_session;
};
+#if ANDROID_PLATFORM_SDK_VERSION == 26 //8.0
+struct ConfigureRequest : public KeymasterMessage {
+ explicit ConfigureRequest(int32_t ver = MAX_MESSAGE_VERSION) : KeymasterMessage(ver) {}
+
+ size_t SerializedSize() const override { return sizeof(os_version) + sizeof(os_patchlevel); }
+ uint8_t* Serialize(uint8_t* buf, const uint8_t* end) const override {
+ buf = append_uint32_to_buf(buf, end, os_version);
+ return append_uint32_to_buf(buf, end, os_patchlevel);
+ }
+ bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override {
+ return copy_uint32_from_buf(buf_ptr, end, &os_version) &&
+ copy_uint32_from_buf(buf_ptr, end, &os_patchlevel);
+ }
+
+ uint32_t os_version;
+ uint32_t os_patchlevel;
+};
+
+struct ConfigureResponse : public KeymasterResponse {
+ explicit ConfigureResponse(int32_t ver = MAX_MESSAGE_VERSION) : KeymasterResponse(ver) {}
+
+ size_t NonErrorSerializedSize() const override { return 0; }
+ uint8_t* NonErrorSerialize(uint8_t* buf, const uint8_t*) const override { return buf; }
+ bool NonErrorDeserialize(const uint8_t**, const uint8_t*) override { return true; }
+};
+#endif
+
} // namespace keymaster
#endif // AML_KEYMASTER_AML_KEYMASTER_DEVICE_H_