2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
12 #include <sys/utsname.h>
13 #include <sys/param.h>
15 #include "asm/types.h"
24 #include "kern_util.h"
28 #include "ptrace_user.h"
29 #include "uml-config.h"
32 #include "kern_constants.h"
34 void stack_protections(unsigned long address)
36 if(mprotect((void *) address, UM_THREAD_SIZE,
37 PROT_READ | PROT_WRITE | PROT_EXEC) < 0)
38 panic("protecting stack failed, errno = %d", errno);
46 CATCH_EINTR(err = tcgetattr(fd, &tt));
52 CATCH_EINTR(err = tcsetattr(fd, TCSADRAIN, &tt));
56 /* XXX tcsetattr could have applied only some changes
57 * (and cfmakeraw() is a set of changes) */
61 void setup_machinename(char *machine_out)
66 #ifdef UML_CONFIG_UML_X86
67 # ifndef UML_CONFIG_64BIT
68 if (!strcmp(host.machine, "x86_64")) {
69 strcpy(machine_out, "i686");
73 if (!strcmp(host.machine, "i686")) {
74 strcpy(machine_out, "x86_64");
79 strcpy(machine_out, host.machine);
82 void setup_hostinfo(char *buf, int len)
87 snprintf(buf, len, "%s %s %s %s %s", host.sysname, host.nodename,
88 host.release, host.version, host.machine);
91 int setjmp_wrapper(void (*proc)(void *, void *), ...)
100 (*proc)(&buf, &args);
106 void os_dump_core(void)
108 signal(SIGSEGV, SIG_DFL);