summaryrefslogtreecommitdiff
path: root/src/arch/x86/linux/syscalls.cc
AgeCommit message (Collapse)Author
2014-10-20x86: Fixes to avoid LTO warningsAndreas Hansson
This patch fixes a few minor issues that caused link-time warnings when using LTO, mainly for x86. The most important change is how the syscall array is created. Previously gcc and clang would complain that the declaration and definition types did not match. The organisation is now changed to match how it is done for ARM, moving the code that was previously in syscalls.cc into process.cc, and having a class variable pointing to the static array. With these changes, there are no longer any warnings using gcc 4.6.3 with LTO.
2014-10-20sim: implement getdents/getdents64 in user modeMichael Adler
Has been tested only for alpha. Committed by: Nilay Vaish <nilay@cs.wisc.edu>
2013-10-07x86: enables lstat and readlink syscallsNilay Vaish
2013-04-23x86: enable gettimeofday and getppid system callsMichael Levenhagen
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
2012-08-15sysemul: bump all linux versions of for syscal emulation to 3.0.Ali Saidi
New tool chains seem to be looking for kernel versions newer than what this this was previously set to. Also take this opportunity to change the hostname we report in uname to sim.gem5.org.
2012-08-06syscall emulation: Enabled getrlimit and getrusage for x86.Marc Orr
Added/moved rlimit constants to base linux header file. This patch is a revised version of Vince Weaver's earlier patch.
2012-08-06syscall emulation: Clean up ioctl handling, and implement for x86.Marc Orr
Enable different whitelists for different OS/arch combinations, since some use the generic Linux definitions only, and others use definitions inherited from earlier Unix flavors on those architectures. Also update x86 function pointers so ioctl is no longer unimplemented on that platform. This patch is a revised version of Vince Weaver's earlier patch.
2012-07-10syscall emulation: Add the futex system call.Marc Orr
2012-04-29X86: Make gem5 ignore a bunch of syscalls.Vince Weaver
2012-02-24MEM: Make port proxies use references rather than pointersAndreas Hansson
This patch is adding a clearer design intent to all objects that would not be complete without a port proxy by making the proxies members rathen than dynamically allocated. In essence, if NULL would not be a valid value for the proxy, then we avoid using a pointer to make this clear. The same approach is used for the methods using these proxies, such as loadSections, that now use references rather than pointers to better reflect the fact that NULL would not be an acceptable value (in fact the code would break and that is how this patch started out). Overall the concept of "using a reference to express unconditional composition where a NULL pointer is never valid" could be done on a much broader scale throughout the code base, but for now it is only done in the locations affected by the proxies.
2012-01-17MEM: Add port proxies instead of non-structural portsAndreas Hansson
Port proxies are used to replace non-structural ports, and thus enable all ports in the system to correspond to a structural entity. This has the advantage of accessing memory through the normal memory subsystem and thus allowing any constellation of distributed memories, address maps, etc. Most accesses are done through the "system port" that is used for loading binaries, debugging etc. For the entities that belong to the CPU, e.g. threads and thread contexts, they wrap the CPU data port in a port proxy. The following replacements are made: FunctionalPort > PortProxy TranslatingPort > SETranslatingPortProxy VirtualPort > FSTranslatingPortProxy --HG-- rename : src/mem/vport.cc => src/mem/fs_translating_port_proxy.cc rename : src/mem/vport.hh => src/mem/fs_translating_port_proxy.hh rename : src/mem/translating_port.cc => src/mem/se_translating_port_proxy.cc rename : src/mem/translating_port.hh => src/mem/se_translating_port_proxy.hh
2011-04-15includes: sort all includesNathan Binkert
2010-08-23X86: Create a directory for files that define register indexes.Gabe Black
This is to help tidy up arch/x86. These files should not be used external to the ISA. --HG-- rename : src/arch/x86/apicregs.hh => src/arch/x86/regs/apic.hh rename : src/arch/x86/floatregs.hh => src/arch/x86/regs/float.hh rename : src/arch/x86/intregs.hh => src/arch/x86/regs/int.hh rename : src/arch/x86/miscregs.hh => src/arch/x86/regs/misc.hh rename : src/arch/x86/segmentregs.hh => src/arch/x86/regs/segment.hh
2010-05-23copyright: Change HP copyright on x86 code to be more friendlyNathan Binkert
2009-11-04X86: Hook up time syscall on X86Vince Weaver
This has been tested and verified that it works.
2009-10-30X86: Hookup truncate/ftruncate syscalls on X86Vince Weaver
This patch hooks up the truncate, ftruncate, truncate64 and ftruncate64 system calls on 32-bit and 64-bit X86. These have been tested on both architectures. ftruncate/ftruncate64 is needed for the f90 spec2k benchmarks.
2009-10-30Syscalls: Make system calls access arguments like a stack, not an array.Gabe Black
When accessing arguments for a syscall, the position of an argument depends on the policies of the ISA, how much space preceding arguments took up, and the "alignment" of the index for this particular argument into the number of possible storate locations. This change adjusts getSyscallArg to take its index parameter by reference instead of value and to adjust it to point to the possible location of the next argument on the stack, basically just after the current one. This way, the rules for the new argument can be applied locally without knowing about other arguments since those have already been taken into account implicitly. All system calls have also been changed to reflect the new interface. In a number of cases this made the implementation clearer since it encourages arguments to be collected in one place in order and then used as necessary later, as opposed to scattering them throughout the function or using them in place in long expressions. It also discourages using getSyscallArg over and over to retrieve the same value when a temporary would do the job.
2009-10-20hook up stat syscall on 64-bit x86_SEVince Weaver
2009-10-20hook up stat64 syscall on 32-bit X86_SEVince Weaver
2009-10-19Enable getuid and getgid related syscalls on X86_SEVince Weaver
I've tested these on x86 and they work as expected. In theory for 32-bit x86 we should have some sort of special handling for the legacy 16-bit uid/gid syscalls, but in practice modern toolchains don't use the 16-bit versions, and m5 sets the uid and gid values to be less than 16-bits anyway. This fix is needed for the perl spec2k benchmarks to run.
2009-10-16Ignore rt_sigaction() syscalls on x86 and x86_64Vince Weaver
This is currently how alpha handles this syscall. This is needed for the gcc spec2k benchmarks to run.
2009-10-10Hook up the munmap() syscall for 32-bit x86.Vince Weaver
This is straightforward, as munmapFunc() doesn't do anything. I've tested it with code running munmap() just in case.
2009-09-15Syscalls: Implement sysinfo() syscall.Vince Weaver
2009-09-15[mq]: x86syscalls.patchVince Weaver
2009-04-21Commit m5threads package.Daniel Sanchez
This patch adds limited multithreading support in syscall-emulation mode, by using the clone system call. The clone system call works for Alpha, SPARC and x86, and multithreaded applications run correctly in Alpha and SPARC.
2009-04-19SE mode: Make keeping track of the number of syscalls less hacky.Gabe Black
2009-02-27X86: Install the exit system call.Gabe Black
2009-02-27X86: Install the 32 bit write system call.Gabe Black
2009-02-27X86: Add a 32 bit mmap2 system call.Gabe Black
2009-02-27X86: Install a 32 bit fstat64 system call.Gabe Black
2009-02-27X86: Implement the 32 bit set_thread_area system call.Gabe Black
2009-02-27X86: Install some 32 bit system calls.Gabe Black
2009-02-27Processes: Make getting and setting system call arguments part of a process ↵Gabe Black
object.
2009-02-27X86: Add a class to support 32 bit x86 linux process.Gabe Black
2009-02-16sycalls: implement mremap() and add DATA flag for getrlimit(). mremap has ↵Lisa Hsu
been tested on Alpha, compiles for the rest but not tested. I don't see why it wouldn't work though.
2008-11-15syscalls: fix latent brk/obreak bug.Steve Reinhardt
Bogus calls to ChunkGenerator with negative size were triggering a new assertion that was added there. Also did a little renaming and cleanup in the process.
2007-12-01X86: Separate the effective seg base and the "hidden" seg base.Gabe Black
--HG-- extra : convert_revision : 5fcb8d94dbab7a7d6fe797277a5856903c885ad4
2007-09-19X86: Enable the rename system call.Gabe Black
--HG-- extra : convert_revision : bc4a3b5b5ce8e17f632e65ce89df91e2b50e1274
2007-09-19X86: Enable the unlink system call.Gabe Black
--HG-- extra : convert_revision : 4230a13fdb652a87271f8d2ac9ead96cd2af07a5
2007-08-28X86: Hook in an implementation for lseek.Gabe Black
--HG-- extra : convert_revision : d2424e73fa8ce56248c4edbda9db2714c4b0a92e
2007-08-04X86: Add the arch_prctl system call and fix up some microcoding.Gabe Black
The arch_prctl system call is used to set and get the FS and GS segment bases. The FS segment is use for TLS, so glibc needs to be able to set it up. --HG-- extra : convert_revision : 79501491a15967a7a862add846ff88a934fb1b37
2007-07-30X86: Turn on the exit_group, exit, munmap, and write syscalls.Gabe Black
--HG-- extra : convert_revision : e358c18cd999a8e274108e06502c3324c2d12d3b
2007-07-30X86: Turn on some system calls, and make the kernel version match my ↵Gabe Black
development machine. --HG-- extra : convert_revision : 2f1969a45aa82708dc4cddef09c01306f76f0a81
2007-07-26Add functions for mmap and brk.Gabe Black
--HG-- extra : convert_revision : 3d0340a2aae87b3462d6562b34ac7e02c685c1ef
2007-07-24Add a tgt_iovec structure to support writev, change the name of X86Linux to ↵Gabe Black
X86Linux64, add some syscalls. --HG-- extra : convert_revision : 9c13e9c68f331fe6c4a9abd96f7aee0f064101fc
2007-07-22Add the "open" syscall.Gabe Black
--HG-- extra : convert_revision : d405ed5d3738639809dd2887955db9253138ccbb
2007-03-06Get X86 to load an elf and start a process for it.Gabe Black
src/arch/x86/SConscript: Add in process source files. src/arch/x86/isa_traits.hh: Replace magic constant numbers with the x86 register names. src/arch/x86/miscregfile.cc: Make clear the miscreg file succeed. There aren't any misc regs, so clearing them is very easy. src/arch/x86/process.hh: An X86 process class. src/base/loader/elf_object.cc: Add in code to recognize x86 as an architecture. src/base/traceflags.py: Add an x86 traceflag src/sim/process.cc: Add in code to create an x86 process. src/arch/x86/intregs.hh: A file which declares names for the integer register indices. src/arch/x86/linux/linux.cc: src/arch/x86/linux/linux.hh: A very simple translation of SPARC's linux.cc and linux.hh. It's probably not correct for x86, but it might not be correct for SPARC either. src/arch/x86/linux/process.cc: src/arch/x86/linux/process.hh: An x86 linux process. The syscall table is split out into it's own file. src/arch/x86/linux/syscalls.cc: The x86 Linux syscall table and the uname function. src/arch/x86/process.cc: The x86 process base class. tests/test-progs/hello/bin/x86/linux/hello: An x86 hello world test binary. --HG-- extra : convert_revision : f22919e010c07aeaf5757dca054d9877a537fd08