* on every box.
*/
-#include <linux/config.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/miscdevice.h>
* this array.
*/
static uint64_t perf_bitmasks[] = {
- 0x0000000000000000, /* first dbl word must be zero */
- 0xfdffe00000000000, /* RDR0 bitmask */
- 0x003f000000000000, /* RDR1 bitmask */
- 0x00ffffffffffffff, /* RDR20-RDR21 bitmask (152 bits) */
- 0xffffffffffffffff,
- 0xfffffffc00000000,
- 0xffffffffffffffff, /* RDR22-RDR23 bitmask (233 bits) */
- 0xffffffffffffffff,
- 0xfffffffffffffffc,
- 0xff00000000000000
+ 0x0000000000000000ul, /* first dbl word must be zero */
+ 0xfdffe00000000000ul, /* RDR0 bitmask */
+ 0x003f000000000000ul, /* RDR1 bitmask */
+ 0x00fffffffffffffful, /* RDR20-RDR21 bitmask (152 bits) */
+ 0xfffffffffffffffful,
+ 0xfffffffc00000000ul,
+ 0xfffffffffffffffful, /* RDR22-RDR23 bitmask (233 bits) */
+ 0xfffffffffffffffful,
+ 0xfffffffffffffffcul,
+ 0xff00000000000000ul
};
/*
* somethings have changed slightly.
*/
static uint64_t perf_bitmasks_piranha[] = {
- 0x0000000000000000, /* first dbl word must be zero */
- 0xfdffe00000000000, /* RDR0 bitmask */
- 0x003f000000000000, /* RDR1 bitmask */
- 0x00ffffffffffffff, /* RDR20-RDR21 bitmask (158 bits) */
- 0xffffffffffffffff,
- 0xfffffffc00000000,
- 0xffffffffffffffff, /* RDR22-RDR23 bitmask (210 bits) */
- 0xffffffffffffffff,
- 0xffffffffffffffff,
- 0xfffc000000000000
+ 0x0000000000000000ul, /* first dbl word must be zero */
+ 0xfdffe00000000000ul, /* RDR0 bitmask */
+ 0x003f000000000000ul, /* RDR1 bitmask */
+ 0x00fffffffffffffful, /* RDR20-RDR21 bitmask (158 bits) */
+ 0xfffffffffffffffful,
+ 0xfffffffc00000000ul,
+ 0xfffffffffffffffful, /* RDR22-RDR23 bitmask (210 bits) */
+ 0xfffffffffffffffful,
+ 0xfffffffffffffffful,
+ 0xfffc000000000000ul
};
static uint64_t *bitmask_array; /* array of bitmasks to use */
static int perf_config(uint32_t *image_ptr);
static int perf_release(struct inode *inode, struct file *file);
static int perf_open(struct inode *inode, struct file *file);
-static ssize_t perf_read(struct file *file, char *buf, size_t cnt, loff_t *ppos);
-static ssize_t perf_write(struct file *file, const char *buf, size_t count,
+static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos);
+static ssize_t perf_write(struct file *file, const char __user *buf, size_t count,
loff_t *ppos);
static int perf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg);
/*
* Read does nothing for this driver
*/
-static ssize_t perf_read(struct file *file, char *buf, size_t cnt, loff_t *ppos)
+static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos)
{
return 0;
}
* called on the processor that the download should happen
* on.
*/
-static ssize_t perf_write(struct file *file, const char *buf, size_t count,
+static ssize_t perf_write(struct file *file, const char __user *buf, size_t count,
loff_t *ppos)
{
int err;
}
/* copy out the Counters */
- if (copy_to_user((void *)arg, raddr,
+ if (copy_to_user((void __user *)arg, raddr,
sizeof (raddr)) != 0) {
return -EFAULT;
}
* all of dword 22 and 58 bits (plus 6 don't care bits) of
* dword 23.
*/
- userbuf[21] &= 0xfffffffffffffc00; /* 0 to last 10 bits */
+ userbuf[21] &= 0xfffffffffffffc00ul; /* 0 to last 10 bits */
userbuf[22] = 0;
userbuf[23] = 0;
proc_hpa = cpu_device->hpa;
/* Merge intrigue bits into Runway STATUS 0 */
- tmp64 = __raw_readq(proc_hpa + RUNWAY_STATUS) & 0xffecffffffffffff;
- __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000), proc_hpa + RUNWAY_STATUS);
+ tmp64 = __raw_readq(proc_hpa + RUNWAY_STATUS) & 0xffecfffffffffffful;
+ __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul), proc_hpa + RUNWAY_STATUS);
/* Write RUNWAY DEBUG registers */
for (i = 0; i < 8; i++) {