diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
commit | fc05505b77f7900a1bb74fb3f3a4343dee4265a4 (patch) | |
tree | 6517919cb60bd9465078512cacbefd8c77f94b76 /drivers/char | |
parent | a2ab67fae1ab9226679495a8d260f4e6555efc5f (diff) | |
parent | 11c79740d3c03cb81f84e98cf2e2dbd8d9bb53cd (diff) |
Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 into devel
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/random.c | 19 | ||||
-rw-r--r-- | drivers/char/sysrq.c | 4 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 6 |
3 files changed, 20 insertions, 9 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index f824ef8a927..b2ced39d76b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1665,15 +1665,20 @@ EXPORT_SYMBOL(secure_dccp_sequence_number); | |||
1665 | * value is not cryptographically secure but for several uses the cost of | 1665 | * value is not cryptographically secure but for several uses the cost of |
1666 | * depleting entropy is too high | 1666 | * depleting entropy is too high |
1667 | */ | 1667 | */ |
1668 | DEFINE_PER_CPU(__u32 [4], get_random_int_hash); | ||
1668 | unsigned int get_random_int(void) | 1669 | unsigned int get_random_int(void) |
1669 | { | 1670 | { |
1670 | /* | 1671 | struct keydata *keyptr; |
1671 | * Use IP's RNG. It suits our purpose perfectly: it re-keys itself | 1672 | __u32 *hash = get_cpu_var(get_random_int_hash); |
1672 | * every second, from the entropy pool (and thus creates a limited | 1673 | int ret; |
1673 | * drain on it), and uses halfMD4Transform within the second. We | 1674 | |
1674 | * also mix it with jiffies and the PID: | 1675 | keyptr = get_keyptr(); |
1675 | */ | 1676 | hash[0] += current->pid + jiffies + get_cycles() + (int)(long)&ret; |
1676 | return secure_ip_id((__force __be32)(current->pid + jiffies)); | 1677 | |
1678 | ret = half_md4_transform(hash, keyptr->secret); | ||
1679 | put_cpu_var(get_random_int_hash); | ||
1680 | |||
1681 | return ret; | ||
1677 | } | 1682 | } |
1678 | 1683 | ||
1679 | /* | 1684 | /* |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index b0a6a3e5192..d6a807f4077 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -406,7 +406,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
406 | &sysrq_showlocks_op, /* d */ | 406 | &sysrq_showlocks_op, /* d */ |
407 | &sysrq_term_op, /* e */ | 407 | &sysrq_term_op, /* e */ |
408 | &sysrq_moom_op, /* f */ | 408 | &sysrq_moom_op, /* f */ |
409 | /* g: May be registered by ppc for kgdb */ | 409 | /* g: May be registered for the kernel debugger */ |
410 | NULL, /* g */ | 410 | NULL, /* g */ |
411 | NULL, /* h - reserved for help */ | 411 | NULL, /* h - reserved for help */ |
412 | &sysrq_kill_op, /* i */ | 412 | &sysrq_kill_op, /* i */ |
@@ -431,7 +431,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
431 | &sysrq_sync_op, /* s */ | 431 | &sysrq_sync_op, /* s */ |
432 | &sysrq_showstate_op, /* t */ | 432 | &sysrq_showstate_op, /* t */ |
433 | &sysrq_mountro_op, /* u */ | 433 | &sysrq_mountro_op, /* u */ |
434 | /* v: May be registered at init time by SMP VOYAGER */ | 434 | /* v: May be registered for frame buffer console restore */ |
435 | NULL, /* v */ | 435 | NULL, /* v */ |
436 | &sysrq_showstate_blocked_op, /* w */ | 436 | &sysrq_showstate_blocked_op, /* w */ |
437 | /* x: May be registered on ppc/powerpc for xmon */ | 437 | /* x: May be registered on ppc/powerpc for xmon */ |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index a2dee0eb6da..e6ce632a393 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -400,6 +400,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
400 | case KIOCSOUND: | 400 | case KIOCSOUND: |
401 | if (!perm) | 401 | if (!perm) |
402 | goto eperm; | 402 | goto eperm; |
403 | /* FIXME: This is an old broken API but we need to keep it | ||
404 | supported and somehow separate the historic advertised | ||
405 | tick rate from any real one */ | ||
403 | if (arg) | 406 | if (arg) |
404 | arg = CLOCK_TICK_RATE / arg; | 407 | arg = CLOCK_TICK_RATE / arg; |
405 | kd_mksound(arg, 0); | 408 | kd_mksound(arg, 0); |
@@ -417,6 +420,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
417 | */ | 420 | */ |
418 | ticks = HZ * ((arg >> 16) & 0xffff) / 1000; | 421 | ticks = HZ * ((arg >> 16) & 0xffff) / 1000; |
419 | count = ticks ? (arg & 0xffff) : 0; | 422 | count = ticks ? (arg & 0xffff) : 0; |
423 | /* FIXME: This is an old broken API but we need to keep it | ||
424 | supported and somehow separate the historic advertised | ||
425 | tick rate from any real one */ | ||
420 | if (count) | 426 | if (count) |
421 | count = CLOCK_TICK_RATE / count; | 427 | count = CLOCK_TICK_RATE / count; |
422 | kd_mksound(count, ticks); | 428 | kd_mksound(count, ticks); |