git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
arch
/
ppc64
/
kernel
/
rtc.c
diff --git
a/arch/ppc64/kernel/rtc.c
b/arch/ppc64/kernel/rtc.c
index
eff8000
..
536a499
100644
(file)
--- a/
arch/ppc64/kernel/rtc.c
+++ b/
arch/ppc64/kernel/rtc.c
@@
-34,12
+34,13
@@
#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/bcd.h>
#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/bcd.h>
+#include <linux/interrupt.h>
-#include <asm/hardirq.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/time.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/time.h>
+#include <asm/rtas.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/mf.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/mf.h>
@@
-55,9
+56,7
@@
extern int piranha_simulator;
* ioctls.
*/
* ioctls.
*/
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin);
-
-static ssize_t rtc_read(struct file *file, char *buf,
+static ssize_t rtc_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos);
static int rtc_ioctl(struct inode *inode, struct file *file,
size_t count, loff_t *ppos);
static int rtc_ioctl(struct inode *inode, struct file *file,
@@
-80,12
+79,7
@@
static const unsigned char days_in_mo[] =
* Now all the various file operations that we export.
*/
* Now all the various file operations that we export.
*/
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin)
-{
- return -ESPIPE;
-}
-
-static ssize_t rtc_read(struct file *file, char *buf,
+static ssize_t rtc_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
return -EIO;
size_t count, loff_t *ppos)
{
return -EIO;
@@
-112,7
+106,7
@@
static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if (!capable(CAP_SYS_TIME))
return -EACCES;
if (!capable(CAP_SYS_TIME))
return -EACCES;
- if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
+ if (copy_from_user(&rtc_tm, (struct rtc_time
__user
*)arg,
sizeof(struct rtc_time)))
return -EFAULT;
sizeof(struct rtc_time)))
return -EFAULT;
@@
-146,7
+140,7
@@
static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}
case RTC_EPOCH_READ: /* Read the epoch. */
{
}
case RTC_EPOCH_READ: /* Read the epoch. */
{
- return put_user (epoch, (unsigned long *)arg);
+ return put_user (epoch, (unsigned long
__user
*)arg);
}
case RTC_EPOCH_SET: /* Set the epoch. */
{
}
case RTC_EPOCH_SET: /* Set the epoch. */
{
@@
-165,11
+159,12
@@
static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
default:
return -EINVAL;
}
default:
return -EINVAL;
}
- return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
+ return copy_to_user((void
__user
*)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
}
static int rtc_open(struct inode *inode, struct file *file)
{
}
static int rtc_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
return 0;
}
return 0;
}
@@
-183,7
+178,7
@@
static int rtc_release(struct inode *inode, struct file *file)
*/
static struct file_operations rtc_fops = {
.owner = THIS_MODULE,
*/
static struct file_operations rtc_fops = {
.owner = THIS_MODULE,
- .llseek =
rtc
_llseek,
+ .llseek =
no
_llseek,
.read = rtc_read,
.ioctl = rtc_ioctl,
.open = rtc_open,
.read = rtc_read,
.ioctl = rtc_ioctl,
.open = rtc_open,
@@
-206,7
+201,7
@@
static int __init rtc_init(void)
return retval;
#ifdef CONFIG_PROC_FS
return retval;
#ifdef CONFIG_PROC_FS
- if
(create_proc_read_entry ("driver/rtc", 0, 0
, rtc_read_proc, NULL) == NULL)
+ if
(create_proc_read_entry ("driver/rtc", 0, NULL
, rtc_read_proc, NULL) == NULL)
misc_deregister(&rtc_dev);
return -ENOMEM;
#endif
misc_deregister(&rtc_dev);
return -ENOMEM;
#endif
@@
-346,13
+341,13
@@
void iSeries_get_boot_time(struct rtc_time *tm)
#define RTAS_CLOCK_BUSY (-2)
void pSeries_get_boot_time(struct rtc_time *rtc_tm)
{
#define RTAS_CLOCK_BUSY (-2)
void pSeries_get_boot_time(struct rtc_time *rtc_tm)
{
-
unsigned long
ret[8];
+
int
ret[8];
int error, wait_time;
unsigned long max_wait_tb;
max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
do {
int error, wait_time;
unsigned long max_wait_tb;
max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
do {
- error = rtas_call(rtas_token("get-time-of-day"), 0, 8,
(void *)&
ret);
+ error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
wait_time = rtas_extended_busy_delay_time(error);
/* This is boot time so we spin. */
if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
wait_time = rtas_extended_busy_delay_time(error);
/* This is boot time so we spin. */
@@
-381,13
+376,13
@@
void pSeries_get_boot_time(struct rtc_time *rtc_tm)
*/
void pSeries_get_rtc_time(struct rtc_time *rtc_tm)
{
*/
void pSeries_get_rtc_time(struct rtc_time *rtc_tm)
{
-
unsigned long
ret[8];
+
int
ret[8];
int error, wait_time;
unsigned long max_wait_tb;
max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
do {
int error, wait_time;
unsigned long max_wait_tb;
max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
do {
- error = rtas_call(rtas_token("get-time-of-day"), 0, 8,
(void *)&
ret);
+ error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
if (in_interrupt()) {
printk(KERN_WARNING "error: reading clock would delay interrupt\n");
if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
if (in_interrupt()) {
printk(KERN_WARNING "error: reading clock would delay interrupt\n");