Index: bsps/sparc/include/bsp/apbuart.h
===================================================================
--- bsps/sparc/include/bsp/apbuart.h	(revision aac36d153aa88d666a2a6a7a4a49520e3aec7c17)
+++ bsps/sparc/include/bsp/apbuart.h	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
@@ -21,4 +21,5 @@
 
 #include <ambapp.h>
+#include <grlib.h>
 
 #ifdef __cplusplus
@@ -54,4 +55,13 @@
 #define APBUART_STATUS_RF 0x400
 
+void apbuart_outbyte_polled(
+  struct apbuart_regs *regs,
+  unsigned char ch,
+  int do_cr_on_newline,
+  int wait_sent
+);
+
+int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
+
 #ifdef __cplusplus
 }
Index: bsps/sparc/include/bsp/apbuart_termios.h
===================================================================
--- bsps/sparc/include/bsp/apbuart_termios.h	(revision aac36d153aa88d666a2a6a7a4a49520e3aec7c17)
+++ bsps/sparc/include/bsp/apbuart_termios.h	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
@@ -35,23 +35,4 @@
 const rtems_termios_device_handler apbuart_handler_polled;
 
-/*
- *  apbuart_outbyte_polled
- *
- *  This routine transmits a character using polling.
- */
-void apbuart_outbyte_polled(
-  struct apbuart_regs *regs,
-  unsigned char ch,
-  int do_cr_on_newline,
-  int wait_sent
-);
-
-/*
- *  apbuart_inbyte_nonblocking
- *
- *  This routine polls for a character.
- */
-int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
-
 #ifdef __cplusplus
 }
Index: bsps/sparc/leon3/console/printk_support.c
===================================================================
--- bsps/sparc/leon3/console/printk_support.c	(revision aac36d153aa88d666a2a6a7a4a49520e3aec7c17)
+++ bsps/sparc/leon3/console/printk_support.c	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
@@ -24,5 +24,4 @@
 #include <stdio.h>
 #include <bsp/apbuart.h>
-#include <bsp/apbuart_termios.h>
 
 int leon3_debug_uart_index __attribute__((weak)) = 0;
Index: bsps/sparc/shared/uart/apbuart_cons.c
===================================================================
--- bsps/sparc/shared/uart/apbuart_cons.c	(revision aac36d153aa88d666a2a6a7a4a49520e3aec7c17)
+++ bsps/sparc/shared/uart/apbuart_cons.c	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
@@ -43,10 +43,4 @@
 
 /* LEON3 Low level transmit/receive functions provided by debug-uart code */
-extern void apbuart_outbyte_polled(
-  struct apbuart_regs *regs,
-  unsigned char ch,
-  int do_cr_on_newline,
-  int wait_sent);
-extern int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
 #ifdef LEON3
 extern struct apbuart_regs *leon3_debug_uart; /* The debug UART */
@@ -386,50 +380,4 @@
 #endif
 
