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]
Date:	Mon, 6 Jul 2009 11:43:21 +0100
From:	Ralf Baechle <ralf@...ux-mips.org>
To:	Wu Zhangjin <wuzhangjin@...il.com>
Cc:	linux-kernel@...r.kernel.org, linux-mips@...ux-mips.org,
	Jason Wessel <jason.wessel@...driver.com>,
	Wu Zhangjin <wuzj@...ote.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 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()?

> +}
> +
> +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 *.

> +	while ((serial_in(uart_base, UART_LSR) & UART_LSR_THRE) == 0)

  Ralf
--
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