1. 09 2月, 2007 10 次提交
  2. 26 1月, 2007 2 次提交
  3. 09 12月, 2006 1 次提交
    • D
      [PATCH] LOG2: Implement a general integer log2 facility in the kernel · f0d1b0b3
      David Howells 提交于
      This facility provides three entry points:
      
      	ilog2()		Log base 2 of unsigned long
      	ilog2_u32()	Log base 2 of u32
      	ilog2_u64()	Log base 2 of u64
      
      These facilities can either be used inside functions on dynamic data:
      
      	int do_something(long q)
      	{
      		...;
      		y = ilog2(x)
      		...;
      	}
      
      Or can be used to statically initialise global variables with constant values:
      
      	unsigned n = ilog2(27);
      
      When performing static initialisation, the compiler will report "error:
      initializer element is not constant" if asked to take a log of zero or of
      something not reducible to a constant.  They treat negative numbers as
      unsigned.
      
      When not dealing with a constant, they fall back to using fls() which permits
      them to use arch-specific log calculation instructions - such as BSR on
      x86/x86_64 or SCAN on FRV - if available.
      
      [akpm@osdl.org: MMC fix]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Wojtek Kaniewski <wojtekka@toxygen.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f0d1b0b3
  4. 08 12月, 2006 13 次提交
  5. 06 11月, 2006 4 次提交
  6. 28 10月, 2006 1 次提交
  7. 26 10月, 2006 6 次提交
  8. 12 10月, 2006 1 次提交
  9. 05 10月, 2006 2 次提交
    • H
      [PATCH] AVR32: Allow renumbering of serial devices · c194588d
      Haavard Skinnemoen 提交于
      Allow the board to remap actual USART peripheral devices to serial
      devices by calling at32_map_usart(hw_id, serial_line). This ensures
      that even though ATSTK1002 uses USART1 as the first serial port, it
      will still have a ttyS0 device.
      
      This also adds a board-specific early setup hook and moves the
      at32_setup_serial_console() call there from the platform code.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c194588d
    • H
      [PATCH] atmel_serial: Pass fixed register mappings through platform_data · 75d35213
      Haavard Skinnemoen 提交于
      In order to initialize the serial console early, the atmel_serial
      driver had to do a hack where it compared the physical address of the
      port with an address known to be permanently mapped, and used it as a
      virtual address. This got around the limitation that ioremap() isn't
      always available when the console is being initalized.
      
      This patch removes that hack and replaces it with a new "regs" field
      in struct atmel_uart_data that the board-specific code can initialize
      to a fixed virtual mapping for platform devices where this is possible.
      It also initializes the DBGU's regs field with the address the driver
      used to check against.
      
      On AVR32, the "regs" field is initialized from the physical base
      address when this it can be accessed through a permanently 1:1 mapped
      segment, i.e. the P4 segment.
      
      If regs is NULL, the console initialization is delayed until the "real"
      driver is up and running and ioremap() can be used.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      Acked-by: NAndrew Victor <andrew@sanpeople.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      75d35213