Skip to content

Commit 0e82659

Browse files
committed
Last merge of 9e and openprot branches.
1 parent 036c31b commit 0e82659

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2370
-65
lines changed

Cargo.lock

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,25 @@
22
name = "pldm-lib"
33
version = "0.1.0"
44
authors = ["Caliptra contributors", "OpenPRoT contributors"]
5-
edition = "2024"
5+
edition = "2021"
66

7-
[dependencies]
8-
zerocopy = { version = "0.8.17", features = ["derive"] }
7+
[workspace]
8+
members = [
9+
"pldm-common",
10+
"pldm-interface"
11+
]
12+
13+
[workspace.package]
14+
version = "0.1.0"
15+
authors = ["Caliptra contributors", "OpenPRoT contributors"]
16+
edition = "2021"
17+
18+
[workspace.dependencies]
19+
pldm-common = { path = "pldm-common" }
20+
pldm-interface = { path = "pldm-interface" }
921
bitfield = "0.14.0"
22+
zerocopy = { version = "0.8.17", features = ["derive"] }
23+
24+
[dependencies]
25+
pldm-common.workspace = true
26+
pldm-interface.workspace = true

pldm-common/Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
# Licensed under the Apache-2.0 license
2+
13
[package]
24
name = "pldm-common"
3-
version = "0.1.0"
4-
edition = "2024"
5+
version.workspace = true
6+
edition.workspace = true
7+
authors.workspace = true
58

69
[dependencies]
10+
zerocopy.workspace = true
11+
bitfield.workspace = true
12+
File renamed without changes.
File renamed without changes.

pldm-common/src/lib.rs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
pub fn add(left: u64, right: u64) -> u64 {
2-
left + right
3-
}
1+
// Copyright 2025
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
414

5-
#[cfg(test)]
6-
mod tests {
7-
use super::*;
15+
#![no_std]
816

9-
#[test]
10-
fn it_works() {
11-
let result = add(2, 2);
12-
assert_eq!(result, 4);
13-
}
14-
}
17+
pub mod codec;
18+
pub mod error;
19+
pub mod message;
20+
pub mod protocol;
21+
pub mod util;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
use crate::error::PldmError;
1616
use crate::protocol::base::{
17-
InstanceId, PLDM_MSG_HEADER_LEN, PldmControlCmd, PldmMsgHeader, PldmMsgType, PldmSupportedType,
18-
TransferOperationFlag, TransferRespFlag,
17+
InstanceId, PldmControlCmd, PldmMsgHeader, PldmMsgType, PldmSupportedType,
18+
TransferOperationFlag, TransferRespFlag, PLDM_MSG_HEADER_LEN,
1919
};
2020
use crate::protocol::version::{PldmVersion, ProtocolVersionStr, Ver32};
2121
use zerocopy::{FromBytes, Immutable, IntoBytes};

src/message/firmware_update/activate_fw.rs renamed to pldm-common/src/message/firmware_update/activate_fw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use crate::protocol::base::{
16-
InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType,
16+
InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN,
1717
};
1818
use crate::protocol::firmware_update::FwUpdateCmd;
1919
use zerocopy::{FromBytes, Immutable, IntoBytes};

src/message/firmware_update/apply_complete.rs renamed to pldm-common/src/message/firmware_update/apply_complete.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use crate::error::PldmError;
1616
use crate::protocol::base::{
17-
InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType,
17+
InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN,
1818
};
1919
use crate::protocol::firmware_update::{ComponentActivationMethods, FwUpdateCmd};
2020
use zerocopy::{FromBytes, Immutable, IntoBytes};

src/message/firmware_update/get_fw_params.rs renamed to pldm-common/src/message/firmware_update/get_fw_params.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
use crate::codec::{PldmCodec, PldmCodecError};
1616
use crate::protocol::base::{
17-
InstanceId, PLDM_MSG_HEADER_LEN, PldmMsgHeader, PldmMsgType, PldmSupportedType,
17+
InstanceId, PldmMsgHeader, PldmMsgType, PldmSupportedType, PLDM_MSG_HEADER_LEN,
1818
};
1919
use crate::protocol::firmware_update::{
20-
ComponentParameterEntry, FirmwareDeviceCapability, FwUpdateCmd, MAX_COMPONENT_COUNT,
21-
PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN, PldmFirmwareString,
20+
ComponentParameterEntry, FirmwareDeviceCapability, FwUpdateCmd, PldmFirmwareString,
21+
MAX_COMPONENT_COUNT, PLDM_FWUP_IMAGE_SET_VER_STR_MAX_LEN,
2222
};
2323
use zerocopy::{FromBytes, Immutable, IntoBytes};
2424

0 commit comments

Comments
 (0)