-#ifndef LEON3
-/* This routine transmits a character, it will busy-wait until on character
- * fits in the APBUART Transmit FIFO
- */
-void apbuart_outbyte_polled(
-  struct apbuart_regs *regs,
-  unsigned char ch,
-  int do_cr_on_newline,
-  int wait_sent)
-{
-send:
-	while ((regs->status & LEON_REG_UART_STATUS_THE) == 0) {
-		/* Lower bus utilization while waiting for UART */
-		asm volatile ("nop"::);	asm volatile ("nop"::);
-		asm volatile ("nop"::);	asm volatile ("nop"::);
-		asm volatile ("nop"::);	asm volatile ("nop"::);
-		asm volatile ("nop"::);	asm volatile ("nop"::);
-	}
-	regs->data = (unsigned int) ch;
-
-	if ((ch == '\n') && do_cr_on_newline) {
-		ch = '\r';
-		goto send;
-	}
-
-	/* Wait until the character has been sent? */
-	if (wait_sent) {
-		while ((regs->status & LEON_REG_UART_STATUS_THE) == 0)
-			;
-	}
-}
-
-/* This routine polls for one character, return EOF if no character is available */
-int apbuart_inbyte_nonblocking(struct apbuart_regs *regs)
-{
-	if (regs->status & LEON_REG_UART_STATUS_ERR) {
-		regs->status = ~LEON_REG_UART_STATUS_ERR;
-	}
-
-	if ((regs->status & LEON_REG_UART_STATUS_DR) == 0)
-		return EOF;
-
-	return (int)regs->data;
-}
-#endif
-
 static bool first_open(
 	rtems_termios_tty *tty,
Index: bsps/sparc/shared/uart/apbuart_polled.c
===================================================================
--- bsps/sparc/shared/uart/apbuart_polled.c	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
+++ bsps/sparc/shared/uart/apbuart_polled.c	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
@@ -0,0 +1,52 @@
+/*
+ *  COPYRIGHT (c) 2010.
+ *  Cobham Gaisler AB.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+#include <bsp/apbuart.h>
+
+void apbuart_outbyte_polled(
+  struct apbuart_regs *regs,
+  unsigned char ch,
+  int do_cr_on_newline,
+  int wait_sent
+)
+{
+send:
+  while ( (regs->status & APBUART_STATUS_TE) == 0 ) {
+    /* Lower bus utilization while waiting for UART */
+    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
+    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
+    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
+    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
+  }
+
+  if ((ch == '\n') && do_cr_on_newline) {
+    regs->data = (unsigned int) '\r';
+    do_cr_on_newline = 0;
+    goto send;
+  }
+  regs->data = (unsigned int) ch;
+
+  /* Wait until the character has been sent? */
+  if (wait_sent) {
+    while ((regs->status & APBUART_STATUS_TE) == 0)
+      ;
+  }
+}
+
+int apbuart_inbyte_nonblocking(struct apbuart_regs *regs)
+{
+  /* Clear errors */
+  if (regs->status & APBUART_STATUS_ERR)
+    regs->status = ~APBUART_STATUS_ERR;
+
+  if ((regs->status & APBUART_STATUS_DR) == 0)
+    return -1;
+  else
+    return (int) regs->data;
+}
Index: bsps/sparc/shared/uart/apbuart_termios.c
===================================================================
--- bsps/sparc/shared/uart/apbuart_termios.c	(revision aac36d153aa88d666a2a6a7a4a49520e3aec7c17)
+++ bsps/sparc/shared/uart/apbuart_termios.c	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
@@ -243,56 +243,4 @@
 }
 
-/*
- *  apbuart_outbyte_polled
- *
- *  This routine transmits a character using polling.
- */
-void apbuart_outbyte_polled(
-  struct apbuart_regs *regs,
-  unsigned char ch,
-  int do_cr_on_newline,
-  int wait_sent
-)
-{
-send:
-  while ( (regs->status & APBUART_STATUS_TE) == 0 ) {
-    /* Lower bus utilization while waiting for UART */
-    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
-    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
-    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
-    __asm__ volatile ("nop"::); __asm__ volatile ("nop"::);
-  }
-
-  if ((ch == '\n') && do_cr_on_newline) {
-    regs->data = (unsigned int) '\r';
-    do_cr_on_newline = 0;
-    goto send;
-  }
-  regs->data = (unsigned int) ch;
-
-  /* Wait until the character has been sent? */
-  if (wait_sent) {
-    while ((regs->status & APBUART_STATUS_TE) == 0)
-      ;
-  }
-}
-
-/*
- *  apbuart_inbyte_nonblocking
- *
- *  This routine polls for a character.
- */
-int apbuart_inbyte_nonblocking(struct apbuart_regs *regs)
-{
-  /* Clear errors */
-  if (regs->status & APBUART_STATUS_ERR)
-    regs->status = ~APBUART_STATUS_ERR;
-
-  if ((regs->status & APBUART_STATUS_DR) == 0)
-    return -1;
-  else
-    return (int) regs->data;
-}
-
 const rtems_termios_device_handler apbuart_handler_interrupt = {
   .first_open = apbuart_first_open_interrupt,
Index: c/src/lib/libbsp/sparc/leon3/Makefile.am
===================================================================
--- c/src/lib/libbsp/sparc/leon3/Makefile.am	(revision aac36d153aa88d666a2a6a7a4a49520e3aec7c17)
+++ c/src/lib/libbsp/sparc/leon3/Makefile.am	(revision f4424cfb499f56e46a83c3ba9b018d091b2f6088)
@@ -69,4 +69,6 @@
 librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/uart/cons.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/uart/apbuart_cons.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/uart/apbuart_polled.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/uart/apbuart_termios.c
 # debugio
 librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/console/printk_support.c
@@ -117,7 +119,4 @@
 librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/spw/grspw_pkt.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/spw/grspw_router.c
-
-# UART
-librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/uart/apbuart_termios.c
 
 # I2CMST
