From patchwork Fri Jun 25 15:44:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: ARM: semi-hosting support for stderr Date: Fri, 25 Jun 2010 05:44:10 -0000 From: Christophe LYON X-Patchwork-Id: 56935 Message-Id: <4C24CECA.1040308@st.com> To: Hello, I propose this small patch so that ARM semi-hosting handles stderr as expected when linking with Newlib/libgloss. Christophe diff --git a/arm-semi.c b/arm-semi.c index 9549e6c..6874036 100644 --- a/arm-semi.c +++ b/arm-semi.c @@ -211,8 +211,11 @@ uint32_t do_arm_semihosting(CPUState *env) if (strcmp(s, ":tt") == 0) { if (ARG(1) < 4) return STDIN_FILENO; - else + else if (ARG(1) == 4) return STDOUT_FILENO; + else + return STDERR_FILENO; /* See newlib/libgloss + implementation. */ } if (use_gdb_syscalls()) { gdb_do_syscall(arm_semi_cb, "open,%s,%x,1a4", ARG(0),