system initialization, and sets the IDT entry corresponding to vector 128 (Ox80) to invoke the system call exception handler.
When compiling and linking a program that makes a system call, the libc library wrapper routine for that system call stores the appropriate system call number in the eax register, and executes the int 0x80 assembly language instruction to generate the hardware exception. The exception handler in the kernel for this vector is the system_call() system call handler. system_call() saves the contents of registers in the kernel- mode stack, handles the call by invoking a corresponding C function in the kernel, and exits the handler by means of the ret_from_sys_call() function.
5.16.3.2System p
On System p systems, the PowerPC and POWER architecture provides the assembly instruction supervisor call (SC) to make a system call. The kernel also uses the sc instruction to make hypervisor calls when the SLES system is running in a logical partition. The processor distinguishes between hypervisor calls and system calls by examining the general purpose register 0 (GPR0).
If the GPR0 contains
5.16.3.3System z
On System z, z/Architecture provides the SuperVisor Call assembly instruction SVC() to make a system call. The SVC instruction generates an exception. The exception handler in the kernel redirects the call to the system call handler, system_call(). system_call() saves the contents of registers in the kernel mode stack, handles the call by invoking a corresponding C function in the kernel, and exits the handler by means of the ret_from_sys_call() function.
5.16.3.4eServer 326
The AMD Opteron processors differ significantly from x86 architecture with respect to the entry point into the kernel. The Opteron processor provides the SYSCALL and SYSRET special instructions instead of using the interrupt 0x80. The SYSCALL assembly instruction performs a call to the system_call() system call handler running at CPL level 0.
The address of the target procedure is specified implicitly through Model Specific Registers (MSRs). system_call() saves the contents of registers in the kernel mode stack, handles the call by invoking a corresponding C function in the kernel, and executes the SYSRET privileged instruction to return control back to the user space.
5.16.4System call argument verification
The process of transferring control from user mode to kernel mode does not generate any
216