patch-2.1.29 linux/arch/sparc/kernel/sclow.S
Next file: linux/arch/sparc/kernel/setup.c
Previous file: linux/arch/sparc/kernel/rtrap.S
Back to the patch index
Back to the overall index
- Lines: 159
- Date:
Wed Mar 5 17:04:30 1997
- Orig file:
v2.1.28/linux/arch/sparc/kernel/sclow.S
- Orig date:
Sat Nov 9 00:11:43 1996
diff -u --recursive --new-file v2.1.28/linux/arch/sparc/kernel/sclow.S linux/arch/sparc/kernel/sclow.S
@@ -34,27 +34,34 @@
LABEL(sunosnop):
CC_AND_RETT
+#if 0
+/* Not SMP safe */
.globl LABEL(sunosgetpid)
LABEL(sunosgetpid):
LOAD_CURRENT(l4, l5)
- ld [%l4 + 108], %i0
- ld [%l4 + 256], %l5
- ld [%l5 + 108], %i1
+ ld [%l4 + AOFF_task_pid], %i0
+ ld [%l4 + AOFF_task_p_opptr], %l5
+ ld [%l5 + AOFF_task_pid], %i1
CC_AND_RETT
+#endif
+#if (ASIZ_task_uid == 2 && ASIZ_task_euid == 2)
.globl LABEL(sunosgetuid)
LABEL(sunosgetuid):
LOAD_CURRENT(l4, l5)
- lduh [%l4 + 280], %i0
- lduh [%l4 + 282], %i1
+ lduh [%l4 + AOFF_task_uid], %i0
+ lduh [%l4 + AOFF_task_euid], %i1
CC_AND_RETT
+#endif
+#if (ASIZ_task_gid == 2 && ASIZ_task_egid == 2)
.globl LABEL(sunosgetgid)
LABEL(sunosgetgid):
LOAD_CURRENT(l4, l5)
- lduh [%l4 + 288], %i0
- lduh [%l4 + 290], %i1
+ lduh [%l4 + AOFF_task_gid], %i0
+ lduh [%l4 + AOFF_task_egid], %i1
CC_AND_RETT
+#endif
.globl LABEL(sunosmctl)
LABEL(sunosmctl):
@@ -71,9 +78,9 @@
LOAD_CURRENT(l4, l5)
set -65793, %l5
and %i0, %l5, %l5
- ld [%l4 + TASK_BLOCKED], %i0
+ ld [%l4 + AOFF_task_blocked], %i0
or %i0, %l5, %l5
- st %l5, [%l4 + TASK_BLOCKED]
+ st %l5, [%l4 + AOFF_task_blocked]
CC_AND_RETT
.globl LABEL(sunossmask)
@@ -81,102 +88,14 @@
LOAD_CURRENT(l4, l5)
set -65793, %l5
and %i0, %l5, %l5
- ld [%l4 + TASK_BLOCKED], %i0
- st %l5, [%l4 + TASK_BLOCKED]
+ ld [%l4 + AOFF_task_blocked], %i0
+ st %l5, [%l4 + AOFF_task_blocked]
CC_AND_RETT
.globl LABEL(getpagesize)
LABEL(getpagesize):
set 4096, %i0
CC_AND_RETT
-
- .globl LABEL(umask)
-LABEL(umask):
- LOAD_CURRENT(l4, l5)
- ld [%l4 + 1560], %l5
- and %i0, 511, %l4
- lduh [%l5 + 4], %i0
- sth %l4, [%l5 + 4]
- CC_AND_RETT
-
-#if 0
- .globl LABEL(write)
-LABEL(write):
- cmp %i0, 255 /* fd >= NR_OPEN */
- bgu,a write_error_return
- mov EBADF, %i0
-
- LOAD_CURRENT(l4, l5)
- ld [%l4 + 1564], %l5
- sll %i0, 2, %l6
- add %l5, %l6, %l5
- ld [%l5 + 36], %l6
- cmp %l6, 0 /* !(file=current->files->fd[fd]) */
- be,a write_error_return
- mov EBADF, %i0
-
- ld [%l6 + 36], %l5
- cmp %l5, 0 /* !(inode=file->f_inode) */
- be,a write_error_return
- mov EBADF, %i0
-
- lduh [%l6], %l5 /* !(file->f_mode & 2) */
- andcc %l5, 2, %g0
- be,a write_error_return
- mov EBADF, %i0
-
- ld [%l6 + 40], %l5
- cmp %l5, 0 /* !file->f_op */
- be,a write_error_return
- mov EINVAL, %i0
-
- ld [%l5 + 8], %l5 /* !file->f_op->write */
- cmp %l5, 0
- be,a write_error_return
- mov EINVAL, %i0
-
- cmp %i2, 0 /* count == 0 */
- bne 1f
- nop
-
- mov 0, %i0
- CC_AND_RETT
-
-1:
- /* See if we can do the optimization... */
- ld [%l6 + 36], %l5
- lduh [%l5 + 16], %l5
- srl %l5, 8, %l6
- cmp %l6, 1 /* MEM_MAJOR */
- bne,a write_is_too_hard
- sethi %hi(C_LABEL(quick_sys_write)), %l7
-
- and %l5, 0xff, %l5
- cmp %l5, 3 /* NULL_MINOR */
- bne,a write_is_too_hard
- sethi %hi(C_LABEL(quick_sys_write)), %l7
-
- /* We only optimize for the /dev/null case currently,
- * however to stay POSIX4 compliant we must check the
- * validity of the passed buffer. Blowlaris2.x does not
- * do this and is therefore not POSIX4 compliant!
- * If you are going to optimize for benchmarks, fine,
- * but to break behavior of a system call in the process
- * is complete brain damage...
- */
-
- /* XXX write verify_area thingy for full POSIX conformance! XXX */
-
- mov %i2, %i0
- CC_AND_RETT
-
-write_is_too_hard:
- b syscall_is_too_hard
- or %l7, %lo(C_LABEL(quick_sys_write)), %l7
-
-write_error_return:
- SC_AND_RETT
-#endif
/* XXX sys_nice() XXX */
/* XXX sys_setpriority() XXX */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov