diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-18 01:37:44 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-18 01:37:49 -0400 |
commit | dc3f81b129b5439ba7bac265bbc6a51a39275dae (patch) | |
tree | 216030731d911249496d2e97206cd61431e31c89 /drivers/char | |
parent | d2517a49d55536b38c7a87e5289550cfedaa4dcc (diff) | |
parent | 1406de8e11eb043681297adf86d6892ff8efc27a (diff) |
Merge commit 'v2.6.30-rc6' into perfcounters/core
Merge reason: this branch was on an -rc4 base, merge it up to -rc6
to get the latest upstream fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 f824ef8a9273..b2ced39d76b2 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 aed2b2936ecf..39a05b5fa9cb 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -408,7 +408,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
408 | &sysrq_showlocks_op, /* d */ | 408 | &sysrq_showlocks_op, /* d */ |
409 | &sysrq_term_op, /* e */ | 409 | &sysrq_term_op, /* e */ |
410 | &sysrq_moom_op, /* f */ | 410 | &sysrq_moom_op, /* f */ |
411 | /* g: May be registered by ppc for kgdb */ | 411 | /* g: May be registered for the kernel debugger */ |
412 | NULL, /* g */ | 412 | NULL, /* g */ |
413 | NULL, /* h - reserved for help */ | 413 | NULL, /* h - reserved for help */ |
414 | &sysrq_kill_op, /* i */ | 414 | &sysrq_kill_op, /* i */ |
@@ -433,7 +433,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
433 | &sysrq_sync_op, /* s */ | 433 | &sysrq_sync_op, /* s */ |
434 | &sysrq_showstate_op, /* t */ | 434 | &sysrq_showstate_op, /* t */ |
435 | &sysrq_mountro_op, /* u */ | 435 | &sysrq_mountro_op, /* u */ |
436 | /* v: May be registered at init time by SMP VOYAGER */ | 436 | /* v: May be registered for frame buffer console restore */ |
437 | NULL, /* v */ | 437 | NULL, /* v */ |
438 | &sysrq_showstate_blocked_op, /* w */ | 438 | &sysrq_showstate_blocked_op, /* w */ |
439 | /* x: May be registered on ppc/powerpc for xmon */ | 439 | /* x: May be registered on ppc/powerpc for xmon */ |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index a2dee0eb6dad..e6ce632a393e 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); |