Skip to content

Commit

Permalink
Add MPL license headers to source files.
Browse files Browse the repository at this point in the history
I always dislike having headers like this, but for MPL2 in particular
this is the right thing to do, since it applies at a file level.
  • Loading branch information
cbiffle committed May 5, 2024
1 parent a7a3213 commit 04f57f2
Show file tree
Hide file tree
Showing 31 changed files with 124 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/rp2040/minimal/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Minimal example of using `lilos` to blink an LED at 1Hz on the
//! Raspberry Pi Pico board.
//!
Expand Down
4 changes: 4 additions & 0 deletions examples/stm32f4/blinky/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! More complex LED-blinking demo using parameterized tasks.
//!
//! This blinks four LEDs on the STM32F4DISCOVERY board. Each LED uses the same
Expand Down
4 changes: 4 additions & 0 deletions examples/stm32f4/minimal/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Minimal example of using `lilos` to blink an LED at 1Hz on the
//! STM32F4DISCOVERY board.
//!
Expand Down
4 changes: 4 additions & 0 deletions examples/stm32f4/uart-echo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! An example of receiving and retransmitting bytes through a UART on the
//! STM32F4xx.
//!
Expand Down
4 changes: 4 additions & 0 deletions examples/stm32g031/minimal/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Minimal example of using `lilos` to blink an LED at 1Hz on the
//! NUCLEO-STM32G031 board.
//!
Expand Down
4 changes: 4 additions & 0 deletions examples/stm32h7/minimal/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Minimal example of using `lilos` to blink an LED at 1Hz on the
//! STM32H7 NUCLEO board.
//!
Expand Down
4 changes: 4 additions & 0 deletions examples/stm32h7/uart-echo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! An example of receiving and retransmitting bytes through a UART on the
//! STM32H7xx.
//!
Expand Down
4 changes: 4 additions & 0 deletions handoff/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Mechanism for handing data from one task to another, minimizing copies.
//!
//! This crate provides the `Handoff` abstraction for `lilos`.
Expand Down
4 changes: 4 additions & 0 deletions list/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! A no-allocation wait-list and associated utility code.
//!
//! This crates provides a doubly-linked intrusive list for tracking timers or
Expand Down
4 changes: 4 additions & 0 deletions os/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

fn main() {
match std::env::var("TARGET").unwrap().as_str() {
"thumbv7m-none-eabi" | "thumbv7em-none-eabi" | "thumbv7em-none-eabihf" => {
Expand Down
4 changes: 4 additions & 0 deletions os/src/atomic.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! A collection of atomic "polyfill" routines, to use a term from JavaScript.
//!
//! ARMv6-M processors like the Cortex-M0 don't support the fancier atomic
Expand Down
4 changes: 4 additions & 0 deletions os/src/exec.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! The async runtime executor, plus inter-task communication tools.
//!
//! **Note:** for our purposes, a _task_ is an independent top-level future
Expand Down
4 changes: 4 additions & 0 deletions os/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! A simple but powerful `async` RTOS based around Rust `Future`s.
//!
//! This provides a lightweight operating environment for running async Rust
Expand Down
4 changes: 4 additions & 0 deletions os/src/list.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Doubly-linked intrusive lists for scheduling and waking (old version).
//!
//! **Please use the `lilos_list` crate instead. It's better in literally every
Expand Down
4 changes: 4 additions & 0 deletions os/src/mutex.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Fair mutex that must be pinned.
//!
//! This implements a mutex (a kind of lock) guarding a value of type `T`. This
Expand Down
4 changes: 4 additions & 0 deletions os/src/spsc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! A queue for moving data from one future/task into another.
//!
//! This is a "single-producer, single-consumer" queue that splits into separate
Expand Down
4 changes: 4 additions & 0 deletions os/src/time.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Timekeeping using the SysTick Timer.
//!
//! **Note:** this entire module is only available if the `systick` feature is
Expand Down
4 changes: 4 additions & 0 deletions os/src/util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Utility code for use by applications.
//!
//! Like `atomic`, this module exposes odds and ends that might be useful for
Expand Down
4 changes: 4 additions & 0 deletions rwlock/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! A [read-write lock] for use with [`lilos`].
//!
//! There's a small family of related types in this here crate:
Expand Down
4 changes: 4 additions & 0 deletions semaphore/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! A [counting semaphore] for use with [`lilos`].
//!
//! See the docs on [`Semaphore`] for more details.
Expand Down
4 changes: 4 additions & 0 deletions testsuite/lm3s6965/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! OS test suite, LM3S6965 wrapper.

#![no_std]
Expand Down
4 changes: 4 additions & 0 deletions testsuite/src/handoff.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use lilos_handoff::Handoff;

pub async fn test_create_drop() {
Expand Down
4 changes: 4 additions & 0 deletions testsuite/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! OS test suite.
//!
//! The test suite is SoC-independent.
Expand Down
4 changes: 4 additions & 0 deletions testsuite/src/list.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Tests for the `List` and `Node` types.

#![allow(clippy::bool_assert_comparison)]
Expand Down
4 changes: 4 additions & 0 deletions testsuite/src/mutex.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use core::pin::{Pin, pin};
use core::task::Poll;

Expand Down
4 changes: 4 additions & 0 deletions testsuite/src/rwlock.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use core::pin::pin;

use lilos_rwlock::RwLock;
Expand Down
4 changes: 4 additions & 0 deletions testsuite/src/semaphore.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use core::pin::pin;

use lilos_semaphore::{Semaphore, ScopedSemaphore};
Expand Down
4 changes: 4 additions & 0 deletions testsuite/src/spsc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use core::cell::Cell;
use core::mem::MaybeUninit;
use core::ptr::addr_of_mut;
Expand Down
4 changes: 4 additions & 0 deletions testsuite/stm32f3/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! OS test suite, STM32F303 wrapper.

#![no_std]
Expand Down
4 changes: 4 additions & 0 deletions testsuite/stm32f4/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! OS test suite, STM32F407 wrapper.

#![no_std]
Expand Down
4 changes: 4 additions & 0 deletions testsuite/stm32g0/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! OS test suite, STM32G0 wrapper.

#![no_std]
Expand Down

0 comments on commit 04f57f2

Please sign in to comment.