mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
ef18c8839e
commit
3b46e62427
173 changed files with 1557 additions and 1557 deletions
|
@ -329,7 +329,7 @@
|
|||
#define TARGET_NR_lremovexattr 392
|
||||
#define TARGET_NR_fremovexattr 393
|
||||
#define TARGET_NR_futex 394
|
||||
#define TARGET_NR_sched_setaffinity 395
|
||||
#define TARGET_NR_sched_setaffinity 395
|
||||
#define TARGET_NR_sched_getaffinity 396
|
||||
#define TARGET_NR_tuxcall 397
|
||||
#define TARGET_NR_io_setup 398
|
||||
|
|
|
@ -695,7 +695,7 @@ static unsigned long create_elf_tables(target_ulong p, int argc, int envc,
|
|||
size *= n;
|
||||
if (size & 15)
|
||||
sp -= 16 - (size & 15);
|
||||
|
||||
|
||||
#define NEW_AUX_ENT(id, val) do { \
|
||||
sp -= n; tputl(sp, val); \
|
||||
sp -= n; tputl(sp, id); \
|
||||
|
@ -833,7 +833,7 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
|
|||
elf_type,
|
||||
interpreter_fd,
|
||||
eppnt->p_offset - TARGET_ELF_PAGEOFFSET(eppnt->p_vaddr));
|
||||
|
||||
|
||||
if (error == -1) {
|
||||
/* Real error */
|
||||
close(interpreter_fd);
|
||||
|
@ -1199,10 +1199,10 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||
int elf_prot = 0;
|
||||
int elf_flags = 0;
|
||||
unsigned long error;
|
||||
|
||||
|
||||
if (elf_ppnt->p_type != PT_LOAD)
|
||||
continue;
|
||||
|
||||
|
||||
if (elf_ppnt->p_flags & PF_R) elf_prot |= PROT_READ;
|
||||
if (elf_ppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
|
||||
if (elf_ppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
|
||||
|
@ -1224,7 +1224,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||
}
|
||||
load_bias = TARGET_ELF_PAGESTART(error - elf_ppnt->p_vaddr);
|
||||
}
|
||||
|
||||
|
||||
error = target_mmap(TARGET_ELF_PAGESTART(load_bias + elf_ppnt->p_vaddr),
|
||||
(elf_ppnt->p_filesz +
|
||||
TARGET_ELF_PAGEOFFSET(elf_ppnt->p_vaddr)),
|
||||
|
@ -1242,7 +1242,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||
if (TARGET_ELF_PAGESTART(elf_ppnt->p_vaddr) < elf_stack)
|
||||
elf_stack = TARGET_ELF_PAGESTART(elf_ppnt->p_vaddr);
|
||||
#endif
|
||||
|
||||
|
||||
if (!load_addr_set) {
|
||||
load_addr_set = 1;
|
||||
load_addr = elf_ppnt->p_vaddr - elf_ppnt->p_offset;
|
||||
|
|
|
@ -38,7 +38,7 @@ struct flat_hdr {
|
|||
target_ulong reloc_start; /* Offset of relocation records from
|
||||
beginning of file */
|
||||
target_ulong reloc_count; /* Number of relocation records */
|
||||
target_ulong flags;
|
||||
target_ulong flags;
|
||||
target_ulong build_date; /* When the program/library was built */
|
||||
target_ulong filler[5]; /* Reservered, set to zero */
|
||||
};
|
||||
|
|
|
@ -376,7 +376,7 @@ void old_reloc(struct lib_info *libinfo, uint32_t rl)
|
|||
break;
|
||||
}
|
||||
DBG_FLT("Relocation became %x\n", (int)*ptr);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
@ -416,7 +416,7 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||
rev, (int) FLAT_VERSION);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
||||
/* Don't allow old format executables to use shared libraries */
|
||||
if (rev == OLD_FLAT_VERSION && id != 0) {
|
||||
fprintf(stderr, "BINFMT_FLAT: shared libraries are not available\n");
|
||||
|
@ -581,7 +581,7 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||
libinfo[id].loaded = 1;
|
||||
libinfo[id].entry = (0x00ffffff & ntohl(hdr->entry)) + textpos;
|
||||
libinfo[id].build_date = ntohl(hdr->build_date);
|
||||
|
||||
|
||||
/*
|
||||
* We just load the allocations into some temporary memory to
|
||||
* help simplify all this mumbo jumbo
|
||||
|
@ -662,7 +662,7 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||
old_reloc(&libinfo[0], relval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* zero the BSS. */
|
||||
memset((void*)(datapos + data_len), 0, bss_len);
|
||||
|
||||
|
@ -732,11 +732,11 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||
stack_len += (bprm->argc + 1) * 4; /* the argv array */
|
||||
stack_len += (bprm->envc + 1) * 4; /* the envp array */
|
||||
|
||||
|
||||
|
||||
res = load_flat_file(bprm, libinfo, 0, &stack_len);
|
||||
if (res > (unsigned long)-4096)
|
||||
return res;
|
||||
|
||||
|
||||
/* Update data segment pointers for all libraries */
|
||||
for (i=0; i<MAX_SHARED_LIBS; i++) {
|
||||
if (libinfo[i].loaded) {
|
||||
|
@ -767,7 +767,7 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||
if ((sp + stack_len) & 15)
|
||||
sp -= 16 - ((sp + stack_len) & 15);
|
||||
sp = loader_build_argptr(bprm->envc, bprm->argc, sp, p, 1);
|
||||
|
||||
|
||||
/* Fake some return addresses to ensure the call chain will
|
||||
* initialise library in order for us. We are required to call
|
||||
* lib 1 first, then 2, ... and finally the main program (id 0).
|
||||
|
@ -784,7 +784,7 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Stash our initial stack pointer into the mm structure */
|
||||
info->start_code = libinfo[0].start_code;
|
||||
info->end_code = libinfo[0].start_code = libinfo[0].text_len;
|
||||
|
@ -798,6 +798,6 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||
|
||||
DBG_FLT("start_thread(entry=0x%x, start_stack=0x%x)\n",
|
||||
(int)info->entry, (int)info->start_stack);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(retval>=0) {
|
||||
/* success. Initialize important registers */
|
||||
do_init_thread(regs, infop);
|
||||
|
|
|
@ -331,7 +331,7 @@ void cpu_loop(CPUARMState *env)
|
|||
unsigned int n, insn;
|
||||
target_siginfo_t info;
|
||||
uint32_t addr;
|
||||
|
||||
|
||||
for(;;) {
|
||||
trapnr = cpu_arm_exec(env);
|
||||
switch(trapnr) {
|
||||
|
@ -343,7 +343,7 @@ void cpu_loop(CPUARMState *env)
|
|||
/* we handle the FPU emulation here, as Linux */
|
||||
/* we get the opcode */
|
||||
opcode = tget32(env->regs[15]);
|
||||
|
||||
|
||||
if (EmulateAll(opcode, &ts->fpa, env) == 0) {
|
||||
info.si_signo = SIGILL;
|
||||
info.si_errno = 0;
|
||||
|
@ -475,7 +475,7 @@ static inline void save_window_offset(CPUSPARCState *env, int cwp1)
|
|||
{
|
||||
unsigned int i;
|
||||
target_ulong sp_ptr;
|
||||
|
||||
|
||||
sp_ptr = env->regbase[get_reg_index(env, cwp1, 6)];
|
||||
#if defined(DEBUG_WIN)
|
||||
printf("win_overflow: sp_ptr=0x%x save_cwp=%d\n",
|
||||
|
@ -506,10 +506,10 @@ static void restore_window(CPUSPARCState *env)
|
|||
{
|
||||
unsigned int new_wim, i, cwp1;
|
||||
target_ulong sp_ptr;
|
||||
|
||||
|
||||
new_wim = ((env->wim << 1) | (env->wim >> (NWINDOWS - 1))) &
|
||||
((1LL << NWINDOWS) - 1);
|
||||
|
||||
|
||||
/* restore the invalid window */
|
||||
cwp1 = (env->cwp + 1) & (NWINDOWS - 1);
|
||||
sp_ptr = env->regbase[get_reg_index(env, cwp1, 6)];
|
||||
|
@ -555,10 +555,10 @@ void cpu_loop (CPUSPARCState *env)
|
|||
{
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
|
||||
|
||||
while (1) {
|
||||
trapnr = cpu_sparc_exec (env);
|
||||
|
||||
|
||||
switch (trapnr) {
|
||||
#ifndef TARGET_SPARC64
|
||||
case 0x88:
|
||||
|
@ -670,17 +670,17 @@ static inline uint64_t cpu_ppc_get_tb (CPUState *env)
|
|||
/* TO FIX */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint32_t cpu_ppc_load_tbl (CPUState *env)
|
||||
{
|
||||
return cpu_ppc_get_tb(env) & 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
|
||||
uint32_t cpu_ppc_load_tbu (CPUState *env)
|
||||
{
|
||||
return cpu_ppc_get_tb(env) >> 32;
|
||||
}
|
||||
|
||||
|
||||
static void cpu_ppc_store_tb (CPUState *env, uint64_t value)
|
||||
{
|
||||
/* TO FIX */
|
||||
|
@ -717,7 +717,7 @@ void cpu_loop(CPUPPCState *env)
|
|||
target_siginfo_t info;
|
||||
int trapnr;
|
||||
uint32_t ret;
|
||||
|
||||
|
||||
for(;;) {
|
||||
trapnr = cpu_ppc_exec(env);
|
||||
if (trapnr != EXCP_SYSCALL_USER && trapnr != EXCP_BRANCH &&
|
||||
|
@ -1452,10 +1452,10 @@ void cpu_loop (CPUState *env)
|
|||
{
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
|
||||
|
||||
while (1) {
|
||||
trapnr = cpu_sh4_exec (env);
|
||||
|
||||
|
||||
switch (trapnr) {
|
||||
case 0x160:
|
||||
ret = do_syscall(env,
|
||||
|
@ -1501,7 +1501,7 @@ void cpu_loop(CPUM68KState *env)
|
|||
unsigned int n;
|
||||
target_siginfo_t info;
|
||||
TaskState *ts = env->opaque;
|
||||
|
||||
|
||||
for(;;) {
|
||||
trapnr = cpu_m68k_exec(env);
|
||||
switch(trapnr) {
|
||||
|
@ -1590,10 +1590,10 @@ void cpu_loop (CPUState *env)
|
|||
{
|
||||
int trapnr;
|
||||
target_siginfo_t info;
|
||||
|
||||
|
||||
while (1) {
|
||||
trapnr = cpu_alpha_exec (env);
|
||||
|
||||
|
||||
switch (trapnr) {
|
||||
case EXCP_RESET:
|
||||
fprintf(stderr, "Reset requested. Exit\n");
|
||||
|
@ -1745,7 +1745,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (optind >= argc)
|
||||
break;
|
||||
|
||||
|
||||
r = argv[optind++];
|
||||
mask = cpu_str_to_log_mask(r);
|
||||
if (!mask) {
|
||||
|
@ -1821,7 +1821,7 @@ int main(int argc, char **argv)
|
|||
qemu_host_page_size */
|
||||
env = cpu_init();
|
||||
global_env = env;
|
||||
|
||||
|
||||
wrk = environ;
|
||||
while (*(wrk++))
|
||||
environ_count++;
|
||||
|
@ -1844,12 +1844,12 @@ int main(int argc, char **argv)
|
|||
for (wrk = target_environ; *wrk; wrk++) {
|
||||
free(*wrk);
|
||||
}
|
||||
|
||||
|
||||
free(target_environ);
|
||||
|
||||
if (loglevel) {
|
||||
page_dump(logfile);
|
||||
|
||||
|
||||
fprintf(logfile, "start_brk 0x%08lx\n" , info->start_brk);
|
||||
fprintf(logfile, "end_code 0x%08lx\n" , info->end_code);
|
||||
fprintf(logfile, "start_code 0x%08lx\n" , info->start_code);
|
||||
|
@ -1870,7 +1870,7 @@ int main(int argc, char **argv)
|
|||
ts->used = 1;
|
||||
ts->info = info;
|
||||
env->user_mode_only = 1;
|
||||
|
||||
|
||||
#if defined(TARGET_I386)
|
||||
cpu_x86_set_cpl(env, 3);
|
||||
|
||||
|
@ -1883,7 +1883,7 @@ int main(int argc, char **argv)
|
|||
|
||||
/* flags setup : we activate the IRQs by default as in user mode */
|
||||
env->eflags |= IF_MASK;
|
||||
|
||||
|
||||
/* linux register setup */
|
||||
#if defined(TARGET_X86_64)
|
||||
env->regs[R_EAX] = regs->rax;
|
||||
|
|
|
@ -52,7 +52,7 @@ int target_mprotect(target_ulong start, target_ulong len, int prot)
|
|||
return -EINVAL;
|
||||
if (len == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
host_start = start & qemu_host_page_mask;
|
||||
host_end = HOST_PAGE_ALIGN(end);
|
||||
if (start > host_start) {
|
||||
|
@ -83,7 +83,7 @@ int target_mprotect(target_ulong start, target_ulong len, int prot)
|
|||
return ret;
|
||||
host_end -= qemu_host_page_size;
|
||||
}
|
||||
|
||||
|
||||
/* handle the pages in the middle */
|
||||
if (host_start < host_end) {
|
||||
ret = mprotect(g2h(host_start), host_end - host_start, prot);
|
||||
|
@ -112,7 +112,7 @@ static int mmap_frag(target_ulong real_start,
|
|||
if (addr < start || addr >= end)
|
||||
prot1 |= page_get_flags(addr);
|
||||
}
|
||||
|
||||
|
||||
if (prot1 == 0) {
|
||||
/* no page was there, so we allocate one */
|
||||
ret = (long)mmap(host_start, qemu_host_page_size, prot,
|
||||
|
@ -134,10 +134,10 @@ static int mmap_frag(target_ulong real_start,
|
|||
/* adjust protection to be able to read */
|
||||
if (!(prot1 & PROT_WRITE))
|
||||
mprotect(host_start, qemu_host_page_size, prot1 | PROT_WRITE);
|
||||
|
||||
|
||||
/* read the corresponding file data */
|
||||
pread(fd, g2h(start), end - start, offset);
|
||||
|
||||
|
||||
/* put final protection */
|
||||
if (prot_new != (prot1 | PROT_WRITE))
|
||||
mprotect(host_start, qemu_host_page_size, prot_new);
|
||||
|
@ -244,7 +244,7 @@ abort();
|
|||
goto the_end1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (start & ~TARGET_PAGE_MASK) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
|
@ -303,7 +303,7 @@ abort();
|
|||
return ret;
|
||||
real_end -= qemu_host_page_size;
|
||||
}
|
||||
|
||||
|
||||
/* map the middle (easier) */
|
||||
if (real_start < real_end) {
|
||||
unsigned long offset1;
|
||||
|
@ -367,7 +367,7 @@ int target_munmap(target_ulong start, target_ulong len)
|
|||
if (prot != 0)
|
||||
real_end -= qemu_host_page_size;
|
||||
}
|
||||
|
||||
|
||||
/* unmap what we can */
|
||||
if (real_start < real_end) {
|
||||
ret = munmap((void *)real_start, real_end - real_start);
|
||||
|
@ -410,7 +410,7 @@ int target_msync(target_ulong start, target_ulong len, int flags)
|
|||
return -EINVAL;
|
||||
if (end == start)
|
||||
return 0;
|
||||
|
||||
|
||||
start &= qemu_host_page_mask;
|
||||
return msync(g2h(start), end - start, flags);
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ static void host_to_target_sigset_internal(target_sigset_t *d,
|
|||
int i;
|
||||
unsigned long sigmask;
|
||||
uint32_t target_sigmask;
|
||||
|
||||
|
||||
sigmask = ((unsigned long *)s)[0];
|
||||
target_sigmask = 0;
|
||||
for(i = 0; i < 32; i++) {
|
||||
|
@ -171,7 +171,7 @@ void target_to_host_sigset(sigset_t *d, const target_sigset_t *s)
|
|||
s1.sig[i] = tswapl(s->sig[i]);
|
||||
target_to_host_sigset_internal(d, &s1);
|
||||
}
|
||||
|
||||
|
||||
void host_to_target_old_sigset(target_ulong *old_sigset,
|
||||
const sigset_t *sigset)
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ void signal_init(void)
|
|||
j = host_to_target_signal_table[i];
|
||||
target_to_host_signal_table[j] = i;
|
||||
}
|
||||
|
||||
|
||||
/* set all host signal handlers. ALL signals are blocked during
|
||||
the handlers to serialize them. */
|
||||
sigfillset(&act.sa_mask);
|
||||
|
@ -283,7 +283,7 @@ void signal_init(void)
|
|||
for(i = 1; i < NSIG; i++) {
|
||||
sigaction(i, &act, NULL);
|
||||
}
|
||||
|
||||
|
||||
memset(sigact_table, 0, sizeof(sigact_table));
|
||||
|
||||
first_free = &sigqueue_table[0];
|
||||
|
@ -865,7 +865,7 @@ long do_sigreturn(CPUX86State *env)
|
|||
|
||||
target_to_host_sigset_internal(&set, &target_set);
|
||||
sigprocmask(SIG_SETMASK, &set, NULL);
|
||||
|
||||
|
||||
/* restore registers */
|
||||
if (restore_sigcontext(env, &frame->sc, &eax))
|
||||
goto badframe;
|
||||
|
@ -1933,7 +1933,7 @@ long do_sigreturn(CPUState *regs)
|
|||
:"r" (®s));
|
||||
/* Unreached */
|
||||
#endif
|
||||
|
||||
|
||||
regs->PC[regs->current_tc] = regs->CP0_EPC;
|
||||
/* I am not sure this is right, but it seems to work
|
||||
* maybe a problem with nested signals ? */
|
||||
|
@ -1995,7 +1995,7 @@ void process_pending_signals(void *cpu_env)
|
|||
target_sigset_t target_old_set;
|
||||
struct emulated_sigaction *k;
|
||||
struct sigqueue *q;
|
||||
|
||||
|
||||
if (!signal_pending)
|
||||
return;
|
||||
|
||||
|
@ -2018,7 +2018,7 @@ void process_pending_signals(void *cpu_env)
|
|||
k->first = q->next;
|
||||
if (!k->first)
|
||||
k->pending = 0;
|
||||
|
||||
|
||||
sig = gdb_handlesig (cpu_env, sig);
|
||||
if (!sig) {
|
||||
fprintf (stderr, "Lost signal\n");
|
||||
|
@ -2044,7 +2044,7 @@ void process_pending_signals(void *cpu_env)
|
|||
blocked during the handler */
|
||||
if (!(k->sa.sa_flags & TARGET_SA_NODEFER))
|
||||
sigaddset(&set, target_to_host_signal(sig));
|
||||
|
||||
|
||||
/* block signals in the handler using Linux */
|
||||
sigprocmask(SIG_BLOCK, &set, &old_set);
|
||||
/* save the previous blocked signal state to restore it at the
|
||||
|
|
|
@ -341,7 +341,7 @@ long do_brk(target_ulong new_brk)
|
|||
return target_brk;
|
||||
if (new_brk < target_original_brk)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
brk_page = HOST_PAGE_ALIGN(target_brk);
|
||||
|
||||
/* If the new brk is less than this, set it and we're done... */
|
||||
|
@ -506,7 +506,7 @@ static long do_select(long n,
|
|||
target_efds = NULL;
|
||||
efds_ptr = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (target_tv) {
|
||||
target_to_host_timeval(&tv, target_tv);
|
||||
tv_ptr = &tv;
|
||||
|
@ -652,13 +652,13 @@ static long do_setsockopt(int sockfd, int level, int optname,
|
|||
target_ulong optval, socklen_t optlen)
|
||||
{
|
||||
int val, ret;
|
||||
|
||||
|
||||
switch(level) {
|
||||
case SOL_TCP:
|
||||
/* TCP options all take an 'int' value. */
|
||||
if (optlen < sizeof(uint32_t))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
val = tget32(optval);
|
||||
ret = get_errno(setsockopt(sockfd, level, optname, &val, sizeof(val)));
|
||||
break;
|
||||
|
@ -918,7 +918,7 @@ static long do_bind(int sockfd, target_ulong target_addr,
|
|||
socklen_t addrlen)
|
||||
{
|
||||
void *addr = alloca(addrlen);
|
||||
|
||||
|
||||
target_to_host_sockaddr(addr, target_addr, addrlen);
|
||||
return get_errno(bind(sockfd, addr, addrlen));
|
||||
}
|
||||
|
@ -927,7 +927,7 @@ static long do_connect(int sockfd, target_ulong target_addr,
|
|||
socklen_t addrlen)
|
||||
{
|
||||
void *addr = alloca(addrlen);
|
||||
|
||||
|
||||
target_to_host_sockaddr(addr, target_addr, addrlen);
|
||||
return get_errno(connect(sockfd, addr, addrlen));
|
||||
}
|
||||
|
@ -955,14 +955,14 @@ static long do_sendrecvmsg(int fd, target_ulong target_msg,
|
|||
msg.msg_controllen = 2 * tswapl(msgp->msg_controllen);
|
||||
msg.msg_control = alloca(msg.msg_controllen);
|
||||
msg.msg_flags = tswap32(msgp->msg_flags);
|
||||
|
||||
|
||||
count = tswapl(msgp->msg_iovlen);
|
||||
vec = alloca(count * sizeof(struct iovec));
|
||||
target_vec = tswapl(msgp->msg_iov);
|
||||
lock_iovec(vec, target_vec, count, send);
|
||||
msg.msg_iovlen = count;
|
||||
msg.msg_iov = vec;
|
||||
|
||||
|
||||
if (send) {
|
||||
target_to_host_cmsg(&msg, msgp);
|
||||
ret = get_errno(sendmsg(fd, &msg, flags));
|
||||
|
@ -1636,7 +1636,7 @@ static long do_ipc(long call, long first, long second, long third,
|
|||
break;
|
||||
raddr = ret;
|
||||
/* find out the length of the shared memory segment */
|
||||
|
||||
|
||||
ret = get_errno(shmctl(first, IPC_STAT, &shm_info));
|
||||
if (is_error(ret)) {
|
||||
/* can't get length, bail out */
|
||||
|
@ -1910,7 +1910,7 @@ static void target_to_host_termios (void *dst, const void *src)
|
|||
{
|
||||
struct host_termios *host = dst;
|
||||
const struct target_termios *target = src;
|
||||
|
||||
|
||||
host->c_iflag =
|
||||
target_to_host_bitmask(tswap32(target->c_iflag), iflag_tbl);
|
||||
host->c_oflag =
|
||||
|
@ -1920,26 +1920,26 @@ static void target_to_host_termios (void *dst, const void *src)
|
|||
host->c_lflag =
|
||||
target_to_host_bitmask(tswap32(target->c_lflag), lflag_tbl);
|
||||
host->c_line = target->c_line;
|
||||
|
||||
|
||||
host->c_cc[VINTR] = target->c_cc[TARGET_VINTR];
|
||||
host->c_cc[VQUIT] = target->c_cc[TARGET_VQUIT];
|
||||
host->c_cc[VERASE] = target->c_cc[TARGET_VERASE];
|
||||
host->c_cc[VERASE] = target->c_cc[TARGET_VERASE];
|
||||
host->c_cc[VKILL] = target->c_cc[TARGET_VKILL];
|
||||
host->c_cc[VEOF] = target->c_cc[TARGET_VEOF];
|
||||
host->c_cc[VEOF] = target->c_cc[TARGET_VEOF];
|
||||
host->c_cc[VTIME] = target->c_cc[TARGET_VTIME];
|
||||
host->c_cc[VMIN] = target->c_cc[TARGET_VMIN];
|
||||
host->c_cc[VMIN] = target->c_cc[TARGET_VMIN];
|
||||
host->c_cc[VSWTC] = target->c_cc[TARGET_VSWTC];
|
||||
host->c_cc[VSTART] = target->c_cc[TARGET_VSTART];
|
||||
host->c_cc[VSTART] = target->c_cc[TARGET_VSTART];
|
||||
host->c_cc[VSTOP] = target->c_cc[TARGET_VSTOP];
|
||||
host->c_cc[VSUSP] = target->c_cc[TARGET_VSUSP];
|
||||
host->c_cc[VEOL] = target->c_cc[TARGET_VEOL];
|
||||
host->c_cc[VREPRINT] = target->c_cc[TARGET_VREPRINT];
|
||||
host->c_cc[VDISCARD] = target->c_cc[TARGET_VDISCARD];
|
||||
host->c_cc[VWERASE] = target->c_cc[TARGET_VWERASE];
|
||||
host->c_cc[VLNEXT] = target->c_cc[TARGET_VLNEXT];
|
||||
host->c_cc[VEOL] = target->c_cc[TARGET_VEOL];
|
||||
host->c_cc[VREPRINT] = target->c_cc[TARGET_VREPRINT];
|
||||
host->c_cc[VDISCARD] = target->c_cc[TARGET_VDISCARD];
|
||||
host->c_cc[VWERASE] = target->c_cc[TARGET_VWERASE];
|
||||
host->c_cc[VLNEXT] = target->c_cc[TARGET_VLNEXT];
|
||||
host->c_cc[VEOL2] = target->c_cc[TARGET_VEOL2];
|
||||
}
|
||||
|
||||
|
||||
static void host_to_target_termios (void *dst, const void *src)
|
||||
{
|
||||
struct target_termios *target = dst;
|
||||
|
@ -1954,7 +1954,7 @@ static void host_to_target_termios (void *dst, const void *src)
|
|||
target->c_lflag =
|
||||
tswap32(host_to_target_bitmask(host->c_lflag, lflag_tbl));
|
||||
target->c_line = host->c_line;
|
||||
|
||||
|
||||
target->c_cc[TARGET_VINTR] = host->c_cc[VINTR];
|
||||
target->c_cc[TARGET_VQUIT] = host->c_cc[VQUIT];
|
||||
target->c_cc[TARGET_VERASE] = host->c_cc[VERASE];
|
||||
|
@ -2052,7 +2052,7 @@ static int write_ldt(CPUX86State *env,
|
|||
ldt_info.limit = tswap32(target_ldt_info->limit);
|
||||
ldt_info.flags = tswap32(target_ldt_info->flags);
|
||||
unlock_user_struct(target_ldt_info, ptr, 0);
|
||||
|
||||
|
||||
if (ldt_info.entry_number >= TARGET_LDT_ENTRIES)
|
||||
return -EINVAL;
|
||||
seg_32bit = ldt_info.flags & 1;
|
||||
|
@ -2093,7 +2093,7 @@ static int write_ldt(CPUX86State *env,
|
|||
goto install;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
entry_1 = ((ldt_info.base_addr & 0x0000ffff) << 16) |
|
||||
(ldt_info.limit & 0x0ffff);
|
||||
entry_2 = (ldt_info.base_addr & 0xff000000) |
|
||||
|
@ -2120,7 +2120,7 @@ install:
|
|||
int do_modify_ldt(CPUX86State *env, int func, target_ulong ptr, unsigned long bytecount)
|
||||
{
|
||||
int ret = -ENOSYS;
|
||||
|
||||
|
||||
switch (func) {
|
||||
case 0:
|
||||
ret = read_ldt(ptr, bytecount);
|
||||
|
@ -2155,7 +2155,7 @@ int do_fork(CPUState *env, unsigned int flags, unsigned long newsp)
|
|||
TaskState *ts;
|
||||
uint8_t *new_stack;
|
||||
CPUState *new_env;
|
||||
|
||||
|
||||
if (flags & CLONE_VM) {
|
||||
ts = malloc(sizeof(TaskState) + NEW_STACK_SIZE);
|
||||
memset(ts, 0, sizeof(TaskState));
|
||||
|
@ -2263,7 +2263,7 @@ static long do_fcntl(int fd, int cmd, target_ulong arg)
|
|||
unlock_user_struct(target_fl, arg, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TARGET_F_SETLK:
|
||||
case TARGET_F_SETLKW:
|
||||
lock_user_struct(target_fl, arg, 1);
|
||||
|
@ -2275,7 +2275,7 @@ static long do_fcntl(int fd, int cmd, target_ulong arg)
|
|||
unlock_user_struct(target_fl, arg, 0);
|
||||
ret = fcntl(fd, cmd, &fl);
|
||||
break;
|
||||
|
||||
|
||||
case TARGET_F_GETLK64:
|
||||
lock_user_struct(target_fl64, arg, 1);
|
||||
fl64.l_type = tswap16(target_fl64->l_type) >> 1;
|
||||
|
@ -2468,7 +2468,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
struct stat st;
|
||||
struct statfs stfs;
|
||||
void *p;
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
gemu_log("syscall %d", num);
|
||||
#endif
|
||||
|
@ -2980,7 +2980,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
{
|
||||
int how = arg1;
|
||||
sigset_t set, oldset, *set_ptr;
|
||||
|
||||
|
||||
if (arg2) {
|
||||
switch(how) {
|
||||
case TARGET_SIG_BLOCK:
|
||||
|
@ -3017,7 +3017,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
{
|
||||
int how = arg1;
|
||||
sigset_t set, oldset, *set_ptr;
|
||||
|
||||
|
||||
if (arg2) {
|
||||
switch(how) {
|
||||
case TARGET_SIG_BLOCK:
|
||||
|
@ -3098,7 +3098,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
sigset_t set;
|
||||
struct timespec uts, *puts;
|
||||
siginfo_t uinfo;
|
||||
|
||||
|
||||
p = lock_user(arg1, sizeof(target_sigset_t), 1);
|
||||
target_to_host_sigset(&set, p);
|
||||
unlock_user(p, arg1, 0);
|
||||
|
@ -3159,7 +3159,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
int resource = arg1;
|
||||
struct target_rlimit *target_rlim;
|
||||
struct rlimit rlim;
|
||||
|
||||
|
||||
ret = get_errno(getrlimit(resource, &rlim));
|
||||
if (!is_error(ret)) {
|
||||
lock_user_struct(target_rlim, arg2, 0);
|
||||
|
@ -3357,7 +3357,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
convert_statfs:
|
||||
if (!is_error(ret)) {
|
||||
struct target_statfs *target_stfs;
|
||||
|
||||
|
||||
lock_user_struct(target_stfs, arg2, 0);
|
||||
/* ??? put_user is probably wrong. */
|
||||
put_user(stfs.f_type, &target_stfs->f_type);
|
||||
|
@ -3384,7 +3384,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
convert_statfs64:
|
||||
if (!is_error(ret)) {
|
||||
struct target_statfs64 *target_stfs;
|
||||
|
||||
|
||||
lock_user_struct(target_stfs, arg3, 0);
|
||||
/* ??? put_user is probably wrong. */
|
||||
put_user(stfs.f_type, &target_stfs->f_type);
|
||||
|
@ -3530,7 +3530,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
case TARGET_NR_getitimer:
|
||||
{
|
||||
struct itimerval value;
|
||||
|
||||
|
||||
ret = get_errno(getitimer(arg1, &value));
|
||||
if (!is_error(ret) && arg2) {
|
||||
host_to_target_timeval(arg2,
|
||||
|
@ -3699,7 +3699,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
/* no need to transcode because we use the linux syscall */
|
||||
{
|
||||
struct new_utsname * buf;
|
||||
|
||||
|
||||
lock_user_struct(buf, arg1, 0);
|
||||
ret = get_errno(sys_uname(buf));
|
||||
if (!is_error(ret)) {
|
||||
|
@ -3786,7 +3786,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
dirp = malloc(count);
|
||||
if (!dirp)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
ret = get_errno(sys_getdents(arg1, dirp, count));
|
||||
if (!is_error(ret)) {
|
||||
struct dirent *de;
|
||||
|
@ -4354,7 +4354,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
|
|||
uint32_t *target_grouplist;
|
||||
gid_t *grouplist;
|
||||
int i;
|
||||
|
||||
|
||||
grouplist = alloca(gidsetsize * sizeof(gid_t));
|
||||
target_grouplist = lock_user(arg2, gidsetsize * 4, 1);
|
||||
for(i = 0;i < gidsetsize; i++)
|
||||
|
|
|
@ -748,9 +748,9 @@ struct target_pollfd {
|
|||
*/
|
||||
#define TARGET_CDROMREADCOOKED 0x5315 /* read data in cooked mode */
|
||||
#define TARGET_CDROMSEEK 0x5316 /* seek msf address */
|
||||
|
||||
|
||||
/*
|
||||
* This ioctl is only used by the scsi-cd driver.
|
||||
* This ioctl is only used by the scsi-cd driver.
|
||||
It is for playing audio in logical block addressing mode.
|
||||
*/
|
||||
#define TARGET_CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */
|
||||
|
|
|
@ -28,7 +28,7 @@ STRUCT(ifmap,
|
|||
|
||||
STRUCT(sockaddr_ifreq,
|
||||
MK_ARRAY(TYPE_CHAR, IFNAMSIZ), MK_STRUCT(STRUCT_sockaddr))
|
||||
|
||||
|
||||
STRUCT(short_ifreq,
|
||||
MK_ARRAY(TYPE_CHAR, IFNAMSIZ), TYPE_SHORT)
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ static inline void return_to_32bit(CPUX86State *env, int retval)
|
|||
static inline int set_IF(CPUX86State *env)
|
||||
{
|
||||
TaskState *ts = env->opaque;
|
||||
|
||||
|
||||
ts->v86flags |= VIF_MASK;
|
||||
if (ts->v86flags & VIP_MASK) {
|
||||
return_to_32bit(env, TARGET_VM86_STI);
|
||||
|
@ -264,7 +264,7 @@ void handle_vm86_fault(CPUX86State *env)
|
|||
csp = (uint8_t *)(env->segs[R_CS].selector << 4);
|
||||
ip = env->eip & 0xffff;
|
||||
pc = csp + ip;
|
||||
|
||||
|
||||
ssp = (uint8_t *)(env->segs[R_SS].selector << 4);
|
||||
sp = env->regs[R_ESP] & 0xffff;
|
||||
|
||||
|
@ -362,12 +362,12 @@ void handle_vm86_fault(CPUX86State *env)
|
|||
return;
|
||||
}
|
||||
VM86_FAULT_RETURN;
|
||||
|
||||
|
||||
case 0xfa: /* cli */
|
||||
env->eip = ip;
|
||||
clear_IF(env);
|
||||
VM86_FAULT_RETURN;
|
||||
|
||||
|
||||
case 0xfb: /* sti */
|
||||
env->eip = ip;
|
||||
if (set_IF(env))
|
||||
|
@ -386,7 +386,7 @@ int do_vm86(CPUX86State *env, long subfunction, target_ulong vm86_addr)
|
|||
TaskState *ts = env->opaque;
|
||||
struct target_vm86plus_struct * target_v86;
|
||||
int ret;
|
||||
|
||||
|
||||
switch (subfunction) {
|
||||
case TARGET_VM86_REQUEST_IRQ:
|
||||
case TARGET_VM86_FREE_IRQ:
|
||||
|
@ -470,7 +470,7 @@ int do_vm86(CPUX86State *env, long subfunction, target_ulong vm86_addr)
|
|||
memcpy(&ts->vm86plus.vm86plus.vm86dbg_intxxtab,
|
||||
target_v86->vm86plus.vm86dbg_intxxtab, 32);
|
||||
unlock_user_struct(target_v86, vm86_addr, 0);
|
||||
|
||||
|
||||
#ifdef DEBUG_VM86
|
||||
fprintf(logfile, "do_vm86: cs:ip=%04x:%04x\n",
|
||||
env->segs[R_CS].selector, env->eip);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue