writer_module_name=swap_writer.ko
writer_inc=${modules_inc}
make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${writer_dir} \
- extra_cflags="-I${modules_dir}" modules || exit 1
+ extra_cflags="-Werror -I${modules_dir}" modules || exit 1
driver_module_name=swap_driver.ko
make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${driver_dir} \
u32 *sp, addr = 0;
if (user_mode(regs)) {
- sp = regs->sp;
+ sp = (u32 *)regs->sp;
if (get_user(addr, sp))
printk("failed to dereference a pointer, sp=%p, "
- "pc=%p\n", sp, get_regs_ip(regs));
+ "pc=%lx\n", sp, get_regs_ip(regs));
} else {
sp = (u32 *)kernel_stack_pointer(regs);
addr = *sp;
static char *pack_proc_unmap(char *payload, unsigned long start,
unsigned long end)
{
- struct proc_map *pum = (struct proc_unmap *)payload;
+ struct proc_unmap *pum = (struct proc_unmap *)payload;
pum->pid = current->tgid;
pum->low_addr = start;
case 'd': /* 4 byte(int) */
if (len < 4)
return -ENOMEM;
- tmp_u32 = buf;
- *tmp_u32 = arg;
+ tmp_u32 = (u32 *)buf;
+ *tmp_u32 = (u32)arg;
buf += 4;
len -= 4;
break;
case 'p': /* 8 byte(pointer) */
if (len < 8)
return -ENOMEM;
- tmp_u64 = buf;
+ tmp_u64 = (u64 *)buf;
*tmp_u64 = (u64)arg;
buf += 8;
len -= 8;
case 'w': /* 8 byte(double) */
if (len < 8 && (i + 1) < cnt)
return -ENOMEM;
- tmp_u64 = buf;
+ tmp_u64 = (u64 *)buf;
*tmp_u64 = *((u64 *)&args[i]);
++i;
buf += 8;
};
struct pt_regs;
+struct dentry;
+struct task_struct;
+struct vm_area_struct;
int init_msg(size_t buf_size);
void uninit_msg(void);