lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1246888633.30387.9.camel@falcon>
Date:	Mon, 06 Jul 2009 21:57:13 +0800
From:	Wu Zhangjin <wuzhangjin@...il.com>
To:	Ralf Baechle <ralf@...ux-mips.org>
Cc:	linux-kernel@...r.kernel.org, linux-mips@...ux-mips.org,
	Jason Wessel <jason.wessel@...driver.com>,
	Yan Hua <yanh@...ote.com>,
	Philippe Vachon <philippe@...pig.ca>,
	Zhang Le <r0bertz@...too.org>,
	Zhang Fuxin <zhangfx@...ote.com>,
	loongson-dev <loongson-dev@...glegroups.com>,
	Liu Junliang <liujl@...ote.com>,
	Erwan Lerale <erwan@...scow.com>,
	Arnaud Patard <apatard@...driva.com>
Subject: Re: [PATCH v4 03/16] [loongson] early_printk: add new implmentation

On Mon, 2009-07-06 at 11:43 +0100, Ralf Baechle wrote:
> On Thu, Jul 02, 2009 at 11:20:20PM +0800, Wu Zhangjin wrote:
> 
> > +#include <asm/mips-boards/bonito64.h>
> > +
> > +#define UART_BASE (BONITO_PCIIO_BASE + 0x3f8)
> > +
> > +#define PORT(base, offset) (u8 *)(base + offset)
> > +
> > +static inline unsigned int serial_in(phys_addr_t base, int offset)
> > +{
> > +	return readb(PORT(base, offset));
> > +}
> > +
> > +static inline void serial_out(phys_addr_t base, int offset, int value)
> > +{
> > +	writeb(value, PORT(base, offset));
> 
> Why not inb(0x3f8, + offset) rsp. outb()?
> 

because yeeloong laptop use the serial port of cpu, which have different
base address: 0x1ff000000 + 0x3f8, to share the same source code between
yeeloong, fuloong2f(0x1fd00000 + 0x2f8) and fuloong2e(0x1fd00000 +
0x3f8), I use PORT(base, offset) here and use readb/writeb instead of
inb/outb. so, here is only a preparation for future yeeloong2f support.

> > +}
> > +
> > +void prom_putchar(char c)
> > +{
> > +	phys_addr_t uart_base =
> > +		(phys_addr_t) ioremap_nocache(UART_BASE, 8);
> 
> ioremap_nocache returns a virtual address, not a physical address, so
> this type should probably be unsigned char *.
> 

okay, I will change it.

Thanks!
Wu Zhangjin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