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:	Fri, 01 May 2009 14:25:14 +0200
From:	Michal Simek <monstr@...str.eu>
To:	Arnd Bergmann <arnd@...db.de>
CC:	linux-arch@...r.kernel.org,
	Remis Lima Baima <remis.developer@...glemail.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/27] asm-generic: add legacy I/O header files

Arnd Bergmann wrote:
> On Friday 01 May 2009, Michal Simek wrote:
>>> +/*
>>> + * CLOCK_TICK_RATE is highly PC-specific and should not
>>> + * be used in portable code. 1193182 is the value for the
>>> + * original i8253 PIC.
>>> + */
>>> +#ifndef CLOCK_TICK_RATE
>>> +#define CLOCK_TICK_RATE                1193182
>>> +#endif
>>
>> Why is this in generic code?
> 
> CLOCK_TICK_RATE is only used in a few places:
> 
> drivers/char/vt_ioctl.c:                        arg = CLOCK_TICK_RATE / arg;
> drivers/char/vt_ioctl.c:                        count = CLOCK_TICK_RATE / count;
> drivers/clocksource/acpi_pm.c:  ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10))
> drivers/input/joystick/analog.c:#define DELTA(x,y)      (cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0
> drivers/rtc/rtc-pxa.c:#define TIMER_FREQ                CLOCK_TICK_RATE
> drivers/serial/serial_ks8695.c:         .uartclk        = CLOCK_TICK_RATE * 16,
> drivers/watchdog/davinci_wdt.c: timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) & 0xffffffff);
> drivers/watchdog/davinci_wdt.c: timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) >> 32);
> drivers/watchdog/ks8695_wdt.c:  unsigned long tval = wdt_time * CLOCK_TICK_RATE;
> include/linux/jiffies.h:#define LATCH  ((CLOCK_TICK_RATE + HZ/2) / HZ)  /* For divider */
> include/linux/jiffies.h:#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
> include/linux/timex.h: *        Moved CLOCK_TICK_RATE, CLOCK_TICK_FACTOR and FINETUNE to asm/timex.h
> sound/oss/pas2_pcm.c:           foo = ((CLOCK_TICK_RATE / 2) + (arg / 2)) / arg;
> sound/oss/pas2_pcm.c:           arg = ((CLOCK_TICK_RATE / 2) + (foo / 2)) / foo;
> sound/oss/pas2_pcm.c:           foo = (CLOCK_TICK_RATE + (arg / 2)) / arg;
> sound/oss/pas2_pcm.c:           arg = (CLOCK_TICK_RATE + (foo / 2)) / foo;
> 
> All of these are either PC-specific, or they don't actually care
> about the specific value. Most architectures just use the
> value from the IBM PC, so we might as well make that the generic
> default.

ok. Let's move out from arch to generic location.

Michal

> 
> Alternatively, we could also move the definition back to linux/timex.h
> and allow asm/timex.h to be empty.

> 
> 	Arnd <><


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
--
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