changeset 560:0d34d9e16892

Better first noperl patch, possibly submissible upstream.
author Rob Landley <rob@landley.net>
date Fri, 02 Jan 2009 00:13:42 -0600
parents c893c8d381f4
children 8dc7e099309e
files sources/patches/alt-linux-noperl.patch
diffstat 1 files changed, 291 insertions(+), 434 deletions(-) [+]
line wrap: on
line diff
--- a/sources/patches/alt-linux-noperl.patch	Mon Dec 29 02:55:56 2008 -0600
+++ b/sources/patches/alt-linux-noperl.patch	Fri Jan 02 00:13:42 2009 -0600
@@ -1,29 +1,132 @@
-diff -ru linux-2.6.26/kernel/Makefile linux-2.6.26-new/kernel/Makefile
---- linux-2.6.26/kernel/Makefile	2008-07-13 16:51:29.000000000 -0500
-+++ linux-2.6.26-new/kernel/Makefile	2008-07-25 11:46:15.000000000 -0500
-@@ -95,8 +95,3 @@
- 
+diff -r d0c7611dcfd6 kernel/Makefile
+--- a/kernel/Makefile	Tue Dec 30 17:48:25 2008 -0800
++++ b/kernel/Makefile	Fri Jan 02 00:10:44 2009 -0600
+@@ -115,7 +115,7 @@
  $(obj)/time.o: $(obj)/timeconst.h
  
--quiet_cmd_timeconst  = TIMEC   $@
+ quiet_cmd_timeconst  = TIMEC   $@
 -      cmd_timeconst  = $(PERL) $< $(CONFIG_HZ) > $@
--targets += timeconst.h
++      cmd_timeconst  = $(CONFIG_SHELL) $< $(CONFIG_HZ) > $@
+ targets += timeconst.h
 -$(obj)/timeconst.h: $(src)/timeconst.pl FORCE
--	$(call if_changed,timeconst)
-diff -ru linux-2.6.26/kernel/timeconst.pl linux-2.6.26-new/kernel/timeconst.pl
---- linux-2.6.26/kernel/timeconst.pl	2008-07-13 16:51:29.000000000 -0500
-+++ linux-2.6.26-new/kernel/timeconst.pl	2008-07-25 12:01:27.000000000 -0500
-@@ -11,150 +11,12 @@
- #
- 
- #
++$(obj)/timeconst.h: $(src)/timeconst.sh FORCE
+ 	$(call if_changed,timeconst)
+--- /dev/null	1969-12-31 00:00:00.000000000 -0600
++++ hg/kernel/timeconst.sh	2009-01-01 23:53:17.000000000 -0600
+@@ -0,0 +1,91 @@
++#!/bin/bash
++
++if [ $# -ne 1 ]
++then
++	echo "Usage: timeconst.sh HZ"
++	exit 1
++fi
++
++HZ=$1
++
++# Sanity test: even the shell in Red Hat 9 (circa 2003) supported 64 bit math.
++
++[ $((1<<32)) -lt 0 ] && exit 1
++
++# Output start of header file
++
++cat << EOF
++/* Automatically generated by kernel/timeconst.sh */
++/* Conversion constants for HZ == $HZ */
++
++#ifndef KERNEL_TIMECONST_H
++#define KERNEL_TIMECONST_H
++
++#include <linux/param.h>
++#include <linux/types.h>
++
++#if HZ != $HZ
++#error "kernel/timeconst.h has the wrong HZ value!"
++#endif
++
++EOF
++
++# For both Miliseconds and Microseconds
++
++for i in "MSEC 1000" "USEC 1000000"
++do
++	NAME=$(echo $i | awk '{print $1}')
++	PERIOD=$(echo $i | awk '{print $2}')
++
++	# Find greatest common denominator (using Euclid's algorithm)
++
++	A=$HZ
++	B=$PERIOD
++
++	while [ $B -ne 0 ]
++	do
++		C=$(($A%$B))
++		A=$B
++		B=$C
++	done
++
++	GCD=$A
++
++	# Do this for each direction (HZ_TO_PERIOD and PERIOD_TO_HZ)
++
++	for DIRECTION in 0 1
++	do
++		if [ $DIRECTION -eq 0 ]
++		then
++			CONVERT="HZ_TO_${NAME}"
++			FROM=$HZ
++			TO=$PERIOD
++		else
++			CONVERT="${NAME}_TO_HZ"
++			FROM=$PERIOD
++			TO=$HZ
++		fi
++
++		# How many shift bits give 32 bits of significant data?
++
++		SHIFT=0
++		while [ $(( (($TO<<$SHIFT)+$FROM-1)/$FROM )) -lt $((1<<31)) ]
++		do
++			SHIFT=$(( $SHIFT+1 ))
++		done
++
++		MUL32=$(( (($TO<<$SHIFT)+$FROM-1)/$FROM ))
++		MUL32=$(printf %x $MUL32)
++		echo "#define ${CONVERT}_MUL32	U64_C(0x$MUL32)"
++		ADJ32=$(($FROM/$GCD))
++		ADJ32=$(( (($ADJ32-1)<<$SHIFT)/$ADJ32 ))
++		ADJ32=$(printf %x $ADJ32)
++		echo "#define ${CONVERT}_ADJ32	U64_C(0x$ADJ32)"
++		echo "#define ${CONVERT}_SHR32	$SHIFT"
++		echo "#define ${CONVERT}_NUM		U64_C($(($TO/$GCD)))"
++		echo "#define ${CONVERT}_DEN		U64_C($(($FROM/$GCD)))"
++	done
++done
++
++echo
++echo "#endif /* KERNEL_TIMECHONST_H */"
+--- hg/kernel/timeconst.pl	2008-11-22 19:09:13.000000000 -0600
++++ /dev/null	1969-12-31 00:00:00.000000000 -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
-+# 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
+-#
+-
+-# 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 => [
 -		'0xa6aaaaab','0x2aaaaaa',26,
@@ -162,23 +265,134 @@
 -		3,2500,
 -	]
 -);
- 
- $has_bigint = eval 'use Math::BigInt qw(bgcd); 1;';
- 
-@@ -252,8 +114,7 @@
- 	my $s, $m, $a, $g;
- 
- 	if (!$has_bigint) {
+-
+-$has_bigint = eval 'use Math::BigInt qw(bgcd); 1;';
+-
+-sub bint($)
+-{
+-	my($x) = @_;
+-	return Math::BigInt->new($x);
+-}
+-
+-#
+-# Constants for division by reciprocal multiplication.
+-# (bits, numerator, denominator)
+-#
+-sub fmul($$$)
+-{
+-	my ($b,$n,$d) = @_;
+-
+-	$n = bint($n);
+-	$d = bint($d);
+-
+-	return scalar (($n << $b)+$d-bint(1))/$d;
+-}
+-
+-sub fadj($$$)
+-{
+-	my($b,$n,$d) = @_;
+-
+-	$n = bint($n);
+-	$d = bint($d);
+-
+-	$d = $d/bgcd($n, $d);
+-	return scalar (($d-bint(1)) << $b)/$d;
+-}
+-
+-sub fmuls($$$) {
+-	my($b,$n,$d) = @_;
+-	my($s,$m);
+-	my($thres) = bint(1) << ($b-1);
+-
+-	$n = bint($n);
+-	$d = bint($d);
+-
+-	for ($s = 0; 1; $s++) {
+-		$m = fmul($s,$n,$d);
+-		return $s if ($m >= $thres);
+-	}
+-	return 0;
+-}
+-
+-# Generate a hex value if the result fits in 64 bits;
+-# otherwise skip.
+-sub bignum_hex($) {
+-	my($x) = @_;
+-	my $s = $x->as_hex();
+-
+-	return (length($s) > 18) ? undef : $s;
+-}
+-
+-# Provides mul, adj, and shr factors for a specific
+-# (bit, time, hz) combination
+-sub muladj($$$) {
+-	my($b, $t, $hz) = @_;
+-	my $s = fmuls($b, $t, $hz);
+-	my $m = fmul($s, $t, $hz);
+-	my $a = fadj($s, $t, $hz);
+-	return (bignum_hex($m), bignum_hex($a), $s);
+-}
+-
+-# Provides numerator, denominator values
+-sub numden($$) {
+-	my($n, $d) = @_;
+-	my $g = bgcd($n, $d);
+-	return ($n/$g, $d/$g);
+-}
+-
+-# All values for a specific (time, hz) combo
+-sub conversions($$) {
+-	my ($t, $hz) = @_;
+-	my @val = ();
+-
+-	# HZ_TO_xx
+-	push(@val, muladj(32, $t, $hz));
+-	push(@val, numden($t, $hz));
+-
+-	# xx_TO_HZ
+-	push(@val, muladj(32, $hz, $t));
+-	push(@val, numden($hz, $t));
+-
+-	return @val;
+-}
+-
+-sub compute_values($) {
+-	my($hz) = @_;
+-	my @val = ();
+-	my $s, $m, $a, $g;
+-
+-	if (!$has_bigint) {
 -		die "$0: HZ == $hz not canned and ".
 -		    "Math::BigInt not available\n";
-+		die "$0: Math::BigInt not available\n";
- 	}
- 
- 	# MSEC conversions
-@@ -283,21 +144,7 @@
- 	my($hz, @val) = @_;
- 	my $pfx, $bit, $suf, $s, $m, $a;
- 
+-	}
+-
+-	# MSEC conversions
+-	push(@val, conversions(1000, $hz));
+-
+-	# USEC conversions
+-	push(@val, conversions(1000000, $hz));
+-
+-	return @val;
+-}
+-
+-sub outputval($$)
+-{
+-	my($name, $val) = @_;
+-	my $csuf;
+-
+-	if (defined($val)) {
+-	    if ($name !~ /SHR/) {
+-		$val = "U64_C($val)";
+-	    }
+-	    printf "#define %-23s %s\n", $name.$csuf, $val.$csuf;
+-	}
+-}
+-
+-sub output($@)
+-{
+-	my($hz, @val) = @_;
+-	my $pfx, $bit, $suf, $s, $m, $a;
+-
 -	print "/* Automatically generated by kernel/timeconst.pl */\n";
 -	print "/* Conversion constants for HZ == $hz */\n";
 -	print "\n";
@@ -194,42 +408,42 @@
 -	print "#error \"kernel/timeconst.h has the wrong HZ value!\"\n";
 -	print "#endif\n";
 -	print "\n";
-+	print "HZ == $hz\n";
- 
- 	foreach $pfx ('HZ_TO_MSEC','MSEC_TO_HZ',
- 		      'HZ_TO_USEC','USEC_TO_HZ') {
-@@ -311,8 +158,7 @@
- 		}
- 	}
- 
+-
+-	foreach $pfx ('HZ_TO_MSEC','MSEC_TO_HZ',
+-		      'HZ_TO_USEC','USEC_TO_HZ') {
+-		foreach $bit (32) {
+-			foreach $suf ('MUL', 'ADJ', 'SHR') {
+-				outputval("${pfx}_$suf$bit", shift(@val));
+-			}
+-		}
+-		foreach $suf ('NUM', 'DEN') {
+-			outputval("${pfx}_$suf", shift(@val));
+-		}
+-	}
+-
 -	print "\n";
 -	print "#endif /* KERNEL_TIMECONST_H */\n";
