blob: 158f322248e34a02ad35c7812ab448255ba4b4f5 [file] [log] [blame]
Gennady Sharapov4abfbf42006-01-18 17:42:44 -08001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __SKAS_H
7#define __SKAS_H
8
Jeff Diked67b5692005-07-07 17:56:49 -07009#include "mm_id.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include "sysdep/ptrace.h"
11
12extern int userspace_pid[];
Bodo Stroesser858259c2005-11-07 00:58:55 -080013extern int proc_mm, ptrace_faultinfo, ptrace_ldt;
14extern int skas_needs_stub;
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16extern void switch_threads(void *me, void *next);
17extern void thread_wait(void *sw, void *fb);
18extern void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
Gennady Sharapov4abfbf42006-01-18 17:42:44 -080019 void (*handler)(int));
20extern int start_idle_thread(void *stack, void *switch_buf_ptr,
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 void **fork_buf_ptr);
22extern int user_thread(unsigned long stack, int flags);
23extern void userspace(union uml_pt_regs *regs);
24extern void new_thread_proc(void *stack, void (*handler)(int sig));
Linus Torvalds1da177e2005-04-16 15:20:36 -070025extern void new_thread_handler(int sig);
26extern void handle_syscall(union uml_pt_regs *regs);
Bodo Stroesser07bf7312005-09-03 15:57:50 -070027extern int map(struct mm_id * mm_idp, unsigned long virt,
28 unsigned long len, int r, int w, int x, int phys_fd,
29 unsigned long long offset, int done, void **data);
30extern int unmap(struct mm_id * mm_idp, void *addr, unsigned long len,
31 int done, void **data);
32extern int protect(struct mm_id * mm_idp, unsigned long addr,
33 unsigned long len, int r, int w, int x, int done,
34 void **data);
Bodo Stroesserc5784552005-05-05 16:15:31 -070035extern void user_signal(int sig, union uml_pt_regs *regs, int pid);
Bodo Stroesser12919aa2006-01-18 17:42:39 -080036extern int new_mm(unsigned long stack);
Jeff Diked67b5692005-07-07 17:56:49 -070037extern int start_userspace(unsigned long stub_stack);
Bodo Stroesser9786a8f2005-07-07 17:56:50 -070038extern int copy_context_skas0(unsigned long stack, int pid);
Bodo Stroesserc5784552005-05-05 16:15:31 -070039extern void get_skas_faultinfo(int pid, struct faultinfo * fi);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040extern long execute_syscall_skas(void *r);
Jeff Diked67b5692005-07-07 17:56:49 -070041extern unsigned long current_stub_stack(void);
Bodo Stroesser07bf7312005-09-03 15:57:50 -070042extern long run_syscall_stub(struct mm_id * mm_idp,
Gennady Sharapov4abfbf42006-01-18 17:42:44 -080043 int syscall, unsigned long *args, long expected,
44 void **addr, int done);
Bodo Stroesser07bf7312005-09-03 15:57:50 -070045extern long syscall_stub_data(struct mm_id * mm_idp,
Gennady Sharapov4abfbf42006-01-18 17:42:44 -080046 unsigned long *data, int data_count,
47 void **addr, void **stub_addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49#endif