Skip to content

Commit a84d201

Browse files
committed
Mention that returning an execution resume address in unsafe.
1 parent e4aa00a commit a84d201

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

cortex-a-rt/src/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@
221221
//! }
222222
//! ```
223223
//!
224-
//! Or it can return the address to return to:
224+
//! Or it can return an address where execution should resume after the
225+
//! Exception handler is complete (which is unsafe):
225226
//!
226227
//! ```rust
227228
//! #[unsafe(no_mangle)]
@@ -232,8 +233,8 @@
232233
//! ```
233234
//!
234235
//! You can create a `_prefetch_abort_handler` function by using the
235-
//! `#[exception(PrefetchAbort)]` macro on an unsafe Rust function with the
236-
//! appropriate arguments and return type.
236+
//! `#[exception(PrefetchAbort)]` macro on a Rust function with the appropriate
237+
//! arguments and return type.
237238
//!
238239
//! ```rust
239240
//! use cortex_a_rt::exception;
@@ -278,7 +279,8 @@
278279
//! }
279280
//! ```
280281
//!
281-
//! Or it can return the address to return to:
282+
//! Or it can return an address where execution should resume after the
283+
//! Exception handler is complete (which is unsafe):
282284
//!
283285
//! ```rust
284286
//! #[unsafe(no_mangle)]
@@ -289,8 +291,8 @@
289291
//! ```
290292
//!
291293
//! You can create a `_data_abort_handler` function by using the
292-
//! `#[exception(DataAbort)]` macro on an unsafe Rust function with the
293-
//! appropriate arguments and return type.
294+
//! `#[exception(DataAbort)]` macro on a Rust function with the appropriate
295+
//! arguments and return type.
294296
//!
295297
//! ```rust
296298
//! use cortex_a_rt::exception;

cortex-r-rt/src/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@
220220
//! }
221221
//! ```
222222
//!
223-
//! Or it can return the address to return to:
223+
//! Or it can return an address where execution should resume after the
224+
//! Exception handler is complete (which is unsafe):
224225
//!
225226
//! ```rust
226227
//! #[unsafe(no_mangle)]
@@ -231,8 +232,8 @@
231232
//! ```
232233
//!
233234
//! You can create a `_prefetch_abort_handler` function by using the
234-
//! `#[exception(PrefetchAbort)]` macro on an unsafe Rust function with the
235-
//! appropriate arguments and return type.
235+
//! `#[exception(PrefetchAbort)]` macro on a Rust function with the appropriate
236+
//! arguments and return type.
236237
//!
237238
//! ```rust
238239
//! use cortex_a_rt::exception;
@@ -277,7 +278,8 @@
277278
//! }
278279
//! ```
279280
//!
280-
//! Or it can return the address to return to:
281+
//! Or it can return an address where execution should resume after the
282+
//! Exception handler is complete (which is unsafe):
281283
//!
282284
//! ```rust
283285
//! #[unsafe(no_mangle)]
@@ -288,8 +290,8 @@
288290
//! ```
289291
//!
290292
//! You can create a `_data_abort_handler` function by using the
291-
//! `#[exception(DataAbort)]` macro on an unsafe Rust function with the
292-
//! appropriate arguments and return type.
293+
//! `#[exception(DataAbort)]` macro on a Rust function with the appropriate
294+
//! arguments and return type.
293295
//!
294296
//! ```rust
295297
//! use cortex_a_rt::exception;

0 commit comments

Comments
 (0)