-+	print "\n#elif ";
- }
- 
- # Pretty-print Perl values
-@@ -332,47 +178,36 @@
- 	return join(',', @l);
- }
- 
+-}
+-
+-# Pretty-print Perl values
+-sub perlvals(@) {
+-	my $v;
+-	my @l = ();
+-
+-	foreach $v (@_) {
+-		if (!defined($v)) {
+-			push(@l, 'undef');
+-		} elsif ($v =~ /^0x/) {
+-			push(@l, "\'".$v."\'");
+-		} else {
+-			push(@l, $v.'');
+-		}
+-	}
+-	return join(',', @l);
+-}
+-
 -($hz) = @ARGV;
-+print "/* Conversion constants for HZ */\n";
-+print "/* DO NOT EDIT!  Automatically generated by:\n";
-+print "   kernel/timeconst.pl @ARGV\n */\n";
-+print "\n";
-+print "#ifndef KERNEL_TIMECONST_H\n";
-+print "#define KERNEL_TIMECONST_H\n";
-+print "\n";
-+
-+print "#include <linux/param.h>\n";
-+print "#include <linux/types.h>\n";
-+
-+print "\n";
-+print "#if ";
-+
-+foreach $hz (@ARGV)
-+{
- 
+-
 -# Use this to generate the %canned_values structure
 -if ($hz eq '--can') {
 -	shift(@ARGV);
@@ -260,372 +474,15 @@
 -	}
 -	print "\n);\n";
 -} else {
- 	$hz += 0;			# Force to number
- 	if ($hz < 1) {
- 		die "Usage: $0 HZ\n";
- 	}
- 
+-	$hz += 0;			# Force to number
+-	if ($hz < 1) {
+-		die "Usage: $0 HZ\n";
+-	}
+-
 -	@val = @{$canned_values{$hz}};
 -	if (!defined(@val)) {
 -		@val = compute_values($hz);
 -	}
-+	@val = compute_values($hz);
- 	output($hz, @val);
- }
-+
-+print "1\n";
-+print "#error \"kernel/timeconst.h has unknown HZ value!\"\n";
-+print "#endif\n";
-+print "\n";
-+print "#endif /* KERNEL_TIMECONST_H */\n";
-+
- exit 0;
---- /dev/null	2007-10-16 17:06:33.000000000 -0500
-+++ linux-2.6.26-new/kernel/timeconst.h	2008-07-25 12:02:02.000000000 -0500
-@@ -0,0 +1,346 @@
-+/* Conversion constants for HZ */
-+/* DO NOT EDIT!  Automatically generated by:
-+   kernel/timeconst.pl 24 32 48 64 100 122 128 200 250 256 300 512 1000 1024 1200
-+ */
-+
-+#ifndef KERNEL_TIMECONST_H
-+#define KERNEL_TIMECONST_H
-+
-+#include <linux/param.h>
-+#include <linux/types.h>
-+
-+#if HZ == 24
-+#define HZ_TO_MSEC_MUL32        U64_C(0xa6aaaaab)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x2aaaaaa)
-+#define HZ_TO_MSEC_SHR32        26
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(3)
-+#define MSEC_TO_HZ_MUL32        U64_C(0xc49ba5e4)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x1fbe76c8b4)
-+#define MSEC_TO_HZ_SHR32        37
-+#define MSEC_TO_HZ_NUM          U64_C(3)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xa2c2aaab)
-+#define HZ_TO_USEC_ADJ32        U64_C(0xaaaa)
-+#define HZ_TO_USEC_SHR32        16
-+#define HZ_TO_USEC_NUM          U64_C(125000)
-+#define HZ_TO_USEC_DEN          U64_C(3)
-+#define USEC_TO_HZ_MUL32        U64_C(0xc9539b89)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x7fffbce4217d)
-+#define USEC_TO_HZ_SHR32        47
-+#define USEC_TO_HZ_NUM          U64_C(3)
-+#define USEC_TO_HZ_DEN          U64_C(125000)
-+
-+#elif HZ == 32
-+#define HZ_TO_MSEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x6000000)
-+#define HZ_TO_MSEC_SHR32        27
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(4)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0xfdf3b645a)
-+#define MSEC_TO_HZ_SHR32        36
-+#define MSEC_TO_HZ_NUM          U64_C(4)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xf4240000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_USEC_SHR32        17
-+#define HZ_TO_USEC_NUM          U64_C(31250)
-+#define HZ_TO_USEC_DEN          U64_C(1)
-+#define USEC_TO_HZ_MUL32        U64_C(0x8637bd06)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x3fff79c842fa)
-+#define USEC_TO_HZ_SHR32        46
-+#define USEC_TO_HZ_NUM          U64_C(1)
-+#define USEC_TO_HZ_DEN          U64_C(31250)
-+
-+#elif HZ == 48
-+#define HZ_TO_MSEC_MUL32        U64_C(0xa6aaaaab)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x6aaaaaa)
-+#define HZ_TO_MSEC_SHR32        27
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(6)
-+#define MSEC_TO_HZ_MUL32        U64_C(0xc49ba5e4)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0xfdf3b645a)
-+#define MSEC_TO_HZ_SHR32        36
-+#define MSEC_TO_HZ_NUM          U64_C(6)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xa2c2aaab)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x15555)
-+#define HZ_TO_USEC_SHR32        17
-+#define HZ_TO_USEC_NUM          U64_C(62500)
-+#define HZ_TO_USEC_DEN          U64_C(3)
-+#define USEC_TO_HZ_MUL32        U64_C(0xc9539b89)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x3fffbce4217d)
-+#define USEC_TO_HZ_SHR32        46
-+#define USEC_TO_HZ_NUM          U64_C(3)
-+#define USEC_TO_HZ_DEN          U64_C(62500)
-+
-+#elif HZ == 64
-+#define HZ_TO_MSEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0xe000000)
-+#define HZ_TO_MSEC_SHR32        28
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(8)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x7ef9db22d)
-+#define MSEC_TO_HZ_SHR32        35
-+#define MSEC_TO_HZ_NUM          U64_C(8)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xf4240000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_USEC_SHR32        18
-+#define HZ_TO_USEC_NUM          U64_C(15625)
-+#define HZ_TO_USEC_DEN          U64_C(1)
-+#define USEC_TO_HZ_MUL32        U64_C(0x8637bd06)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x1fff79c842fa)
-+#define USEC_TO_HZ_SHR32        45
-+#define USEC_TO_HZ_NUM          U64_C(1)
-+#define USEC_TO_HZ_DEN          U64_C(15625)
-+
-+#elif HZ == 100
-+#define HZ_TO_MSEC_MUL32        U64_C(0xa0000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_MSEC_SHR32        28
-+#define HZ_TO_MSEC_NUM          U64_C(10)
-+#define HZ_TO_MSEC_DEN          U64_C(1)
-+#define MSEC_TO_HZ_MUL32        U64_C(0xcccccccd)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x733333333)
-+#define MSEC_TO_HZ_SHR32        35
-+#define MSEC_TO_HZ_NUM          U64_C(1)
-+#define MSEC_TO_HZ_DEN          U64_C(10)
-+#define HZ_TO_USEC_MUL32        U64_C(0x9c400000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_USEC_SHR32        18
-+#define HZ_TO_USEC_NUM          U64_C(10000)
-+#define HZ_TO_USEC_DEN          U64_C(1)
-+#define USEC_TO_HZ_MUL32        U64_C(0xd1b71759)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x1fff2e48e8a7)
-+#define USEC_TO_HZ_SHR32        45
-+#define USEC_TO_HZ_NUM          U64_C(1)
-+#define USEC_TO_HZ_DEN          U64_C(10000)
-+
-+#elif HZ == 122
-+#define HZ_TO_MSEC_MUL32        U64_C(0x8325c53f)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0xfbcda3a)
-+#define HZ_TO_MSEC_SHR32        28
-+#define HZ_TO_MSEC_NUM          U64_C(500)
-+#define HZ_TO_MSEC_DEN          U64_C(61)
-+#define MSEC_TO_HZ_MUL32        U64_C(0xf9db22d1)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x7fbe76c8b)
-+#define MSEC_TO_HZ_SHR32        35
-+#define MSEC_TO_HZ_NUM          U64_C(61)
-+#define MSEC_TO_HZ_DEN          U64_C(500)
-+#define HZ_TO_USEC_MUL32        U64_C(0x8012e2a0)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x3ef36)
-+#define HZ_TO_USEC_SHR32        18
-+#define HZ_TO_USEC_NUM          U64_C(500000)
-+#define HZ_TO_USEC_DEN          U64_C(61)
-+#define USEC_TO_HZ_MUL32        U64_C(0xffda4053)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x1ffffbce4217)
-+#define USEC_TO_HZ_SHR32        45
-+#define USEC_TO_HZ_NUM          U64_C(61)
-+#define USEC_TO_HZ_DEN          U64_C(500000)
-+
-+#elif HZ == 128
-+#define HZ_TO_MSEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x1e000000)
-+#define HZ_TO_MSEC_SHR32        29
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(16)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x3f7ced916)
-+#define MSEC_TO_HZ_SHR32        34
-+#define MSEC_TO_HZ_NUM          U64_C(16)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xf4240000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x40000)
-+#define HZ_TO_USEC_SHR32        19
-+#define HZ_TO_USEC_NUM          U64_C(15625)
-+#define HZ_TO_USEC_DEN          U64_C(2)
-+#define USEC_TO_HZ_MUL32        U64_C(0x8637bd06)
-+#define USEC_TO_HZ_ADJ32        U64_C(0xfffbce4217d)
-+#define USEC_TO_HZ_SHR32        44
-+#define USEC_TO_HZ_NUM          U64_C(2)
-+#define USEC_TO_HZ_DEN          U64_C(15625)
-+
-+#elif HZ == 200
-+#define HZ_TO_MSEC_MUL32        U64_C(0xa0000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_MSEC_SHR32        29
-+#define HZ_TO_MSEC_NUM          U64_C(5)
-+#define HZ_TO_MSEC_DEN          U64_C(1)
-+#define MSEC_TO_HZ_MUL32        U64_C(0xcccccccd)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x333333333)
-+#define MSEC_TO_HZ_SHR32        34
-+#define MSEC_TO_HZ_NUM          U64_C(1)
-+#define MSEC_TO_HZ_DEN          U64_C(5)
-+#define HZ_TO_USEC_MUL32        U64_C(0x9c400000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_USEC_SHR32        19
-+#define HZ_TO_USEC_NUM          U64_C(5000)
-+#define HZ_TO_USEC_DEN          U64_C(1)
-+#define USEC_TO_HZ_MUL32        U64_C(0xd1b71759)
-+#define USEC_TO_HZ_ADJ32        U64_C(0xfff2e48e8a7)
-+#define USEC_TO_HZ_SHR32        44
-+#define USEC_TO_HZ_NUM          U64_C(1)
-+#define USEC_TO_HZ_DEN          U64_C(5000)
-+
-+#elif HZ == 250
-+#define HZ_TO_MSEC_MUL32        U64_C(0x80000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_MSEC_SHR32        29
-+#define HZ_TO_MSEC_NUM          U64_C(4)
-+#define HZ_TO_MSEC_DEN          U64_C(1)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x80000000)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x180000000)
-+#define MSEC_TO_HZ_SHR32        33
-+#define MSEC_TO_HZ_NUM          U64_C(1)
-+#define MSEC_TO_HZ_DEN          U64_C(4)
-+#define HZ_TO_USEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_USEC_SHR32        20
-+#define HZ_TO_USEC_NUM          U64_C(4000)
-+#define HZ_TO_USEC_DEN          U64_C(1)
-+#define USEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x7ff7ced9168)
-+#define USEC_TO_HZ_SHR32        43
-+#define USEC_TO_HZ_NUM          U64_C(1)
-+#define USEC_TO_HZ_DEN          U64_C(4000)
-+
-+#elif HZ == 256
-+#define HZ_TO_MSEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x3e000000)
-+#define HZ_TO_MSEC_SHR32        30
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(32)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x1fbe76c8b)
-+#define MSEC_TO_HZ_SHR32        33
-+#define MSEC_TO_HZ_NUM          U64_C(32)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xf4240000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0xc0000)
-+#define HZ_TO_USEC_SHR32        20
-+#define HZ_TO_USEC_NUM          U64_C(15625)
-+#define HZ_TO_USEC_DEN          U64_C(4)
-+#define USEC_TO_HZ_MUL32        U64_C(0x8637bd06)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x7ffde7210be)
-+#define USEC_TO_HZ_SHR32        43
-+#define USEC_TO_HZ_NUM          U64_C(4)
-+#define USEC_TO_HZ_DEN          U64_C(15625)
-+
-+#elif HZ == 300
-+#define HZ_TO_MSEC_MUL32        U64_C(0xd5555556)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x2aaaaaaa)
-+#define HZ_TO_MSEC_SHR32        30
-+#define HZ_TO_MSEC_NUM          U64_C(10)
-+#define HZ_TO_MSEC_DEN          U64_C(3)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x9999999a)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x1cccccccc)
-+#define MSEC_TO_HZ_SHR32        33
-+#define MSEC_TO_HZ_NUM          U64_C(3)
-+#define MSEC_TO_HZ_DEN          U64_C(10)
-+#define HZ_TO_USEC_MUL32        U64_C(0xd0555556)
-+#define HZ_TO_USEC_ADJ32        U64_C(0xaaaaa)
-+#define HZ_TO_USEC_SHR32        20
-+#define HZ_TO_USEC_NUM          U64_C(10000)
-+#define HZ_TO_USEC_DEN          U64_C(3)
-+#define USEC_TO_HZ_MUL32        U64_C(0x9d495183)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x7ffcb923a29)
-+#define USEC_TO_HZ_SHR32        43
-+#define USEC_TO_HZ_NUM          U64_C(3)
-+#define USEC_TO_HZ_DEN          U64_C(10000)
-+
-+#elif HZ == 512
-+#define HZ_TO_MSEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x7e000000)
-+#define HZ_TO_MSEC_SHR32        31
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(64)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0xfdf3b645)
-+#define MSEC_TO_HZ_SHR32        32
-+#define MSEC_TO_HZ_NUM          U64_C(64)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xf4240000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x1c0000)
-+#define HZ_TO_USEC_SHR32        21
-+#define HZ_TO_USEC_NUM          U64_C(15625)
-+#define HZ_TO_USEC_DEN          U64_C(8)
-+#define USEC_TO_HZ_MUL32        U64_C(0x8637bd06)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x3ffef39085f)
-+#define USEC_TO_HZ_SHR32        42
-+#define USEC_TO_HZ_NUM          U64_C(8)
-+#define USEC_TO_HZ_DEN          U64_C(15625)
-+
-+#elif HZ == 1000
-+#define HZ_TO_MSEC_MUL32        U64_C(0x80000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_MSEC_SHR32        31
-+#define HZ_TO_MSEC_NUM          U64_C(1)
-+#define HZ_TO_MSEC_DEN          U64_C(1)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x80000000)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x0)
-+#define MSEC_TO_HZ_SHR32        31
-+#define MSEC_TO_HZ_NUM          U64_C(1)
-+#define MSEC_TO_HZ_DEN          U64_C(1)
-+#define HZ_TO_USEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x0)
-+#define HZ_TO_USEC_SHR32        22
-+#define HZ_TO_USEC_NUM          U64_C(1000)
-+#define HZ_TO_USEC_DEN          U64_C(1)
-+#define USEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x1ff7ced9168)
-+#define USEC_TO_HZ_SHR32        41
-+#define USEC_TO_HZ_NUM          U64_C(1)
-+#define USEC_TO_HZ_DEN          U64_C(1000)
-+
-+#elif HZ == 1024
-+#define HZ_TO_MSEC_MUL32        U64_C(0xfa000000)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0xfe000000)
-+#define HZ_TO_MSEC_SHR32        32
-+#define HZ_TO_MSEC_NUM          U64_C(125)
-+#define HZ_TO_MSEC_DEN          U64_C(128)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x83126e98)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x7ef9db22)
-+#define MSEC_TO_HZ_SHR32        31
-+#define MSEC_TO_HZ_NUM          U64_C(128)
-+#define MSEC_TO_HZ_DEN          U64_C(125)
-+#define HZ_TO_USEC_MUL32        U64_C(0xf4240000)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x3c0000)
-+#define HZ_TO_USEC_SHR32        22
-+#define HZ_TO_USEC_NUM          U64_C(15625)
-+#define HZ_TO_USEC_DEN          U64_C(16)
-+#define USEC_TO_HZ_MUL32        U64_C(0x8637bd06)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x1fff79c842f)
-+#define USEC_TO_HZ_SHR32        41
-+#define USEC_TO_HZ_NUM          U64_C(16)
-+#define USEC_TO_HZ_DEN          U64_C(15625)
-+
-+#elif HZ == 1200
-+#define HZ_TO_MSEC_MUL32        U64_C(0xd5555556)
-+#define HZ_TO_MSEC_ADJ32        U64_C(0xd5555555)
-+#define HZ_TO_MSEC_SHR32        32
-+#define HZ_TO_MSEC_NUM          U64_C(5)
-+#define HZ_TO_MSEC_DEN          U64_C(6)
-+#define MSEC_TO_HZ_MUL32        U64_C(0x9999999a)
-+#define MSEC_TO_HZ_ADJ32        U64_C(0x66666666)
-+#define MSEC_TO_HZ_SHR32        31
-+#define MSEC_TO_HZ_NUM          U64_C(6)
-+#define MSEC_TO_HZ_DEN          U64_C(5)
-+#define HZ_TO_USEC_MUL32        U64_C(0xd0555556)
-+#define HZ_TO_USEC_ADJ32        U64_C(0x2aaaaa)
-+#define HZ_TO_USEC_SHR32        22
-+#define HZ_TO_USEC_NUM          U64_C(2500)
-+#define HZ_TO_USEC_DEN          U64_C(3)
-+#define USEC_TO_HZ_MUL32        U64_C(0x9d495183)
-+#define USEC_TO_HZ_ADJ32        U64_C(0x1ffcb923a29)
-+#define USEC_TO_HZ_SHR32        41
-+#define USEC_TO_HZ_NUM          U64_C(3)
-+#define USEC_TO_HZ_DEN          U64_C(2500)
-+
-+#elif 1
-+#error "kernel/timeconst.h has unknown HZ value!"
-+#endif
-+
-+#endif /* KERNEL_TIMECONST_H */
+-	output($hz, @val);
+-}
+-exit 0;