aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-semihosting/src/export.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2022-08-12 00:34:12 +0000
committerGravatar GitHub <noreply@github.com> 2022-08-12 00:34:12 +0000
commit0e530549de322684c50e858c6bb985afb5479dbe (patch)
tree21efc15cdadf74ac03a2e210f15eff1542f33e82 /cortex-m-semihosting/src/export.rs
parente46e2310adc86a5a09a1858a23ecdde2a2c6963f (diff)
parent3a15a6b4b320fa328e8ab99c31f81536960dd280 (diff)
downloadcortex-m-0e530549de322684c50e858c6bb985afb5479dbe.tar.gz
cortex-m-0e530549de322684c50e858c6bb985afb5479dbe.tar.zst
cortex-m-0e530549de322684c50e858c6bb985afb5479dbe.zip
Merge #447
447: Add implementation for critical-section 1.0 r=adamgreig a=Dirbaio Picking up #433 since it seems stalled. Changes from #433 are: - Update to `critical-section 1.0.0-alpha.2` - Use `bool` restore token - Name Cargo feature `critical-section-single-core`. TODO before merging: - [x] Wait for `critical-section 1.0` release https://github.com/rust-embedded/critical-section/pull/19 Co-Authored-By: Markus Reiter `@reitermarkus` Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Diffstat (limited to 'cortex-m-semihosting/src/export.rs')
-rw-r--r--cortex-m-semihosting/src/export.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/cortex-m-semihosting/src/export.rs b/cortex-m-semihosting/src/export.rs
index 0bbd09f..46e70e7 100644
--- a/cortex-m-semihosting/src/export.rs
+++ b/cortex-m-semihosting/src/export.rs
@@ -2,14 +2,12 @@
use core::fmt::{self, Write};
-use cortex_m::interrupt;
-
use crate::hio::{self, HostStream};
static mut HSTDOUT: Option<HostStream> = None;
pub fn hstdout_str(s: &str) {
- let _result = interrupt::free(|_| unsafe {
+ let _result = critical_section::with(|_| unsafe {
if HSTDOUT.is_none() {
HSTDOUT = Some(hio::hstdout()?);
}
@@ -19,7 +17,7 @@ pub fn hstdout_str(s: &str) {
}
pub fn hstdout_fmt(args: fmt::Arguments) {
- let _result = interrupt::free(|_| unsafe {
+ let _result = critical_section::with(|_| unsafe {
if HSTDOUT.is_none() {
HSTDOUT = Some(hio::hstdout()?);
}
@@ -31,7 +29,7 @@ pub fn hstdout_fmt(args: fmt::Arguments) {
static mut HSTDERR: Option<HostStream> = None;
pub fn hstderr_str(s: &str) {
- let _result = interrupt::free(|_| unsafe {
+ let _result = critical_section::with(|_| unsafe {
if HSTDERR.is_none() {
HSTDERR = Some(hio::hstderr()?);
}
@@ -41,7 +39,7 @@ pub fn hstderr_str(s: &str) {
}
pub fn hstderr_fmt(args: fmt::Arguments) {
- let _result = interrupt::free(|_| unsafe {
+ let _result = critical_section::with(|_| unsafe {
if HSTDERR.is_none() {
HSTDERR = Some(hio::hstderr()?);
}
on value='jarred/wip-more-reliable'>jarred/wip-more-reliable Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/defines.zig (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-02-15Make sure we test * in tesconfigGravatar Jarred Sumner 2-1/+3
2023-02-15don't return an error thereGravatar Jarred Sumner 2-1/+3
2023-02-15Fix castGravatar Jarred Sumner 1-15/+17
2023-02-15ensure we allocate for > 6 argumentsGravatar Jarred Sumner 1-6/+13
2023-02-15Update async_hooks.exports.jsGravatar Jarred Sumner 1-2/+2
2023-02-15workaround prisma's usage of `eval("__dirname")`Gravatar Jarred Sumner 1-1/+23
2023-02-15some cleanupGravatar Jarred Sumner 2-15/+9
2023-02-15ED25519 WebCrypto (#1971)Gravatar Jarred Sumner 12-11/+1167
2023-02-14Fix up async_hooks polyfillGravatar Jarred Sumner 2-8/+63
2023-02-14Add temporary polyfill for async_hooksGravatar Jarred Sumner 5-108/+324
2023-02-14:mask: async_hooksGravatar Jarred Sumner 1-0/+4
2023-02-14[install] link network-delayed `.bin` scripts correctly (#2076)Gravatar Alex Lam S.L 3-16/+21
2023-02-14don't break esbuildGravatar Jarred Sumner 7-75/+50
2023-02-14Add workaround for `tls` and `worker_threads`Gravatar Jarred Sumner 3-1/+64
2023-02-14[install] improve `package.json` validation (#2074)Gravatar Alex Lam S.L 6-104/+342
2023-02-14[WIP] fix(node:fs): export `fs.ReadStream` and `fs.WriteStream` (#1798)Gravatar Derrick Farris 4-72/+326
2023-02-14Reject with error when invalid fetch() body (#2047)Gravatar Eric Zhang 2-12/+44
2023-02-13fix(FormData): make String explicit, thanks @dylan-conway (#2065)Gravatar Derrick Farris 1-1/+1
2023-02-13fix(FormData): add string literal operator (#2064)Gravatar Derrick Farris 1-2/+2
2023-02-13Add pretty printer for FormDataGravatar Jarred Sumner 5-1/+101
2023-02-13Add dynamic port assigning to Bun.serve (#2062)Gravatar MichaƂ Warda 3-5/+40
2023-02-13feat(napi): add `napi_get_value_bigint_words` (#2061)Gravatar Derrick Farris 3-0/+44
2023-02-13Fixes https://github.com/oven-sh/bun/issues/1456Gravatar Jarred Sumner 8-1/+148