Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
vm86_32.c File Reference
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/signal.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/highmem.h>
#include <linux/ptrace.h>
#include <linux/audit.h>
#include <linux/stddef.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/tlbflush.h>
#include <asm/irq.h>
#include <asm/syscalls.h>

Go to the source code of this file.

Data Structures

struct  vm86_irqs
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define KVM86   ((struct kernel_vm86_struct *)regs)
 
#define VMPI   KVM86->vm86plus
 
#define AL(regs)   (((unsigned char *)&((regs)->pt.ax))[0])
 
#define AH(regs)   (((unsigned char *)&((regs)->pt.ax))[1])
 
#define IP(regs)   (*(unsigned short *)&((regs)->pt.ip))
 
#define SP(regs)   (*(unsigned short *)&((regs)->pt.sp))
 
#define VFLAGS   (*(unsigned short *)&(current->thread.v86flags))
 
#define VEFLAGS   (current->thread.v86flags)
 
#define set_flags(X, new, mask)   ((X) = ((X) & ~(mask)) | ((new) & (mask)))
 
#define SAFE_MASK   (0xDD5)
 
#define RETURN_MASK   (0xDFF)
 
#define val_byte(val, n)   (((__u8 *)&val)[n])
 
#define pushb(base, ptr, val, err_label)
 
#define pushw(base, ptr, val, err_label)
 
#define pushl(base, ptr, val, err_label)
 
#define popb(base, ptr, err_label)
 
#define popw(base, ptr, err_label)
 
#define popl(base, ptr, err_label)
 
#define CHECK_IF_IN_TRAP
 
#define VM86_FAULT_RETURN
 
#define VM86_IRQNAME   "vm86irq"
 
#define ALLOWED_SIGS
 

Functions

struct pt_regssave_v86_state (struct kernel_vm86_regs *regs)
 
int sys_vm86old (struct vm86_struct __user *v86, struct pt_regs *regs)
 
int sys_vm86 (unsigned long cmd, unsigned long arg, struct pt_regs *regs)
 
int handle_vm86_trap (struct kernel_vm86_regs *regs, long error_code, int trapno)
 
void handle_vm86_fault (struct kernel_vm86_regs *regs, long error_code)
 
void release_vm86_irqs (struct task_struct *task)
 

Macro Definition Documentation

#define AH (   regs)    (((unsigned char *)&((regs)->pt.ax))[1])

Definition at line 77 of file vm86_32.c.

#define AL (   regs)    (((unsigned char *)&((regs)->pt.ax))[0])

Definition at line 76 of file vm86_32.c.

#define ALLOWED_SIGS
Value:
(1 /* 0 = don't send a signal */ \
| (1 << SIGUSR1) | (1 << SIGUSR2) | (1 << SIGIO) | (1 << SIGURG) \
| (1 << SIGUNUSED))

Definition at line 748 of file vm86_32.c.

#define CHECK_IF_IN_TRAP
Value:
if (VMPI.vm86dbg_active && VMPI.vm86dbg_TFpendig) \
newflags |= X86_EFLAGS_TF
#define IP (   regs)    (*(unsigned short *)&((regs)->pt.ip))

Definition at line 78 of file vm86_32.c.

#define KVM86   ((struct kernel_vm86_struct *)regs)

Definition at line 69 of file vm86_32.c.

#define popb (   base,
  ptr,
  err_label 
)
Value:
({ \
__u8 __res; \
if (get_user(__res, base + ptr) < 0) \
goto err_label; \
ptr++; \
__res; \
})

Definition at line 482 of file vm86_32.c.

#define popl (   base,
  ptr,
  err_label 
)
Value:
({ \
__u32 __res; \
if (get_user(val_byte(__res, 0), base + ptr) < 0) \
goto err_label; \
ptr++; \
if (get_user(val_byte(__res, 1), base + ptr) < 0) \
goto err_label; \
ptr++; \
if (get_user(val_byte(__res, 2), base + ptr) < 0) \
goto err_label; \
ptr++; \
if (get_user(val_byte(__res, 3), base + ptr) < 0) \
goto err_label; \
ptr++; \
__res; \
})

Definition at line 503 of file vm86_32.c.

#define popw (   base,
  ptr,
  err_label 
)
Value:
({ \
__u16 __res; \
if (get_user(val_byte(__res, 0), base + ptr) < 0) \
goto err_label; \
ptr++; \
if (get_user(val_byte(__res, 1), base + ptr) < 0) \
goto err_label; \
ptr++; \
__res; \
})

Definition at line 491 of file vm86_32.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 31 of file vm86_32.c.

#define pushb (   base,
  ptr,
  val,
  err_label 
)
Value:
do { \
ptr--; \
if (put_user(__val, base + ptr) < 0) \
goto err_label; \
} while (0)

Definition at line 446 of file vm86_32.c.

#define pushl (   base,
  ptr,
  val,
  err_label 
)
Value:
do { \
ptr--; \
if (put_user(val_byte(__val, 3), base + ptr) < 0) \
goto err_label; \
ptr--; \
if (put_user(val_byte(__val, 2), base + ptr) < 0) \
goto err_label; \
ptr--; \
if (put_user(val_byte(__val, 1), base + ptr) < 0) \
goto err_label; \
ptr--; \
if (put_user(val_byte(__val, 0), base + ptr) < 0) \
goto err_label; \
} while (0)

Definition at line 465 of file vm86_32.c.

#define pushw (   base,
  ptr,
  val,
  err_label 
)
Value:
do { \
ptr--; \
if (put_user(val_byte(__val, 1), base + ptr) < 0) \
goto err_label; \
ptr--; \
if (put_user(val_byte(__val, 0), base + ptr) < 0) \
goto err_label; \
} while (0)

Definition at line 454 of file vm86_32.c.

#define RETURN_MASK   (0xDFF)

Definition at line 91 of file vm86_32.c.

#define SAFE_MASK   (0xDD5)

Definition at line 90 of file vm86_32.c.

#define set_flags (   X,
  new,
  mask 
)    ((X) = ((X) & ~(mask)) | ((new) & (mask)))

Definition at line 87 of file vm86_32.c.

#define SP (   regs)    (*(unsigned short *)&((regs)->pt.sp))

Definition at line 79 of file vm86_32.c.

#define val_byte (   val,
  n 
)    (((__u8 *)&val)[n])

Definition at line 444 of file vm86_32.c.

#define VEFLAGS   (current->thread.v86flags)

Definition at line 85 of file vm86_32.c.

#define VFLAGS   (*(unsigned short *)&(current->thread.v86flags))

Definition at line 84 of file vm86_32.c.

#define VM86_FAULT_RETURN
Value:
do { \
if (VMPI.force_return_for_pic && (VEFLAGS & (X86_EFLAGS_IF | X86_EFLAGS_VIF))) \
return_to_32bit(regs, VM86_PICRETURN); \
if (orig_flags & X86_EFLAGS_TF) \
handle_vm86_trap(regs, 0, 1); \
return; } while (0)
#define VM86_IRQNAME   "vm86irq"

Definition at line 738 of file vm86_32.c.

#define VMPI   KVM86->vm86plus

Definition at line 70 of file vm86_32.c.

Function Documentation

void handle_vm86_fault ( struct kernel_vm86_regs *  regs,
long  error_code 
)

Definition at line 580 of file vm86_32.c.

int handle_vm86_trap ( struct kernel_vm86_regs *  regs,
long  error_code,
int  trapno 
)

Definition at line 558 of file vm86_32.c.

void release_vm86_irqs ( struct task_struct task)

Definition at line 789 of file vm86_32.c.

struct pt_regs* save_v86_state ( struct kernel_vm86_regs *  regs)
read

Definition at line 128 of file vm86_32.c.

int sys_vm86 ( unsigned long  cmd,
unsigned long  arg,
struct pt_regs regs 
)

Definition at line 234 of file vm86_32.c.

int sys_vm86old ( struct vm86_struct __user v86,
struct pt_regs regs 
)

Definition at line 205 of file vm86_32.c.