Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321816
b: refs/heads/master
c: be53db6
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Aug 19, 2012
1 parent 5270dcc commit 7d6f858
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 121 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2db633d301b4b50f5f93de0e8314cc81e9bc7de
refs/heads/master: be53db6e4edd9dc013b21a929ad2b142dea8b9c0
5 changes: 4 additions & 1 deletion trunk/arch/alpha/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ struct switch_stack {
#define task_pt_regs(task) \
((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)

#define force_successful_syscall_return() (task_pt_regs(current)->r0 = 0)
#define current_pt_regs() \
((struct pt_regs *) ((char *)current_thread_info() + 2*PAGE_SIZE) - 1)

#define force_successful_syscall_return() (current_pt_regs()->r0 = 0)

#endif

Expand Down
109 changes: 0 additions & 109 deletions trunk/arch/alpha/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -796,115 +796,6 @@ sys_rt_sigreturn:
br ret_from_sys_call
.end sys_rt_sigreturn

.align 4
.globl sys_sethae
.ent sys_sethae
sys_sethae:
.prologue 0
stq $16, 152($sp)
ret
.end sys_sethae

.align 4
.globl osf_getpriority
.ent osf_getpriority
osf_getpriority:
lda $sp, -16($sp)
stq $26, 0($sp)
.prologue 0

jsr $26, sys_getpriority

ldq $26, 0($sp)
blt $0, 1f

/* Return value is the unbiased priority, i.e. 20 - prio.
This does result in negative return values, so signal
no error by writing into the R0 slot. */
lda $1, 20
stq $31, 16($sp)
subl $1, $0, $0
unop

1: lda $sp, 16($sp)
ret
.end osf_getpriority

.align 4
.globl sys_getxuid
.ent sys_getxuid
sys_getxuid:
.prologue 0
ldq $2, TI_TASK($8)
ldq $3, TASK_CRED($2)
ldl $0, CRED_UID($3)
ldl $1, CRED_EUID($3)
stq $1, 80($sp)
ret
.end sys_getxuid

.align 4
.globl sys_getxgid
.ent sys_getxgid
sys_getxgid:
.prologue 0
ldq $2, TI_TASK($8)
ldq $3, TASK_CRED($2)
ldl $0, CRED_GID($3)
ldl $1, CRED_EGID($3)
stq $1, 80($sp)
ret
.end sys_getxgid

.align 4
.globl sys_getxpid
.ent sys_getxpid
sys_getxpid:
.prologue 0
ldq $2, TI_TASK($8)

/* See linux/kernel/timer.c sys_getppid for discussion
about this loop. */
ldq $3, TASK_GROUP_LEADER($2)
ldq $4, TASK_REAL_PARENT($3)
ldl $0, TASK_TGID($2)
1: ldl $1, TASK_TGID($4)
#ifdef CONFIG_SMP
mov $4, $5
mb
ldq $3, TASK_GROUP_LEADER($2)
ldq $4, TASK_REAL_PARENT($3)
cmpeq $4, $5, $5
beq $5, 1b
#endif
stq $1, 80($sp)
ret
.end sys_getxpid

.align 4
.globl sys_alpha_pipe
.ent sys_alpha_pipe
sys_alpha_pipe:
lda $sp, -16($sp)
stq $26, 0($sp)
.prologue 0

mov $31, $17
lda $16, 8($sp)
jsr $26, do_pipe_flags

ldq $26, 0($sp)
bne $0, 1f

/* The return values are in $0 and $20. */
ldl $1, 12($sp)
ldl $0, 8($sp)

stq $1, 80+16($sp)
1: lda $sp, 16($sp)
ret
.end sys_alpha_pipe

.align 4
.globl sys_execve
.ent sys_execve
Expand Down
49 changes: 49 additions & 0 deletions trunk/arch/alpha/kernel/osf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,3 +1404,52 @@ SYSCALL_DEFINE3(osf_writev, unsigned long, fd,
}

#endif

SYSCALL_DEFINE2(osf_getpriority, int, which, int, who)
{
int prio = sys_getpriority(which, who);
if (prio >= 0) {
/* Return value is the unbiased priority, i.e. 20 - prio.
This does result in negative return values, so signal
no error */
force_successful_syscall_return();
prio = 20 - prio;
}
return prio;
}

SYSCALL_DEFINE0(getxuid)
{
current_pt_regs()->r20 = sys_geteuid();
return sys_getuid();
}

SYSCALL_DEFINE0(getxgid)
{
current_pt_regs()->r20 = sys_getegid();
return sys_getgid();
}

SYSCALL_DEFINE0(getxpid)
{
current_pt_regs()->r20 = sys_getppid();
return sys_getpid();
}

SYSCALL_DEFINE0(alpha_pipe)
{
int fd[2];
int res = do_pipe_flags(fd, 0);
if (!res) {
/* The return values are in $0 and $20. */
current_pt_regs()->r20 = fd[1];
res = fd[0];
}
return res;
}

SYSCALL_DEFINE1(sethae, unsigned long, val)
{
current_pt_regs()->hae = val;
return 0;
}
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/systbls.S
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ sys_call_table:
.quad sys_socket
.quad sys_connect
.quad sys_accept
.quad osf_getpriority /* 100 */
.quad sys_osf_getpriority /* 100 */
.quad sys_send
.quad sys_recv
.quad sys_sigreturn
Expand Down
9 changes: 0 additions & 9 deletions trunk/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1407,13 +1407,6 @@ SYSCALL_DEFINE1(alarm, unsigned int, seconds)

#endif

#ifndef __alpha__

/*
* The Alpha uses getxpid, getxuid, and getxgid instead. Maybe this
* should be moved into arch/i386 instead?
*/

/**
* sys_getpid - return the thread group id of the current process
*
Expand Down Expand Up @@ -1469,8 +1462,6 @@ SYSCALL_DEFINE0(getegid)
return from_kgid_munged(current_user_ns(), current_egid());
}

#endif

static void process_timeout(unsigned long __data)
{
wake_up_process((struct task_struct *)__data);
Expand Down

0 comments on commit 7d6f858

Please sign in to comment.