From: Rob Landley
Replace kernel/timeconst.pl with kernel/timeconst.sh. The new shell script
is much simpler, about 1/4 the size, and runs on Red Hat 9 from 2003.
It requires a shell which can do 64 bit math, such as bash, busybox ash,
or dash running on a 64 bit host.
Changes from previous version:
Redo ADJ32 math to avoid integer overflow for small HZ sizes (such as 24 or
122). In the pathological case (HZ=1) both versions now produce
USEC_TO_HZ_ADJ32 of 0x779c842fa. (See source comments for details.)
Also expand usage message, add error message when no 64 bit math available in
shell (and suggest some shells that support it), add whitespace around
operators in equations, added underscores before __KERNEL_TIMECONST_H, change
makefile so script is responsible for creating output file, make script delete
output file on error, change shebang to #!/bin/sh and test with dash and bash.
Signed-off-by: Rob Landley
---
kernel/Makefile |4
kernel/timeconst.pl | 378 --
kernel/timeconst.sh | 149
3 files changed, 151 insertions(+), 380 deletions(-)
--- linux-2.6.28/kernel/timeconst.pl2008-12-24 17:26:37.0 -0600
+++ /dev/null 2008-11-21 04:46:41.0 -0600
@@ -1,378 +0,0 @@
-#!/usr/bin/perl
-# ---
-#
-# Copyright 2007-2008 rPath, Inc. - All Rights Reserved
-#
-# This file is part of the Linux kernel, and is made available under
-# the terms of the GNU General Public License version 2 or (at your
-# option) any later version; incorporated herein by reference.
-#
-# ---
-#
-
-#
-# Usage: timeconst.pl HZ > timeconst.h
-#
-
-# Precomputed values for systems without Math::BigInt
-# Generated by:
-# timeconst.pl --can 24 32 48 64 100 122 128 200 250 256 300 512 1000 1024 1200
-%canned_values = (
- 24 => [
- '0xa6ab','0x2aa',26,
- 125,3,
- '0xc49ba5e4','0x1fbe76c8b4',37,
- 3,125,
- '0xa2c2aaab','0x',16,
- 125000,3,
- '0xc9539b89','0x7fffbce4217d',47,
- 3,125000,
- ], 32 => [
- '0xfa00','0x600',27,
- 125,4,
- '0x83126e98','0xfdf3b645a',36,
- 4,125,
- '0xf424','0x0',17,
- 31250,1,
- '0x8637bd06','0x3fff79c842fa',46,
- 1,31250,
- ], 48 => [
- '0xa6ab','0x6aa',27,
- 125,6,
- '0xc49ba5e4','0xfdf3b645a',36,
- 6,125,
- '0xa2c2aaab','0x1',17,
- 62500,3,
- '0xc9539b89','0x3fffbce4217d',46,
- 3,62500,
- ], 64 => [
- '0xfa00','0xe00',28,
- 125,8,
- '0x83126e98','0x7ef9db22d',35,
- 8,125,
- '0xf424','0x0',18,
- 15625,1,
- '0x8637bd06','0x1fff79c842fa',45,
- 1,15625,
- ], 100 => [
- '0xa000','0x0',28,
- 10,1,
- '0xcccd','0x7',35,
- 1,10,
- '0x9c40','0x0',18,
- 1,1,
- '0xd1b71759','0x1fff2e48e8a7',45,
- 1,1,
- ], 122 => [
- '0x8325c53f','0xfbcda3a',28,
- 500,61,
- '0xf9db22d1','0x7fbe76c8b',35,
- 61,500,
- '0x8012e2a0','0x3ef36',18,
- 50,61,
- '0xffda4053','0x1bce4217',45,
- 61,50,
- ], 128 => [
- '0xfa00','0x1e00',29,
- 125,16,
- '0x83126e98','0x3f7ced916',34,
- 16,125,
- '0xf424','0x4',19,
- 15625,2,
- '0x8637bd06','0xfffbce4217d',44,
- 2,15625,
- ], 200 => [
- '0xa000','0x0',29,
- 5,1,
- '0xcccd','0x3',34,
- 1,5,
- '0x9c40','0x0',19,
- 5000,1,
- '0xd1b71759','0xfff2e48e8a7',44,
- 1,5000,
- ], 250 => [
- '0x8000','0x0',29,
- 4,1,
- '0x8000','0x18000',33,
- 1,4,
- '0xfa00','0x0',20,
- 4000,1,
- '0x83126e98','0x7ff7ced9168',43,
- 1,4000,
- ], 256 => [
- '0xfa00','0x3e00',30,
- 125,32,
- '0x83126e98','0x1fbe76c8b',33,
- 32,125,
- '0xf424','0xc',20,
- 15625,4,
- '0x8637bd06','0x7ffde7210be',43,
- 4,15625,
- ], 300 => [
- '0xd556','0x2aaa',30,
-