Skip to content

Commit

Permalink
basic signal handling
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@41 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
bellard committed Mar 23, 2003
1 parent 1b6b029 commit 66fb976
Show file tree
Hide file tree
Showing 9 changed files with 1,058 additions and 99 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LDFLAGS+=-p
main.o: CFLAGS+=-p
endif

OBJS= elfload.o main.o thunk.o syscall.o libgemu.a
OBJS= elfload.o main.o thunk.o syscall.o signal.o libgemu.a

LIBOBJS+=translate-i386.o op-i386.o exec-i386.o
# NOTE: the disassembler code is only needed for debugging
Expand Down
4 changes: 3 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
- asynchronous signal interrupt / clear synchronous signal handling
- add eflags restore in emulator
- finish signal handing (fp87 state)
- verify thread support (clone() and various locks)
- signals
- optimize translated cache chaining (DLL PLT-like system)
- vm86 syscall support
- overrides/16bit for string ops
Expand Down
6 changes: 2 additions & 4 deletions linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ int cpu_x86_inl(int addr)
return 0;
}

/* default linux values for the selectors */
#define __USER_CS (0x23)
#define __USER_DS (0x2B)

void write_dt(void *ptr, unsigned long addr, unsigned long limit,
int seg32_bit)
{
Expand Down Expand Up @@ -135,6 +131,7 @@ void cpu_loop(struct CPUX86State *env)
(long)pc, err);
abort();
}
process_pending_signals(env);
}
}

Expand Down Expand Up @@ -199,6 +196,7 @@ int main(int argc, char **argv)

target_set_brk((char *)info->brk);
syscall_init();
signal_init();

env = cpu_x86_init();

Expand Down
10 changes: 10 additions & 0 deletions linux-user/qemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

#include "thunk.h"

#ifdef TARGET_I386

/* default linux values for the selectors */
#define __USER_CS (0x23)
#define __USER_DS (0x2B)

struct target_pt_regs {
long ebx;
long ecx;
Expand All @@ -21,6 +27,8 @@ struct target_pt_regs {
int xss;
};

#endif

/* This struct is used to hold certain information about the image.
* Basically, it replicates in user space what would be certain
* task_struct fields in the kernel
Expand Down Expand Up @@ -53,5 +61,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
void gemu_log(const char *fmt, ...) __attribute__((format(printf,1,2)));
struct CPUX86State;
void cpu_loop(struct CPUX86State *env);
void process_pending_signals(void *cpu_env);
void signal_init(void);

#endif
Loading

0 comments on commit 66fb976

Please sign in to comment.