From 0496c698b055e899b764f7604b74ca235bf35e8b Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Mon, 23 May 2016 10:22:21 -0600 Subject: [PATCH] Correct compile-time errors in RFC 1201 example --- text/1201-naked-fns.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/1201-naked-fns.md b/text/1201-naked-fns.md index 2e340df4463..2249726fec1 100644 --- a/text/1201-naked-fns.md +++ b/text/1201-naked-fns.md @@ -144,7 +144,7 @@ use std::sync::atomic::{self, AtomicUsize, Ordering}; #[naked] #[cfg(target_arch="x86")] -unsafe fn isr_3() { +unsafe extern "C" fn isr_3() { asm!("pushad call increment_breakpoint_count popad @@ -159,7 +159,7 @@ pub fn increment_breakpoint_count() { bp_count.fetch_add(1, Ordering::Relaxed); } -fn register_isr(vector: u8, handler: fn() -> ()) { /* ... */ } +fn register_isr(vector: u8, handler: unsafe extern "C" fn() -> ()) { /* ... */ } fn main() { register_isr(3, isr_3);