Skip to content

Conversation

@ausyskin
Copy link
Contributor

No description provided.

ausyskin and others added 12 commits June 17, 2025 14:40
Consume build number when it provided in version
fourth field.

Signed-off-by: Alexander Usyskin <[email protected]>
Adhere to standard format.

Signed-off-by: Alexander Usyskin <[email protected]>
The struct sizes in the library interface are currently aligned
according to the environment and compiler,
which complicates calling library functions from managed environments.

To address this issue, a breaking change has been introduced that
explicitly specifies struct alignment.

Signed-off-by: Abliyev, Reuven <[email protected]>
C# OOP wrapper

Signed-off-by: Abliyev, Reuven <[email protected]>
Working example demonstrating how to use C# wrapper
to communicate with FW and driver

Signed-off-by: Abliyev, Reuven <[email protected]>
Add new logger type

Signed-off-by: Abliyev, Reuven <[email protected]>
New logger logic for Windows

Signed-off-by: Abliyev, Reuven <[email protected]>
new logger logic for EFI

Signed-off-by: Abliyev, Reuven <[email protected]>
Update to libmei 1.7.0

Signed-off-by: Abliyev, Reuven <[email protected]>
Implement new logger for Linux

Signed-off-by: Abliyev, Reuven <[email protected]>
C# logger callback implementation with examples

Signed-off-by: Abliyev, Reuven <[email protected]>
Update CHANGELOG.md

Signed-off-by: Abliyev, Reuven <[email protected]>
handle->log_callback2(is_error, msg);
}

static TEESTATUS TeeInitFullInt(IN OUT PTEEHANDLE handle, IN const GUID* guid,

Check warning

Code scanning / CodeQL

Poorly documented large function Warning

Poorly documented function: fewer than 2% comments for a function of 115 lines.

Copilot Autofix

AI 6 months ago

To address the issue, we will add detailed comments to the TeeInitFullInt function. These comments will include:

  1. A function-level comment describing the purpose of the function, its parameters, and its return value.
  2. Inline comments explaining the logic and purpose of key code blocks within the function.

The goal is to make the function easier to understand without altering its functionality. The comments will follow standard C documentation practices.


Suggested changeset 1
src/linux/metee_linux.c

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/linux/metee_linux.c b/src/linux/metee_linux.c
--- a/src/linux/metee_linux.c
+++ b/src/linux/metee_linux.c
@@ -105,2 +105,19 @@
 
+/**
+ * TeeInitFullInt - Initializes a TEE handle with the specified parameters.
+ *
+ * @handle: Pointer to the TEE handle to initialize. Must not be NULL.
+ * @guid: Pointer to the GUID identifying the TEE service. Must not be NULL.
+ * @device: The device address structure specifying the TEE device.
+ * @log_level: Logging level (e.g., TEE_LOG_LEVEL_VERBOSE).
+ * @log_callback: Callback function for logging messages.
+ * @log_callback2: Callback function for extended logging messages.
+ *
+ * This function sets up the TEE handle by initializing internal structures,
+ * opening the specified TEE device, and configuring logging callbacks.
+ * It performs various checks and returns an appropriate status code
+ * indicating success or failure.
+ *
+ * Return: TEESTATUS indicating the result of the initialization.
+ */
 static TEESTATUS TeeInitFullInt(IN OUT PTEEHANDLE handle, IN const GUID* guid,
@@ -110,2 +127,3 @@
 {
+	/* Internal structure for Linux-specific TEE operations */
 	struct metee_linux_intl *intl;
@@ -113,2 +131,3 @@
 	int rc;
+	/* Enable verbose logging if the log level is set to verbose */
 	bool verbose = (log_level == TEE_LOG_LEVEL_VERBOSE);
EOF
@@ -105,2 +105,19 @@

/**
* TeeInitFullInt - Initializes a TEE handle with the specified parameters.
*
* @handle: Pointer to the TEE handle to initialize. Must not be NULL.
* @guid: Pointer to the GUID identifying the TEE service. Must not be NULL.
* @device: The device address structure specifying the TEE device.
* @log_level: Logging level (e.g., TEE_LOG_LEVEL_VERBOSE).
* @log_callback: Callback function for logging messages.
* @log_callback2: Callback function for extended logging messages.
*
* This function sets up the TEE handle by initializing internal structures,
* opening the specified TEE device, and configuring logging callbacks.
* It performs various checks and returns an appropriate status code
* indicating success or failure.
*
* Return: TEESTATUS indicating the result of the initialization.
*/
static TEESTATUS TeeInitFullInt(IN OUT PTEEHANDLE handle, IN const GUID* guid,
@@ -110,2 +127,3 @@
{
/* Internal structure for Linux-specific TEE operations */
struct metee_linux_intl *intl;
@@ -113,2 +131,3 @@
int rc;
/* Enable verbose logging if the log level is set to verbose */
bool verbose = (log_level == TEE_LOG_LEVEL_VERBOSE);
Copilot is powered by AI and may make mistakes. Always verify output.
@ausyskin ausyskin merged commit deed7e8 into master Jun 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants