Skip to content

Commit

Permalink
vt: Add a note on the historical abuse of CLOCK_TICK_RATE
Browse files Browse the repository at this point in the history
This is one area where we can't just magic away the bizarre use of
CLOCK_TICK_RATE as it leaks to user space APIs. It also means the visible
CLOCK_TICK_RATE is frozen for architectures which is horrible.

We need to fix this somehow

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed May 6, 2009
1 parent 413f81e commit fab8922
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/char/vt_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
case KIOCSOUND:
if (!perm)
goto eperm;
/* FIXME: This is an old broken API but we need to keep it
supported and somehow separate the historic advertised
tick rate from any real one */
if (arg)
arg = CLOCK_TICK_RATE / arg;
kd_mksound(arg, 0);
Expand All @@ -417,6 +420,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
*/
ticks = HZ * ((arg >> 16) & 0xffff) / 1000;
count = ticks ? (arg & 0xffff) : 0;
/* FIXME: This is an old broken API but we need to keep it
supported and somehow separate the historic advertised
tick rate from any real one */
if (count)
count = CLOCK_TICK_RATE / count;
kd_mksound(count, ticks);
Expand Down

0 comments on commit fab8922

Please sign in to comment.