forked from tock/tock
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathCargo.toml
More file actions
350 lines (316 loc) · 10.9 KB
/
Copy pathCargo.toml
File metadata and controls
350 lines (316 loc) · 10.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# Licensed under the Apache License, Version 2.0 or the MIT License.
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Copyright Tock Contributors 2022.
[workspace]
members = [
"arch/cortex-m",
"arch/cortex-v7m",
"arch/cortex-m0",
"arch/cortex-m0p",
"arch/cortex-m3",
"arch/cortex-m33",
"arch/cortex-m4",
"arch/cortex-m7",
"arch/riscv",
"arch/rv32i",
"arch/x86",
"boards/nano_rp2040_connect",
"boards/arty_e21",
"boards/opentitan/earlgrey-cw310",
"boards/esp32-c3-devkitM-1",
"boards/cy8cproto_62_4343_w",
"boards/clue_nrf52840",
"boards/veer_el2_sim",
"boards/hail",
"boards/hifive_inventor",
"boards/hifive1",
"boards/imix",
"boards/imxrt1050-evkb",
"boards/lpc55s69-evk",
"boards/litex/arty",
"boards/litex/sim",
"boards/msp_exp432p401r",
"boards/microbit_v2",
"boards/wm1110dev",
"boards/makepython-nrf52840",
"boards/nordic/nrf52840dk",
"boards/nordic/nrf52840_dongle",
"boards/nordic/nrf52dk",
"boards/sma_q3",
"boards/nucleo_f429zi",
"boards/nucleo_f446re",
"boards/nucleo_u545re_q",
"boards/particle_boron",
"boards/pico_explorer_base",
"boards/raspberry_pi_pico",
"boards/raspberry_pi_pico_2",
"boards/raspberry_pi_pico_w",
"boards/apollo3/redboard_artemis_atp",
"boards/apollo3/redboard_artemis_nano",
"boards/apollo3/lora_things_plus",
"boards/psc3m5_evk",
"boards/redboard_redv",
"boards/stm32f3discovery",
"boards/stm32f412gdiscovery",
"boards/stm32f429idiscovery",
"boards/teensy40",
"boards/nano33ble",
"boards/nano33ble_rev2",
"boards/qemu_i486_q35",
"boards/qemu_rv32_virt",
"boards/weact_f401ccu6/",
"boards/configurations/nrf52840dk/nrf52840dk-test-appid-ecdsap256",
"boards/configurations/nrf52840dk/nrf52840dk-test-appid-sha256",
"boards/configurations/nrf52840dk/nrf52840dk-test-appid-tbf",
"boards/configurations/nrf52840dk/nrf52840dk-test-base",
"boards/configurations/nrf52840dk/nrf52840dk-test-invs",
"boards/configurations/nrf52840dk/nrf52840dk-test-kernel",
"boards/configurations/nrf52840dk/nrf52840dk-test-dynamic-app-load",
"boards/configurations/nrf52840dk/nrf52840dk-test-sha256",
"boards/configurations/microbit_v2/microbit_v2-test-dynamic-app-load",
"boards/tutorials/nrf52840dk-root-of-trust-tutorial",
"boards/tutorials/nrf52840dk-dynamic-apps-and-policies",
"boards/tutorials/nrf52840dk-hotp-tutorial",
"boards/tutorials/nrf52840dk-thread-tutorial",
"boards/lora_e5_mini",
"boards/tutorials/qemu_rv32_virt-tutorial",
"capsules/aes_gcm",
"capsules/ecdsa_sw",
"capsules/core",
"capsules/extra",
"capsules/system",
"chips/apollo3",
"chips/arty_e21_chip",
"chips/e310_g002",
"chips/e310_g003",
"chips/e310x",
"chips/earlgrey",
"chips/esp32",
"chips/esp32-c3",
"chips/imxrt10xx",
"chips/lpc55s6x",
"chips/litex",
"chips/litex_vexriscv",
"chips/lowrisc",
"chips/msp432",
"chips/nrf52",
"chips/nrf52832",
"chips/nrf52833",
"chips/nrf52840",
"chips/nrf5x",
"chips/nrf5x-unsafe",
"chips/pci-x86",
"chips/x86_q35",
"chips/qemu_rv32_virt_chip",
"chips/psc3",
"chips/psoc62xa",
"chips/rp2040",
"chips/rp2350",
"chips/sam4l",
"chips/segger",
"chips/sifive",
"chips/stm32f303xc",
"chips/stm32f401cc",
"chips/stm32f429zi",
"chips/stm32f446re",
"chips/stm32f412g",
"chips/stm32u545",
"chips/stm32u5xx",
"chips/stm32f4xx",
"chips/veer_el2",
"chips/stm32wle5xx",
"chips/stm32wle5jc",
"chips/virtio",
"kernel",
"libraries/enum_primitive",
"libraries/riscv-csr",
"libraries/tock-cells",
"libraries/tickv",
]
exclude = ["tools/"]
resolver = "2"
[workspace.package]
version = "0.2.3-dev"
authors = ["Tock Project Developers <devel@lists.tockos.org>"]
edition = "2021"
[workspace.dependencies]
tock-registers = { version = "0.10.0", default-features = false }
[profile.dev]
panic = "abort"
lto = true
opt-level = "z"
debug = true
[profile.release]
panic = "abort"
lto = true
opt-level = "z"
debug = true
codegen-units = 1
# CLIPPY CONFIGURATION
#
# We first disallow all lints in a particular group, then re-allow each one
# Tock does not comply with or we do not want to use.
#
# For each group there are three sections:
# 1. The first section are lints we don't want with a comment explaining our use
# case for not enabling that lint.
# 2. The second section are lints we may not want, we probably have to see the
# resulting diff.
# 3. The third section are lints that we do want we just need to fixup the code
# to pass the lint checks.
[workspace.lints.clippy]
# RESTRICTION LINTS
restriction = { level = "allow", priority = -1 }
unused_result_ok = "deny"
# COMPLEXITY LINTS
complexity = { level = "deny", priority = -1 }
# Subjective, and complex functions may need many arguments.
too_many_arguments = "allow"
# This is pretty sensitive, even `Result`s with returned buffers trigger this.
# It is not worth us creating types for all of these.
type_complexity = "allow"
# We use options extensively and they can be as clear as if let statements.
option_map_unit_fn = "allow"
# Sometimes the semantic meaning of variables means it is more clear to use
# nonminimal if statements, particularly when matching hardware or datasheets.
nonminimal_bool = "allow"
# Particularly for setting register values, expressing a zero offset can be
# semantically meaningful and encourage consistency between several lines of
# code.
identity-op = "allow"
# Subjective, and for SyscallDrivers sometimes enumerating the specific command
# numbers rather than using a range is semantically more clear.
manual-range-patterns = "allow"
# Particularly when interactive with hardware, including a leading zero can
# often be semantically more clear.
zero_prefixed_literal = "allow"
manual-flatten = "allow"
# STYLE
style = { level = "deny", priority = -1 }
# Sometimes an if block is standalone and shouldn't be merged with an else.
collapsible_else_if = "allow"
# Multiple if blocks can be clearer to express a particular logical flow.
collapsible_if = "allow"
# Sometimes if statements are easier to read than match statements.
comparison_chain = "allow"
# Sometimes it's more clear to have repetition in enum names.
enum-variant-names = "allow"
# For buffers, `.get(0)` (using byte index) makes more sense than `.first()`.
get_first = "allow"
# There are often good reasons to enumerate different states that have the same
# effect.
if_same_then_else = "allow"
# Buffers and objects can have a length of 0, but it isn't necessarily intuitive
# to think of a buffer or those objects as "empty".
len_without_is_empty = "allow"
# Buffer logic often makes more sense with lengths, and not `is_empty()`.
len_zero = "allow"
# Sometimes the borrow checker works better with `match` instead of `.map()`.
manual-map = "allow"
# Syntax like `!(-17..=4).contains(&x)` is just not clear.
manual_range_contains = "allow"
# Match statement is clear, using `matches!()` is not an improvement.
match_like_matches_macro = "allow"
# Sometimes it makes sense to have module in a folder of the same name.
module_inception = "allow"
# Maybe someday we want this, but right now `for i in 0..4` is much more clear
# than using `.iter()` functions like `.skip(n)`.
needless-range-loop = "allow"
# We don't need unused Default implementations.
new_without_default = "allow"
# Using `Result()` is good practice, even if there is no meaning to the error.
result_unit_err = "allow"
# For hardware registers it can make sense to group bits semantically and not
# just in multiples of four.
unusual-byte-groupings = "allow"
# We widely use upper case acronyms for hardware registers and fields.
upper_case_acronyms = "allow"
# Condensing match statements can make code harder to read and inconsistent.
collapsible-match = "allow"
missing_safety_doc = "allow"
# PERF
perf = { level = "deny", priority = -1 }
# Tock extensively uses enums for state machines, and it often is much clearer
# to store objects between states in the state enum rather than as "global"
# variables in the struct itself. Therefore, some enums end up quite large.
large-enum-variant = "allow"
# CARGO
cargo = { level = "deny", priority = -1 }
# Tock includes over 100 crates, and it is just too pedantic to expect each one
# to have full and correct metadata.
cargo_common_metadata = "allow"
# We generally avoid all cargo features, and therefore it isn't intuitive that
# we would expect some features to be enabled by default, so it can make sense
# to have a feature to disable something.
negative-feature-names = "allow"
# NURSERY
nursery = { level = "deny", priority = -1 }
# In some cases we mark `pub(crate)` in a module which isn't exposed outside of
# the crate. This redundancy is OK, and if the module were to be made public
# for some reason in the future the visibility would transparently change.
redundant_pub_crate = "allow"
# Sometimes a `map_or_else()` seems like a better option, but it doesn't always
# pass the borrow checker. if let/else is more reliable.
option_if_let_else = "allow"
# Some OS functions are necessarily complex.
cognitive_complexity = "allow"
branches_sharing_code = "allow"
use_self = "allow"
or_fun_call = "allow"
missing_const_for_fn = "allow"
equatable_if_let = "allow"
derive_partial_eq_without_eq = "allow"
trait_duplication_in_bounds = "allow"
useless_let_if_seq = "allow"
# PEDANTIC
pedantic = { level = "deny", priority = -1 }
doc_markdown = "allow"
missing_errors_doc = "allow"
if_not_else = "allow"
cast_sign_loss = "allow"
too_many_lines = "allow"
must_use_candidate = "allow"
manual_let_else = "allow"
single_match_else = "allow"
inline_always = "allow"
module_name_repetitions = "allow"
unnested-or-patterns = "allow"
redundant_else = "allow"
return_self_not_must_use = "allow"
match_same_arms = "allow"
explicit_iter_loop = "allow"
similar_names = "allow"
unnecessary_wraps = "allow"
manual_assert = "allow"
transmute_ptr_to_ptr = "allow"
struct_excessive_bools = "allow"
fn_params_excessive_bools = "allow"
trivially_copy_pass_by_ref = "allow"
borrow_as_ptr = "allow"
tuple_array_conversions = "allow"
verbose_bit_mask = "allow"
large_types_passed_by_value = "allow"
no_mangle_with_rust_abi = "allow"
struct_field_names = "allow"
needless_continue = "allow"
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_precision_loss = "allow"
range_plus_one = "allow"
missing_panics_doc = "allow"
match_wildcard_for_single_variants = "allow"
unused_self = "allow"
cast-possible-wrap = "allow"
uninlined_format_args = "allow"
unreadable_literal = "allow"
needless_pass_by_value = "allow"
items_after_statements = "allow"
ref_option_ref = "allow"
match_bool = "allow"
redundant_closure_for_method_calls = "allow"
no_effect_underscore_binding = "allow"
iter_without_into_iter = "allow"
semicolon_if_nothing_returned = "allow"
cast_ptr_alignment = "allow"
used_underscore_binding = "allow"
checked_conversions = "allow"