/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file "COPYING" in the main directory of this archive3* for more details.4*5* Copyright (C) 1996 David S. Miller ([email protected])6* Compatibility with board caches, Ulf Carlsson7*/8#include <linux/kernel.h>9#include <asm/sgialib.h>10#include <asm/bcache.h>11#include <asm/setup.h>1213#if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32)14/*15* For 64bit kernels working with a 32bit ARC PROM pointer arguments16* for ARC calls need to reside in CKEG0/1. But as soon as the kernel17* switches to its first kernel thread stack is set to an address in18* XKPHYS, so anything on stack can't be used anymore. This is solved19* by using a * static declaration variables are put into BSS, which is20* linked to a CKSEG0 address. Since this is only used on UP platforms21* there is no spinlock needed22*/23#define O32_STATIC static24#else25#define O32_STATIC26#endif2728/*29* IP22 boardcache is not compatible with board caches. Thus we disable it30* during romvec action. Since r4xx0.c is always compiled and linked with your31* kernel, this shouldn't cause any harm regardless what MIPS processor you32* have.33*34* The ARC write and read functions seem to interfere with the serial lines35* in some way. You should be careful with them.36*/3738void prom_putchar(char c)39{40O32_STATIC ULONG cnt;41O32_STATIC CHAR it;4243it = c;4445bc_disable();46ArcWrite(1, &it, 1, &cnt);47bc_enable();48}4950char prom_getchar(void)51{52O32_STATIC ULONG cnt;53O32_STATIC CHAR c;5455bc_disable();56ArcRead(0, &c, 1, &cnt);57bc_enable();5859return c;60}616263