#include <linux/module.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/version.h>
#include <linux/kallsyms.h>
#include <asm/pgtable.h>
struct remap_trace {
struct list_head list;
struct kmmio_probe probe;
- unsigned long phys;
+ resource_size_t phys;
unsigned long id;
};
static void print_pte(unsigned long address)
{
- int level;
+ unsigned int level;
pte_t *pte = lookup_address(address, &level);
if (!pte) {
struct mmiotrace_rw *my_trace = &get_cpu_var(cpu_trace);
const unsigned long instptr = instruction_pointer(regs);
const enum reason_type type = get_ins_type(instptr);
- struct remap_trace *trace = p->user_data;
+ struct remap_trace *trace = p->private;
/* it doesn't make sense to have more than one active trace per cpu */
if (my_reason->active_traces)
put_cpu_var(pf_reason);
}
-static void ioremap_trace_core(unsigned long offset, unsigned long size,
+static void ioremap_trace_core(resource_size_t offset, unsigned long size,
void __iomem *addr)
{
static atomic_t next_id;
struct remap_trace *trace = kmalloc(sizeof(*trace), GFP_KERNEL);
+ /* These are page-unaligned. */
struct mmiotrace_map map = {
.phys = offset,
.virt = (unsigned long)addr,
.len = size,
.pre_handler = pre,
.post_handler = post,
- .user_data = trace
+ .private = trace
},
.phys = offset,
.id = atomic_inc_return(&next_id)
spin_unlock_irq(&trace_lock);
}
-void
-mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr)
+void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
+ void __iomem *addr)
{
if (!is_enabled()) /* recheck and proper locking in *_core() */
return;
- pr_debug(NAME "ioremap_*(0x%lx, 0x%lx) = %p\n", offset, size, addr);
+ pr_debug(NAME "ioremap_*(0x%llx, 0x%lx) = %p\n",
+ (unsigned long long)offset, size, addr);
if ((filter_offset) && (offset != filter_offset))
return;
ioremap_trace_core(offset, size, addr);
for_each_cpu_mask(cpu, downed_cpus) {
err = cpu_down(cpu);
- if (!err) {
+ if (!err)
pr_info(NAME "CPU%d is down.\n", cpu);
- } else {
+ else
pr_err(NAME "Error taking CPU%d down: %d\n", cpu, err);
- }
}
if (num_online_cpus() > 1)
pr_warning(NAME "multiple CPUs still online, "