Skip to content

Commit

Permalink
Fix whitespace inconsistency in Idol files (#1705)
Browse files Browse the repository at this point in the history
There should be no non-whitespace changes in this PR!

- Always use 4x spaces for indentation
- Don't include empty `args: {}`
- Don't include a space before `:` or after `(`
  • Loading branch information
mkeeter authored Apr 3, 2024
1 parent 588c7d5 commit 7b5fea3
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 143 deletions.
5 changes: 4 additions & 1 deletion idl/attest.idol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Interface(
"cert": (
doc: "Get a cert from the RoT-R",
args: {
"index" : "u32",
"index" : "u32",
"offset" : "u32",
},
leases: {
Expand Down Expand Up @@ -71,6 +71,7 @@ Interface(
),
"log_len": (
doc: "Get length of the serialized measurement log",
args: {},
reply: Result(
ok: "u32",
err: Complex("AttestError"),
Expand All @@ -80,6 +81,7 @@ Interface(
),
"attest": (
doc: "Get an attestation",
args: {},
leases: {
"nonce": (type: "[u8]", read: true, max_len: Some(128)),
"dest": (type: "[u8]", write: true),
Expand All @@ -92,6 +94,7 @@ Interface(
),
"attest_len": (
doc: "Get the length of an attestation",
args: {},
reply: Result(
ok: "u32",
err: Complex("AttestError"),
Expand Down
1 change: 1 addition & 0 deletions idl/gimlet-seq.idol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Interface(
ops: {
"get_state": (
doc: "Return the power state",
args: {},
reply: Simple((
type: "drv_gimlet_state::PowerState",
recv: FromPrimitive("u8"),
Expand Down
2 changes: 1 addition & 1 deletion idl/ignition.idol
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Interface(
err: CLike("drv_ignition_api::IgnitionError"),
),
),
"link_events": (
"link_events": (
doc: "Return all transceiver events for the given port",
args: {
"port": "u8",
Expand Down
83 changes: 41 additions & 42 deletions idl/lpc55-pins.idol
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
Interface(
name: "Pins",
ops: {
"iocon_configure_raw": (
args : {
"pin": ( type : "Pin", recv: FromPrimitive("u32")),
"conf": "u32",
},
reply: Simple("()"),
idempotent: true,
),
"set_dir": (
args: {
"pin": ( type : "Pin", recv: FromPrimitive("u32")),
"dir": ( type: "Direction", recv: FromPrimitive("u32")),
},
reply: Simple("()"),
idempotent: true,
),
"set_val": (
args: {
"pin": ( type : "Pin", recv: FromPrimitive("u32")),
"val": ( type : "Value", recv: FromPrimitive("u8")),
},
reply: Simple("()"),
idempotent: true,
),
"read_val": (
args: {
"pin": ( type : "Pin", recv: FromPrimitive("u32")),
},
reply: Simple((type : "Value", recv: FromPrimitive("u8"))),
idempotent: true,
),
"toggle": (
args: {
"pin": ( type : "Pin", recv: FromPrimitive("u32")),
},
reply: Result(
ok: "()",
err: ServerDeath,
)
),

}
"iocon_configure_raw": (
args: {
"pin": (type: "Pin", recv: FromPrimitive("u32")),
"conf": "u32",
},
reply: Simple("()"),
idempotent: true,
),
"set_dir": (
args: {
"pin": (type: "Pin", recv: FromPrimitive("u32")),
"dir": (type: "Direction", recv: FromPrimitive("u32")),
},
reply: Simple("()"),
idempotent: true,
),
"set_val": (
args: {
"pin": (type: "Pin", recv: FromPrimitive("u32")),
"val": (type: "Value", recv: FromPrimitive("u8")),
},
reply: Simple("()"),
idempotent: true,
),
"read_val": (
args: {
"pin": (type: "Pin", recv: FromPrimitive("u32")),
},
reply: Simple((type: "Value", recv: FromPrimitive("u8"))),
idempotent: true,
),
"toggle": (
args: {
"pin": (type: "Pin", recv: FromPrimitive("u32")),
},
reply: Result(
ok: "()",
err: ServerDeath,
)
),
}
)
41 changes: 21 additions & 20 deletions idl/lpc55-update.idol
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Interface(
ops: {
"block_size": (
doc: "Get the block size for the update API. This is the length expected for the `write_one_block` call",
args: { },
args: {},
reply: Result(
ok: "usize",
err: CLike("drv_update_api::UpdateError"),
),
),
"prep_image_update": (
doc: "Do any necessary preparation for writing the image. This may include erasing flash and unlocking registers",
args : {
args: {
"image_type": "UpdateTarget",
},
reply : Result(
reply: Result(
ok: "()",
err: CLike("drv_update_api::UpdateError"),
),
Expand All @@ -25,9 +25,9 @@ Interface(
"write_one_block": (
doc: "Write a single block of an update image to the designated location.",
args: {
"block_num" : "usize",
"block_num": "usize",
},
leases : {
leases: {
"block": (type: "[u8]", read: true, max_len: Some(1024)),
},
reply: Result (
Expand All @@ -37,31 +37,31 @@ Interface(
),
"abort_update": (
doc: "Cancel the current update in progress. Must call prep_image_update again before restarting.",
args : { },
reply : Result(
args: {},
reply: Result(
ok: "()",
err: CLike("drv_update_api::UpdateError"),
),
),
"finish_image_update": (
doc: "Do any necessary work post image write",
args : { },
reply : Result(
args: {},
reply: Result(
ok: "()",
err: CLike("drv_update_api::UpdateError"),
),
),
"current_version": (
doc: "Get the current image version",
args : { },
reply : Simple("ImageVersion"),
args: {},
reply: Simple("ImageVersion"),
idempotent: true,
encoding: Hubpack
),
"status": (
doc: "Get info about installed images (deprecated - use rot_boot_info)",
args: { },
reply : Result(
args: {},
reply: Result(
ok: "stage0_handoff::RotBootState",
err: Complex("HandoffDataLoadError"),
),
Expand All @@ -70,8 +70,8 @@ Interface(
),
"rot_boot_info": (
doc: "RoT Boot selection and preference info",
args: { },
reply : Result(
args: {},
reply: Result(
ok: "RotBootInfo",
err: CLike("drv_update_api::UpdateError")
),
Expand Down Expand Up @@ -112,7 +112,7 @@ Interface(
"slot": "SlotId",
"duration": "SwitchDuration",
},
reply : Result(
reply: Result(
ok: "()",
err: CLike("drv_update_api::UpdateError"),
),
Expand All @@ -121,7 +121,8 @@ Interface(
),
"reset": (
doc: "Reset unless an update is in progress.",
reply : Result(
args: {},
reply: Result(
ok: "()",
err: CLike("drv_update_api::UpdateError"),
),
Expand All @@ -131,9 +132,9 @@ Interface(
"read_rot_page": (
doc: "Read CMPA/CFPA page",
args: {
"page": "RotPage",
},
leases : {
"page": "RotPage",
},
leases: {
"data": (type: "[u8]", write: true, max_len: Some(512)),
},
reply: Result (
Expand Down
12 changes: 6 additions & 6 deletions idl/sbrmi.idol
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
Interface(
name: "Sbrmi",
ops: {
"nthreads": (
"nthreads": (
reply: Result(
ok: "u8",
err: CLike("SbrmiError"),
),
idempotent: true,
),
"enabled": (
),
"enabled": (
reply: Result(
ok: "[u8; 16]",
err: CLike("SbrmiError"),
),
idempotent: true,
),
"alert": (
),
"alert": (
reply: Result(
ok: "[u8; 16]",
err: CLike("SbrmiError"),
),
idempotent: true,
),
),
"cpuid": (
args: {
"thread": "u8",
Expand Down
2 changes: 2 additions & 0 deletions idl/sidecar-seq.idol
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Interface(
),
"tofino_seq_state": (
doc: "Return the Tofino sequencer state",
args: {},
reply: Result(
ok: (
type: "TofinoSeqState",
Expand All @@ -39,6 +40,7 @@ Interface(
),
"tofino_seq_error": (
doc: "Return the Tofino sequencer error, if any",
args: {},
reply: Result(
ok: (
type: "TofinoSeqError",
Expand Down
Loading

0 comments on commit 7b5fea3

Please sign in to comment.