Commit 8603555a authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.40

parent 5e88de04
...@@ -4650,6 +4650,40 @@ CONFIG_ACI_MIXER ...@@ -4650,6 +4650,40 @@ CONFIG_ACI_MIXER
also controls the radio tuner on this card, however this is not also controls the radio tuner on this card, however this is not
yet supported in this software. yet supported in this software.
Gallant's Audio Excel DSP 16 support (SC-6000 and SC-6600)
CONFIG_AEDSP16
Answer Y if you have a Gallant's Audio Excel DSP 16 card. This card
emulate an SBPro or a Microsoft Sound System card.
You must select one of the Sound Blaster or Microsoft Sound System
drivers before select this menu item.
Read the drivers/sound/lowlevel/README.aedsp16 file and the head of
drivers/sound/lowlevel/aedsp16.c to have more informations about
this driver and its configuration.
If you are changing the card configuration, please, undefine all
the old Audio Excel parameters because leaving it defined while
selecting the alternate emulation, may screw up your .config file.
!!!NOTE!!!
The driver supports Audio Excel DSP 16 but not the III version of
this card. Read drivers/sound/lowlevel/Readme.aedsp16 if you want
to know something more on how to use the III version with this sound
driver.
SC-6600 based audio cards (new Audio Excel DSP 16)
CONFIG_SC6600
The SC6600 is the new version of DSP mounted on the Audio Excel DSP 16
cards. Check the FCC ID of your audio card and answer Y if you have an
SC6600 DSP.
Audio Excel DSP 16 (MSS emulation)
CONFIG_AEDSP16_MSS
Answer Y if you want your audio card emulate Microsoft Sound System.
Audio Excel DSP 16 (SBPro emulation)
CONFIG_AEDSP16_SBPRO
Answer Y if you want your audio card emulate Sound Blaster Pro.
Kernel profiling support Kernel profiling support
CONFIG_PROFILE CONFIG_PROFILE
This is for kernel hackers who want to know how much time the kernel This is for kernel hackers who want to know how much time the kernel
......
...@@ -47,7 +47,7 @@ foo \kill}% ...@@ -47,7 +47,7 @@ foo \kill}%
% %
\title{{\bf Linux Allocated Devices}} \title{{\bf Linux Allocated Devices}}
\author{Maintained by H. Peter Anvin $<$hpa@zytor.com$>$} \author{Maintained by H. Peter Anvin $<$hpa@zytor.com$>$}
\date{Last revised: May 1, 1997} \date{Last revised: May 20, 1997}
\maketitle \maketitle
% %
\noindent \noindent
...@@ -212,7 +212,8 @@ reply. ...@@ -212,7 +212,8 @@ reply.
\major{81}{}{char }{Brooktree Bt848 frame grabbers} \major{81}{}{char }{Brooktree Bt848 frame grabbers}
\major{82}{}{char }{WiNRADiO communications receiver card} \major{82}{}{char }{WiNRADiO communications receiver card}
\major{83}{}{char }{Teletext/videotext interfaces} \major{83}{}{char }{Teletext/videotext interfaces}
\major{84}{--119}{}{Unallocated} \major{84}{}{char }{Ikon 1011[57] Versatec Greensheet Interface}
\major{85}{--119}{}{Unallocated}
\major{120}{--127}{}{Local/experimental use} \major{120}{--127}{}{Local/experimental use}
\major{128}{--239}{}{Unallocated} \major{128}{--239}{}{Unallocated}
\major{240}{--254}{}{Local/experimental use} \major{240}{--254}{}{Local/experimental use}
...@@ -492,6 +493,7 @@ physical disks. ...@@ -492,6 +493,7 @@ physical disks.
\minor{6}{/dev/sunmouse}{Sun mouse} \minor{6}{/dev/sunmouse}{Sun mouse}
\minor{7}{/dev/amigamouse1}{Second Amiga mouse} \minor{7}{/dev/amigamouse1}{Second Amiga mouse}
\minor{8}{/dev/smouse}{Simple serial mouse driver} \minor{8}{/dev/smouse}{Simple serial mouse driver}
\minor{9}{/dev/pc110pad}{IBM PC-110 digitizer pad}
\minor{128}{/dev/beep}{Fancy beep device} \minor{128}{/dev/beep}{Fancy beep device}
\minor{129}{/dev/modreq}{Kernel module load request} \minor{129}{/dev/modreq}{Kernel module load request}
\minor{130}{/dev/watchdog}{Watchdog timer port} \minor{130}{/dev/watchdog}{Watchdog timer port}
...@@ -1418,7 +1420,13 @@ Devices for the driver contained in the VideoteXt package. More information ...@@ -1418,7 +1420,13 @@ Devices for the driver contained in the VideoteXt package. More information
on {\url http://home.pages.de/~videotext/\/}. on {\url http://home.pages.de/~videotext/\/}.
\begin{devicelist} \begin{devicelist}
\major{84}{--119}{}{Unallocated} \major{84}{}{char }{Ikon 1011[57] Versatec Greensheet Interface}
\minor{0}{/dev/ihcp0}{First Greensheet port}
\minor{1}{/dev/ihcp1}{Second Greensheet port}
\end{devicelist}
\begin{devicelist}
\major{85}{--119}{}{Unallocated}
\end{devicelist} \end{devicelist}
\begin{devicelist} \begin{devicelist}
......
LINUX ALLOCATED DEVICES LINUX ALLOCATED DEVICES
Maintained by H. Peter Anvin <hpa@zytor.com> Maintained by H. Peter Anvin <hpa@zytor.com>
Last revised: May 1, 1997 Last revised: May 20, 1997
This list is the successor to Rick Miller's Linux Device List, which This list is the successor to Rick Miller's Linux Device List, which
he stopped maintaining when he got busy with other things in 1993. It he stopped maintaining when he got busy with other things in 1993. It
...@@ -273,6 +273,7 @@ reply. ...@@ -273,6 +273,7 @@ reply.
6 = /dev/sunmouse Sun mouse 6 = /dev/sunmouse Sun mouse
7 = /dev/amigamouse1 Second Amiga mouse 7 = /dev/amigamouse1 Second Amiga mouse
8 = /dev/smouse Simple serial mouse driver 8 = /dev/smouse Simple serial mouse driver
9 = /dev/pc110pad IBM PC-110 digitizer pad
128 = /dev/beep Fancy beep device 128 = /dev/beep Fancy beep device
129 = /dev/modreq Kernel module load request 129 = /dev/modreq Kernel module load request
130 = /dev/watchdog Watchdog timer port 130 = /dev/watchdog Watchdog timer port
...@@ -997,7 +998,11 @@ reply. ...@@ -997,7 +998,11 @@ reply.
Devices for the driver contained in the VideoteXt package. Devices for the driver contained in the VideoteXt package.
More information on http://home.pages.de/~videotext/ More information on http://home.pages.de/~videotext/
84-119 UNALLOCATED 84 char Ikon 1011[57] Versatec Greensheet Interface
0 = /dev/ihcp0 First Greensheet port
1 = /dev/ihcp1 Second Greensheet port
85-119 UNALLOCATED
120-127 LOCAL/EXPERIMENTAL USE 120-127 LOCAL/EXPERIMENTAL USE
......
...@@ -234,6 +234,13 @@ M: fritz@wuemaus.franken.de ...@@ -234,6 +234,13 @@ M: fritz@wuemaus.franken.de
L: isdn4linux@hub-wue.franken.de L: isdn4linux@hub-wue.franken.de
S: Maintained S: Maintained
M68K:
P: Jes Sorensen
M: Jes.Sorensen@cern.ch
W: http://www.clark.net/pub/lawrencc/linux/index.html
L: linux-m68k@phil.uni-sb.de
S: Maintained
MODULE SUPPORT [GENERAL], KERNELD MODULE SUPPORT [GENERAL], KERNELD
P: Bjorn Ekwall P: Bjorn Ekwall
M: bj0rn@blox.se M: bj0rn@blox.se
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 39 SUBLEVEL = 40
ARCH := $(shell uname -m | sed s/i.86/i386/) ARCH := $(shell uname -m | sed s/i.86/i386/ | sed s/sun4u/sparc64/)
# #
# For SMP kernels, set this. We don't want to have this in the config file # For SMP kernels, set this. We don't want to have this in the config file
......
...@@ -161,7 +161,7 @@ static unsigned long get_long(struct task_struct * tsk, ...@@ -161,7 +161,7 @@ static unsigned long get_long(struct task_struct * tsk,
repeat: repeat:
pgdir = pgd_offset(vma->vm_mm, addr); pgdir = pgd_offset(vma->vm_mm, addr);
if (pgd_none(*pgdir)) { if (pgd_none(*pgdir)) {
do_no_page(tsk, vma, addr, 0); handle_mm_fault(tsk, vma, addr, 0);
goto repeat; goto repeat;
} }
if (pgd_bad(*pgdir)) { if (pgd_bad(*pgdir)) {
...@@ -171,7 +171,7 @@ static unsigned long get_long(struct task_struct * tsk, ...@@ -171,7 +171,7 @@ static unsigned long get_long(struct task_struct * tsk,
} }
pgmiddle = pmd_offset(pgdir, addr); pgmiddle = pmd_offset(pgdir, addr);
if (pmd_none(*pgmiddle)) { if (pmd_none(*pgmiddle)) {
do_no_page(tsk, vma, addr, 0); handle_mm_fault(tsk, vma, addr, 0);
goto repeat; goto repeat;
} }
if (pmd_bad(*pgmiddle)) { if (pmd_bad(*pgmiddle)) {
...@@ -181,7 +181,7 @@ static unsigned long get_long(struct task_struct * tsk, ...@@ -181,7 +181,7 @@ static unsigned long get_long(struct task_struct * tsk,
} }
pgtable = pte_offset(pgmiddle, addr); pgtable = pte_offset(pgmiddle, addr);
if (!pte_present(*pgtable)) { if (!pte_present(*pgtable)) {
do_no_page(tsk, vma, addr, 0); handle_mm_fault(tsk, vma, addr, 0);
goto repeat; goto repeat;
} }
page = pte_page(*pgtable); page = pte_page(*pgtable);
...@@ -212,7 +212,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, ...@@ -212,7 +212,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma,
repeat: repeat:
pgdir = pgd_offset(vma->vm_mm, addr); pgdir = pgd_offset(vma->vm_mm, addr);
if (!pgd_present(*pgdir)) { if (!pgd_present(*pgdir)) {
do_no_page(tsk, vma, addr, 1); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
if (pgd_bad(*pgdir)) { if (pgd_bad(*pgdir)) {
...@@ -222,7 +222,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, ...@@ -222,7 +222,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma,
} }
pgmiddle = pmd_offset(pgdir, addr); pgmiddle = pmd_offset(pgdir, addr);
if (pmd_none(*pgmiddle)) { if (pmd_none(*pgmiddle)) {
do_no_page(tsk, vma, addr, 1); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
if (pmd_bad(*pgmiddle)) { if (pmd_bad(*pgmiddle)) {
...@@ -232,12 +232,12 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, ...@@ -232,12 +232,12 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma,
} }
pgtable = pte_offset(pgmiddle, addr); pgtable = pte_offset(pgmiddle, addr);
if (!pte_present(*pgtable)) { if (!pte_present(*pgtable)) {
do_no_page(tsk, vma, addr, 1); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
page = pte_page(*pgtable); page = pte_page(*pgtable);
if (!pte_write(*pgtable)) { if (!pte_write(*pgtable)) {
do_wp_page(tsk, vma, addr, 1); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
/* this is a hack for non-kernel-mapped video buffers and similar */ /* this is a hack for non-kernel-mapped video buffers and similar */
......
...@@ -19,6 +19,11 @@ extern void dump_thread(struct pt_regs *, struct user *); ...@@ -19,6 +19,11 @@ extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(elf_fpregset_t *); extern int dump_fpu(elf_fpregset_t *);
extern void __lock_kernel(void); extern void __lock_kernel(void);
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
extern struct drive_info_struct drive_info;
EXPORT_SYMBOL(drive_info);
#endif
/* platform dependent support */ /* platform dependent support */
EXPORT_SYMBOL(EISA_bus); EXPORT_SYMBOL(EISA_bus);
EXPORT_SYMBOL(MCA_bus); EXPORT_SYMBOL(MCA_bus);
......
...@@ -14,6 +14,7 @@ ENTRY(__lock_kernel) ...@@ -14,6 +14,7 @@ ENTRY(__lock_kernel)
lock lock
btsl $0, SYMBOL_NAME(kernel_flag) btsl $0, SYMBOL_NAME(kernel_flag)
jnc 3f jnc 3f
sti
2: 2:
btl %dl, SYMBOL_NAME(smp_invalidate_needed) btl %dl, SYMBOL_NAME(smp_invalidate_needed)
jnc 0f jnc 0f
...@@ -27,6 +28,7 @@ ENTRY(__lock_kernel) ...@@ -27,6 +28,7 @@ ENTRY(__lock_kernel)
0: 0:
btl $0, SYMBOL_NAME(kernel_flag) btl $0, SYMBOL_NAME(kernel_flag)
jc 2b jc 2b
cli
jmp 1b jmp 1b
3: 3:
......
...@@ -26,7 +26,7 @@ endif ...@@ -26,7 +26,7 @@ endif
LINKFLAGS = -T $(TOPDIR)/arch/m68k/vmlinux.lds LINKFLAGS = -T $(TOPDIR)/arch/m68k/vmlinux.lds
CFLAGS := $(CFLAGS) -pipe -fno-strength-reduce CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
ifdef CONFIG_OPTIMIZE_040 ifdef CONFIG_OPTIMIZE_040
CFLAGS := $(CFLAGS) -m68040 CFLAGS := $(CFLAGS) -m68040
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/zorro.h> #include <linux/zorro.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -163,15 +163,19 @@ static int free_vme_vec_bitmap = 0; ...@@ -163,15 +163,19 @@ static int free_vme_vec_bitmap = 0;
#define MFP_MK_BASE "0xfa13" #define MFP_MK_BASE "0xfa13"
/* This must agree with head.S. */ /* This must agree with entry.S. */
#define ORIG_DO "0x20" #define ORIG_DO "0x24"
#define FORMATVEC "0x2E" #define FORMATVEC "0x32"
#define SR "0x28" #define SR "0x2C"
#define SAVE_ALL \ #define SAVE_ALL \
"clrl %%sp@-;" /* stk_adj */ \ "clrl %%sp@-;" /* stk_adj */ \
"pea -1:w;" /* orig d0 = -1 */ \ "pea -1:w;" /* orig d0 = -1 */ \
"movel %%d0,%%sp@-;" /* d0 */ \ "movel %%d0,%%sp@-;" /* d0 */ \
"moveml %%d1-%%d5/%%a0-%%a1,%%sp@-" "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
#define GET_CURRENT(tmp) \
"movel %%sp,"#tmp";" \
"andw #-8192,"#tmp";" \
"movel "#tmp",%%a2"
#define BUILD_SLOW_IRQ(n) \ #define BUILD_SLOW_IRQ(n) \
asmlinkage void IRQ_NAME(n); \ asmlinkage void IRQ_NAME(n); \
...@@ -181,6 +185,7 @@ __asm__ (ALIGN_STR "\n" \ ...@@ -181,6 +185,7 @@ __asm__ (ALIGN_STR "\n" \
SYMBOL_NAME_STR(atari_slow_irq_) #n "_handler:\t" \ SYMBOL_NAME_STR(atari_slow_irq_) #n "_handler:\t" \
" addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n" \ " addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n" \
SAVE_ALL "\n" \ SAVE_ALL "\n" \
GET_CURRENT(%%d0) "\n" \
" andb #~(1<<(" #n "&7))," /* mask this interrupt */ \ " andb #~(1<<(" #n "&7))," /* mask this interrupt */ \
"("MFP_MK_BASE"+(((" #n "&8)^8)>>2)+((" #n "&16)<<3)):w\n" \ "("MFP_MK_BASE"+(((" #n "&8)^8)>>2)+((" #n "&16)<<3)):w\n" \
" bfextu %%sp@("SR"){#5,#3},%%d0\n" /* get old IPL from stack frame */ \ " bfextu %%sp@("SR"){#5,#3},%%d0\n" /* get old IPL from stack frame */ \
...@@ -283,7 +288,8 @@ SYMBOL_NAME_STR(atari_fast_irq_handler) ": ...@@ -283,7 +288,8 @@ SYMBOL_NAME_STR(atari_fast_irq_handler) ":
orw #0x700,%%sr /* disable all interrupts */ orw #0x700,%%sr /* disable all interrupts */
"SYMBOL_NAME_STR(atari_prio_irq_handler) ":\t "SYMBOL_NAME_STR(atari_prio_irq_handler) ":\t
addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n" addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n"
SAVE_ALL " SAVE_ALL "\n"
GET_CURRENT(%%d0) "
/* get vector number from stack frame and convert to source */ /* get vector number from stack frame and convert to source */
bfextu %%sp@(" FORMATVEC "){#4,#10},%%d0 bfextu %%sp@(" FORMATVEC "){#4,#10},%%d0
subw #(0x40-8),%%d0 subw #(0x40-8),%%d0
......
...@@ -51,13 +51,23 @@ ...@@ -51,13 +51,23 @@
.include "fpsp.h" .include "fpsp.h"
LOFF_ORIG_D0 = 0x20 /*
* This has to match entry.S
*/
LOFF_ORIG_D0 = 0x24
#define curptr a2
#define SAVE_ALL \ #define SAVE_ALL \
clrl %sp@-; /* stk_adj */ \ clrl %sp@-; /* stk_adj */ \
movel %d0,%sp@-; /* orig d0 */ \ movel %d0,%sp@-; /* orig d0 */ \
movel %d0,%sp@-; /* d0 */ \ movel %d0,%sp@-; /* d0 */ \
moveml %d1-%d5/%a0-%a1,%sp@- moveml %d1-%d5/%a0-%a1/%curptr,%sp@-;
#define GET_CURRENT(tmp) \
movel %sp,tmp; \
andw &-8192,tmp; \
movel tmp,%curptr;
|xref b1238_fix |xref b1238_fix
...@@ -81,6 +91,7 @@ real_dz: ...@@ -81,6 +91,7 @@ real_dz:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -175,6 +186,7 @@ inex_done: ...@@ -175,6 +186,7 @@ inex_done:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -204,6 +216,7 @@ ovfl_done: ...@@ -204,6 +216,7 @@ ovfl_done:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -233,6 +246,7 @@ unfl_done: ...@@ -233,6 +246,7 @@ unfl_done:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -258,6 +272,7 @@ real_snan: ...@@ -258,6 +272,7 @@ real_snan:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -283,6 +298,7 @@ real_operr: ...@@ -283,6 +298,7 @@ real_operr:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -314,6 +330,7 @@ real_bsun: ...@@ -314,6 +330,7 @@ real_bsun:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -338,6 +355,7 @@ real_fline: ...@@ -338,6 +355,7 @@ real_fline:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -363,6 +381,7 @@ real_unsupp: ...@@ -363,6 +381,7 @@ real_unsupp:
movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -419,6 +438,7 @@ Lmustsched: ...@@ -419,6 +438,7 @@ Lmustsched:
SAVE_ALL SAVE_ALL
moveq #-1,%d0 moveq #-1,%d0
movel %d0,%sp@(LOFF_ORIG_D0) | indicate stack frame not for syscall movel %d0,%sp@(LOFF_ORIG_D0) | indicate stack frame not for syscall
GET_CURRENT(%d0)
bral SYMBOL_NAME(ret_from_exception) | deliver signals, reschedule etc.. bral SYMBOL_NAME(ret_from_exception) | deliver signals, reschedule etc..
...@@ -497,7 +517,7 @@ user_read: ...@@ -497,7 +517,7 @@ user_read:
movel %d0,-(%sp) movel %d0,-(%sp)
movel %a1,-(%sp) movel %a1,-(%sp)
movel %a0,-(%sp) movel %a0,-(%sp)
jsr copyin jsr copyin
addw #12,%sp addw #12,%sp
movel (%sp)+,%d1 movel (%sp)+,%d1
rts rts
......
...@@ -36,13 +36,23 @@ ...@@ -36,13 +36,23 @@
#include <linux/linkage.h> #include <linux/linkage.h>
LOFF_ORIG_D0 = 0x20 /*
* This has to match entry.S
*/
LOFF_ORIG_D0 = 0x24
#define curptr a2
#define SAVE_ALL \ #define SAVE_ALL \
clrl %sp@-; /* stk_adj */ \ clrl %sp@-; /* stk_adj */ \
movel %d0,%sp@-; /* orig d0 */ \ movel %d0,%sp@-; /* orig d0 */ \
movel %d0,%sp@-; /* d0 */ \ movel %d0,%sp@-; /* d0 */ \
moveml %d1-%d5/%a0-%a1,%sp@- moveml %d1-%d5/%a0-%a1/%curptr,%sp@-;
#define GET_CURRENT(tmp) \
movel %sp,tmp; \
andw &-8192,tmp; \
movel tmp,%curptr;
|################################ |################################
| (1) EXAMPLE CALL-OUTS # | (1) EXAMPLE CALL-OUTS #
...@@ -85,6 +95,7 @@ Lmustsched: ...@@ -85,6 +95,7 @@ Lmustsched:
SAVE_ALL SAVE_ALL
moveq #-1,%d0 moveq #-1,%d0
movel %d0,%sp@(LOFF_ORIG_D0) | indicate stack frame not for syscall movel %d0,%sp@(LOFF_ORIG_D0) | indicate stack frame not for syscall
GET_CURRENT(%d0)
bral SYMBOL_NAME(ret_from_exception) | deliver signals, reschedule etc.. bral SYMBOL_NAME(ret_from_exception) | deliver signals, reschedule etc..
| |
......
...@@ -33,12 +33,13 @@ ...@@ -33,12 +33,13 @@
* 10(sp) - d5 * 10(sp) - d5
* 14(sp) - a0 * 14(sp) - a0
* 18(sp) - a1 * 18(sp) - a1
* 1C(sp) - d0 * 1C(sp) - a2
* 20(sp) - orig_d0 * 20(sp) - d0
* 24(sp) - stack adjustment * 24(sp) - orig_d0
* 28(sp) - sr * 28(sp) - stack adjustment
* 2A(sp) - pc * 2C(sp) - sr
* 2E(sp) - format & vector * 2E(sp) - pc
* 32(sp) - format & vector
*/ */
/* /*
...@@ -47,6 +48,11 @@ ...@@ -47,6 +48,11 @@
* number 0 in the 'current_set' list. * number 0 in the 'current_set' list.
*/ */
/*
* 97/05/14 Andreas: Register %a2 is now set to the current task throughout
* the whole kernel.
*/
#include <linux/sys.h> #include <linux/sys.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/linkage.h> #include <linux/linkage.h>
...@@ -57,6 +63,8 @@ ...@@ -57,6 +63,8 @@
.globl SYMBOL_NAME(kgdb_registers) .globl SYMBOL_NAME(kgdb_registers)
#endif #endif
#define curptr a2
LENOSYS = 38 LENOSYS = 38
/* /*
...@@ -80,15 +88,15 @@ LTASK_FLAGS = 20 ...@@ -80,15 +88,15 @@ LTASK_FLAGS = 20
#define MAX_NOINT_IPL 0 #define MAX_NOINT_IPL 0
#endif /* machine compilation types */ #endif /* machine compilation types */
LD0 = 0x1C LD0 = 0x20
LORIG_D0 = 0x20 LORIG_D0 = 0x24
LSR = 0x28 LSR = 0x2C
LFORMATVEC = 0x2E LFORMATVEC = 0x32
/* /*
* This defines the normal kernel pt-regs layout. * This defines the normal kernel pt-regs layout.
* *
* regs are a2-a6 and d6-d7 preserved by C code * regs a3-a6 and d6-d7 are preserved by C code
* the kernel doesn't mess with usp unless it needs to * the kernel doesn't mess with usp unless it needs to
*/ */
#ifndef CONFIG_KGDB #ifndef CONFIG_KGDB
...@@ -96,7 +104,7 @@ LFORMATVEC = 0x2E ...@@ -96,7 +104,7 @@ LFORMATVEC = 0x2E
clrl %sp@-; /* stk_adj */ \ clrl %sp@-; /* stk_adj */ \
movel %d0,%sp@-; /* orig d0 */ \ movel %d0,%sp@-; /* orig d0 */ \
movel %d0,%sp@-; /* d0 */ \ movel %d0,%sp@-; /* d0 */ \
moveml %d1-%d5/%a0-%a1,%sp@- moveml %d1-%d5/%a0-%a1/%curptr,%sp@-;
#else #else
/* Need to save the "missing" registers for kgdb... /* Need to save the "missing" registers for kgdb...
*/ */
...@@ -104,25 +112,30 @@ LFORMATVEC = 0x2E ...@@ -104,25 +112,30 @@ LFORMATVEC = 0x2E
clrl %sp@-; /* stk_adj */ \ clrl %sp@-; /* stk_adj */ \
movel %d0,%sp@-; /* orig d0 */ \ movel %d0,%sp@-; /* orig d0 */ \
movel %d0,%sp@-; /* d0 */ \ movel %d0,%sp@-; /* d0 */ \
moveml %d1-%d5/%a0-%a1,%sp@-; \ moveml %d1-%d5/%a0-%a1/%curptr,%sp@-; \
moveml %d6-%d7,SYMBOL_NAME(kgdb_registers)+GDBOFFA_D6; \ moveml %d6-%d7,SYMBOL_NAME(kgdb_registers)+GDBOFFA_D6; \
moveml %a2-%a6,SYMBOL_NAME(kgdb_registers)+GDBOFFA_A2 moveml %a3-%a6,SYMBOL_NAME(kgdb_registers)+GDBOFFA_A3;
#endif #endif
#define RESTORE_ALL \ #define RESTORE_ALL \
moveml %sp@+,%a0-%a1/%d1-%d5; \ moveml %sp@+,%a0-%a1/%curptr/%d1-%d5; \
movel %sp@+,%d0; \ movel %sp@+,%d0; \
addql #4,%sp; /* orig d0 */ \ addql #4,%sp; /* orig d0 */ \
addl %sp@+,%sp; /* stk adj */ \ addl %sp@+,%sp; /* stk adj */ \
rte rte
#define SWITCH_STACK_SIZE (7*4+4) /* includes return address */ #define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
#define SAVE_SWITCH_STACK \ #define SAVE_SWITCH_STACK \
moveml %a2-%a6/%d6-%d7,%sp@- moveml %a3-%a6/%d6-%d7,%sp@-
#define RESTORE_SWITCH_STACK \ #define RESTORE_SWITCH_STACK \
moveml %sp@+,%a2-%a6/%d6-%d7 moveml %sp@+,%a3-%a6/%d6-%d7
#define GET_CURRENT(tmp) \
movel %sp,tmp; \
andw &-8192,tmp; \
movel tmp,%curptr;
.globl SYMBOL_NAME(system_call), SYMBOL_NAME(buserr), SYMBOL_NAME(trap) .globl SYMBOL_NAME(system_call), SYMBOL_NAME(buserr), SYMBOL_NAME(trap)
.globl SYMBOL_NAME(resume), SYMBOL_NAME(ret_from_exception) .globl SYMBOL_NAME(resume), SYMBOL_NAME(ret_from_exception)
...@@ -139,6 +152,7 @@ ENTRY(buserr) ...@@ -139,6 +152,7 @@ ENTRY(buserr)
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(buserr_c) bsrl SYMBOL_NAME(buserr_c)
addql #4,%sp addql #4,%sp
...@@ -150,6 +164,7 @@ ENTRY(trap) ...@@ -150,6 +164,7 @@ ENTRY(trap)
movel %d0,%sp@(LORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument movel %sp,%sp@- | stack frame pointer argument
bsrl SYMBOL_NAME(trap_c) bsrl SYMBOL_NAME(trap_c)
addql #4,%sp addql #4,%sp
...@@ -190,6 +205,7 @@ ENTRY(system_call) ...@@ -190,6 +205,7 @@ ENTRY(system_call)
SAVE_ALL SAVE_ALL
movel %d0,%d2 movel %d0,%d2
GET_CURRENT(%d0)
| save top of frame | save top of frame
pea %sp@ pea %sp@
jbsr SYMBOL_NAME(set_esp0) jbsr SYMBOL_NAME(set_esp0)
...@@ -197,8 +213,7 @@ ENTRY(system_call) ...@@ -197,8 +213,7 @@ ENTRY(system_call)
cmpl #NR_syscalls,%d2 cmpl #NR_syscalls,%d2
jcc badsys jcc badsys
movel SYMBOL_NAME(current_set),%a0 btst #5,%curptr@(LTASK_FLAGS+3) | PF_TRACESYS
btst #5,%a0@(LTASK_FLAGS+3) | PF_TRACESYS
jne do_trace jne do_trace
jbsr @(SYMBOL_NAME(sys_call_table),%d2:l:4)@(0) jbsr @(SYMBOL_NAME(sys_call_table),%d2:l:4)@(0)
movel %d0,%sp@(LD0) | save the return value movel %d0,%sp@(LD0) | save the return value
...@@ -208,24 +223,23 @@ SYMBOL_NAME_LABEL(ret_from_exception) ...@@ -208,24 +223,23 @@ SYMBOL_NAME_LABEL(ret_from_exception)
bnes 2f | if so, skip resched, signals bnes 2f | if so, skip resched, signals
tstl SYMBOL_NAME(need_resched) tstl SYMBOL_NAME(need_resched)
jne SYMBOL_NAME(reschedule) jne SYMBOL_NAME(reschedule)
movel SYMBOL_NAME(current_set),%a0 cmpl #SYMBOL_NAME(task),%curptr | task[0] cannot have signals
cmpl #SYMBOL_NAME(task),%a0 | task[0] cannot have signals
jeq 2f jeq 2f
bclr #5,%a0@(LTASK_FLAGS+1) | check for delayed trace bclr #5,%curptr@(LTASK_FLAGS+1) | check for delayed trace
jne do_delayed_trace jne do_delayed_trace
5: 5:
tstl %a0@(LTASK_STATE) | state tstl %curptr@(LTASK_STATE) | state
jne SYMBOL_NAME(reschedule) jne SYMBOL_NAME(reschedule)
tstl %a0@(LTASK_COUNTER) | counter tstl %curptr@(LTASK_COUNTER) | counter
jeq SYMBOL_NAME(reschedule) jeq SYMBOL_NAME(reschedule)
movel %a0@(LTASK_BLOCKED),%d0 movel %curptr@(LTASK_BLOCKED),%d0
movel %d0,%d1 | save blocked in d1 for sig handling movel %d0,%d1 | save blocked in d1 for sig handling
notl %d0 notl %d0
btst #4,%a0@(LTASK_FLAGS+3) | PF_PTRACED btst #4,%curptr@(LTASK_FLAGS+3) | PF_PTRACED
jeq 1f jeq 1f
moveq #-1,%d0 | let the debugger see all signals moveq #-1,%d0 | let the debugger see all signals
1: andl %a0@(LTASK_SIGNAL),%d0 1: andl %curptr@(LTASK_SIGNAL),%d0
jne Lsignal_return jne Lsignal_return
2: RESTORE_ALL 2: RESTORE_ALL
...@@ -248,7 +262,6 @@ do_delayed_trace: ...@@ -248,7 +262,6 @@ do_delayed_trace:
jbsr SYMBOL_NAME(send_sig) jbsr SYMBOL_NAME(send_sig)
addql #8,%sp addql #8,%sp
addql #4,%sp addql #4,%sp
movel SYMBOL_NAME(current_set),%a0
jra 5b jra 5b
/* /*
...@@ -260,6 +273,7 @@ SYMBOL_NAME_LABEL(inthandler) ...@@ -260,6 +273,7 @@ SYMBOL_NAME_LABEL(inthandler)
movel %d0,%sp@(LORIG_D0) | a -1 in the ORIG_D0 field movel %d0,%sp@(LORIG_D0) | a -1 in the ORIG_D0 field
| signifies that the stack frame | signifies that the stack frame
| is NOT for syscall | is NOT for syscall
GET_CURRENT(%d0)
addql #1,SYMBOL_NAME(local_irq_count) addql #1,SYMBOL_NAME(local_irq_count)
| put exception # in d0 | put exception # in d0
bfextu %sp@(LFORMATVEC){#4,#10},%d0 bfextu %sp@(LFORMATVEC){#4,#10},%d0
...@@ -270,28 +284,31 @@ SYMBOL_NAME_LABEL(inthandler) ...@@ -270,28 +284,31 @@ SYMBOL_NAME_LABEL(inthandler)
addql #8,%sp | pop parameters off stack addql #8,%sp | pop parameters off stack
SYMBOL_NAME_LABEL(ret_from_interrupt) SYMBOL_NAME_LABEL(ret_from_interrupt)
/* check if we need to do software interrupts */ subql #1,SYMBOL_NAME(local_irq_count)
movel SYMBOL_NAME(local_irq_count),%d1 jeq 1f
subql #1,%d1 2:
jne 4f RESTORE_ALL
#if 0 1:
bfextu %sp@(LSR){#5,#3},%d0 | Check for nested interrupt. #if 1
bfextu %sp@(LSR){#5,#3},%d0 | Check for nested interrupt.
#if MAX_NOINT_IPL > 0 #if MAX_NOINT_IPL > 0
cmpiw #MAX_NOINT_IPL,%d0 cmpiw #MAX_NOINT_IPL,%d0
#endif #endif
jhi 4f jhi 2b
#endif #endif
/* Let the rest run with interrupts allowed. This is safe since
the kernel never uses a non-standard ipl and this is the outer
level interrupt. */
andw #ALLOWINT,%sr
/* check if we need to do software interrupts */
movel SYMBOL_NAME(bh_active),%d0 movel SYMBOL_NAME(bh_active),%d0
andl SYMBOL_NAME(bh_mask),%d0 andl SYMBOL_NAME(bh_mask),%d0
jeq 3f jeq SYMBOL_NAME(ret_from_exception)
jbsr SYMBOL_NAME(do_bottom_half) pea SYMBOL_NAME(ret_from_exception)
3: jra SYMBOL_NAME(do_bottom_half)
clrl SYMBOL_NAME(local_irq_count)
jra SYMBOL_NAME(ret_from_exception)
4:
movel %d1,SYMBOL_NAME(local_irq_count)
RESTORE_ALL
/* Handler for uninitialized and spurious interrupts */ /* Handler for uninitialized and spurious interrupts */
...@@ -398,7 +415,7 @@ SYMBOL_NAME_LABEL(resume) ...@@ -398,7 +415,7 @@ SYMBOL_NAME_LABEL(resume)
3: 3:
/* get pointer to tss struct (a1 contains new task) */ /* get pointer to tss struct (a1 contains new task) */
movel %a1,SYMBOL_NAME(current_set) movel %a1,%curptr
addl %d1,%a1 addl %d1,%a1
/* Skip address space switching if they are the same. */ /* Skip address space switching if they are the same. */
...@@ -419,7 +436,7 @@ SYMBOL_NAME_LABEL(resume) ...@@ -419,7 +436,7 @@ SYMBOL_NAME_LABEL(resume)
movec %cacr,%d0 movec %cacr,%d0
oriw #LFLUSH_I_AND_D,%d0 oriw #LFLUSH_I_AND_D,%d0
movec %d0,%cacr movec %d0,%cacr
/* switch the root pointer */ /* switch the root pointer */
pmove %a1@(LTSS_CRP),%crp pmove %a1@(LTSS_CRP),%crp
#endif #endif
......
...@@ -223,17 +223,9 @@ ENTRY(_start) ...@@ -223,17 +223,9 @@ ENTRY(_start)
movel %d0,%a0@ /* save cache mode for page tables */ movel %d0,%a0@ /* save cache mode for page tables */
/* /*
* raise interrupt level with MASTER bit set, copy isp to msp (if not 68060) * raise interrupt level
*/ */
#ifdef FROM_PL9
movew #0x3700,%sr
is_060(1f)
movec %isp,%d0
movel %d0,%sp
1:
#else
movew #0x2700,%sr movew #0x2700,%sr
#endif
/* /*
If running on an Atari, determine the I/O base of the If running on an Atari, determine the I/O base of the
...@@ -896,8 +888,10 @@ Lcache68060: ...@@ -896,8 +888,10 @@ Lcache68060:
/* /*
* Setup initial stack pointer * Setup initial stack pointer
* We need to get current loaded up with our first task...
*/ */
lea SYMBOL_NAME(init_user_stack)+PAGESIZE,%sp lea SYMBOL_NAME(init_task_union),%a2
lea 8192(%a2),%sp
/* jump to the kernel start */ /* jump to the kernel start */
putr() putr()
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/pgtable.h>
/* /*
* Initial task structure. Make this a per-architecture thing, * Initial task structure. Make this a per-architecture thing,
...@@ -37,15 +38,15 @@ ...@@ -37,15 +38,15 @@
* alignment requirements and potentially different initial * alignment requirements and potentially different initial
* setup. * setup.
*/ */
static unsigned long init_kernel_stack[1024] = { STACK_MAGIC, };
unsigned long init_user_stack[1024] = { STACK_MAGIC, };
static struct vm_area_struct init_mmap = INIT_MMAP; static struct vm_area_struct init_mmap = INIT_MMAP;
static struct fs_struct init_fs = INIT_FS; static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES; static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS; static struct signal_struct init_signals = INIT_SIGNALS;
struct mm_struct init_mm = INIT_MM; struct mm_struct init_mm = INIT_MM;
struct task_struct init_task = INIT_TASK;
union task_union init_task_union
__attribute__((section("init_task"), aligned(2*PAGE_SIZE)))
= { task: INIT_TASK };
asmlinkage void ret_from_exception(void); asmlinkage void ret_from_exception(void);
...@@ -71,6 +72,7 @@ asmlinkage int sys_idle(void) ...@@ -71,6 +72,7 @@ asmlinkage int sys_idle(void)
#else /* portable version */ #else /* portable version */
__asm__("stop #0x2000" : : : "cc"); __asm__("stop #0x2000" : : : "cc");
#endif /* machine compilation types */ #endif /* machine compilation types */
run_task_queue(&tq_scheduler);
schedule(); schedule();
} }
ret = 0; ret = 0;
...@@ -101,8 +103,8 @@ void show_regs(struct pt_regs * regs) ...@@ -101,8 +103,8 @@ void show_regs(struct pt_regs * regs)
printk("\n"); printk("\n");
printk("Format %02x Vector: %04x PC: %08lx Status: %04x\n", printk("Format %02x Vector: %04x PC: %08lx Status: %04x\n",
regs->format, regs->vector, regs->pc, regs->sr); regs->format, regs->vector, regs->pc, regs->sr);
printk("ORIG_D0: %08lx D0: %08lx A1: %08lx\n", printk("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n",
regs->orig_d0, regs->d0, regs->a1); regs->orig_d0, regs->d0, regs->a2, regs->a1);
printk("A0: %08lx D5: %08lx D4: %08lx\n", printk("A0: %08lx D5: %08lx D4: %08lx\n",
regs->a0, regs->d5, regs->d4); regs->a0, regs->d5, regs->d4);
printk("D3: %08lx D2: %08lx D1: %08lx\n", printk("D3: %08lx D2: %08lx D1: %08lx\n",
...@@ -169,8 +171,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, ...@@ -169,8 +171,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
struct switch_stack * childstack, *stack; struct switch_stack * childstack, *stack;
unsigned long stack_offset, *retp; unsigned long stack_offset, *retp;
stack_offset = PAGE_SIZE - sizeof(struct pt_regs); stack_offset = 2*PAGE_SIZE - sizeof(struct pt_regs);
childregs = (struct pt_regs *) (p->kernel_stack_page + stack_offset); childregs = (struct pt_regs *) ((unsigned long) p + stack_offset);
*childregs = *regs; *childregs = *regs;
childregs->d0 = 0; childregs->d0 = 0;
...@@ -256,7 +258,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump) ...@@ -256,7 +258,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
dump->regs.d7 = sw->d7; dump->regs.d7 = sw->d7;
dump->regs.a0 = regs->a0; dump->regs.a0 = regs->a0;
dump->regs.a1 = regs->a1; dump->regs.a1 = regs->a1;
dump->regs.a2 = sw->a2; dump->regs.a2 = regs->a2;
dump->regs.a3 = sw->a3; dump->regs.a3 = sw->a3;
dump->regs.a4 = sw->a4; dump->regs.a4 = sw->a4;
dump->regs.a5 = sw->a5; dump->regs.a5 = sw->a5;
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
static int regoff[] = { static int regoff[] = {
PT_REG(d1), PT_REG(d2), PT_REG(d3), PT_REG(d4), PT_REG(d1), PT_REG(d2), PT_REG(d3), PT_REG(d4),
PT_REG(d5), SW_REG(d6), SW_REG(d7), PT_REG(a0), PT_REG(d5), SW_REG(d6), SW_REG(d7), PT_REG(a0),
PT_REG(a1), SW_REG(a2), SW_REG(a3), SW_REG(a4), PT_REG(a1), PT_REG(a2), SW_REG(a3), SW_REG(a4),
SW_REG(a5), SW_REG(a6), PT_REG(d0), -1, SW_REG(a5), SW_REG(a6), PT_REG(d0), -1,
PT_REG(orig_d0), PT_REG(sr), PT_REG(pc), PT_REG(orig_d0), PT_REG(sr), PT_REG(pc),
}; };
...@@ -104,7 +104,7 @@ static unsigned long get_long(struct task_struct * tsk, ...@@ -104,7 +104,7 @@ static unsigned long get_long(struct task_struct * tsk,
repeat: repeat:
pgdir = pgd_offset(vma->vm_mm, addr); pgdir = pgd_offset(vma->vm_mm, addr);
if (pgd_none(*pgdir)) { if (pgd_none(*pgdir)) {
do_no_page(tsk, vma, addr, 0); handle_mm_fault(tsk, vma, addr, 0);
goto repeat; goto repeat;
} }
if (pgd_bad(*pgdir)) { if (pgd_bad(*pgdir)) {
...@@ -114,7 +114,7 @@ static unsigned long get_long(struct task_struct * tsk, ...@@ -114,7 +114,7 @@ static unsigned long get_long(struct task_struct * tsk,
} }
pgmiddle = pmd_offset(pgdir,addr); pgmiddle = pmd_offset(pgdir,addr);
if (pmd_none(*pgmiddle)) { if (pmd_none(*pgmiddle)) {
do_no_page(tsk, vma, addr, 0); handle_mm_fault(tsk, vma, addr, 0);
goto repeat; goto repeat;
} }
if (pmd_bad(*pgmiddle)) { if (pmd_bad(*pgmiddle)) {
...@@ -125,7 +125,7 @@ static unsigned long get_long(struct task_struct * tsk, ...@@ -125,7 +125,7 @@ static unsigned long get_long(struct task_struct * tsk,
} }
pgtable = pte_offset(pgmiddle, addr); pgtable = pte_offset(pgmiddle, addr);
if (!pte_present(*pgtable)) { if (!pte_present(*pgtable)) {
do_no_page(tsk, vma, addr, 0); handle_mm_fault(tsk, vma, addr, 0);
goto repeat; goto repeat;
} }
page = pte_page(*pgtable); page = pte_page(*pgtable);
...@@ -156,7 +156,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, unsi ...@@ -156,7 +156,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, unsi
repeat: repeat:
pgdir = pgd_offset(vma->vm_mm, addr); pgdir = pgd_offset(vma->vm_mm, addr);
if (!pgd_present(*pgdir)) { if (!pgd_present(*pgdir)) {
do_no_page(tsk, vma, addr, 1); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
if (pgd_bad(*pgdir)) { if (pgd_bad(*pgdir)) {
...@@ -166,7 +166,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, unsi ...@@ -166,7 +166,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, unsi
} }
pgmiddle = pmd_offset(pgdir,addr); pgmiddle = pmd_offset(pgdir,addr);
if (pmd_none(*pgmiddle)) { if (pmd_none(*pgmiddle)) {
do_no_page(tsk, vma, addr, 1); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
if (pmd_bad(*pgmiddle)) { if (pmd_bad(*pgmiddle)) {
...@@ -177,12 +177,12 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, unsi ...@@ -177,12 +177,12 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma, unsi
} }
pgtable = pte_offset(pgmiddle, addr); pgtable = pte_offset(pgmiddle, addr);
if (!pte_present(*pgtable)) { if (!pte_present(*pgtable)) {
do_no_page(tsk, vma, addr, 1); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
page = pte_page(*pgtable); page = pte_page(*pgtable);
if (!pte_write(*pgtable)) { if (!pte_write(*pgtable)) {
do_wp_page(tsk, vma, addr, 2); handle_mm_fault(tsk, vma, addr, 1);
goto repeat; goto repeat;
} }
/* this is a hack for non-kernel-mapped video buffers and similar */ /* this is a hack for non-kernel-mapped video buffers and similar */
......
...@@ -532,12 +532,15 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) ...@@ -532,12 +532,15 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
*/ */
vma = find_vma (current->mm, addr); vma = find_vma (current->mm, addr);
ret = -EINVAL; ret = -EINVAL;
/* Check for overflow. */
if (addr + len < addr)
goto out;
if (vma == NULL || addr < vma->vm_start || addr + len > vma->vm_end) if (vma == NULL || addr < vma->vm_start || addr + len > vma->vm_end)
goto out; goto out;
} }
if (CPU_IS_020_OR_030) { if (CPU_IS_020_OR_030) {
if (scope == FLUSH_SCOPE_LINE) { if (scope == FLUSH_SCOPE_LINE && len < 256) {
unsigned long cacr; unsigned long cacr;
__asm__ ("movec %%cacr, %0" : "=r" (cacr)); __asm__ ("movec %%cacr, %0" : "=r" (cacr));
if (cache & FLUSH_CACHE_INSN) if (cache & FLUSH_CACHE_INSN)
......
...@@ -933,16 +933,15 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr) ...@@ -933,16 +933,15 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr)
#endif #endif
console_verbose(); console_verbose();
printk("%s: %08x\n",str,nr); printk("%s: %08x\n",str,nr);
printk("PC: [<%08lx>]\nSR: %04x SP: %p\n", fp->pc, fp->sr, fp); printk("PC: [<%08lx>]\nSR: %04x SP: %p a2: %08lx\n",
fp->pc, fp->sr, fp, fp->a2);
printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
fp->d0, fp->d1, fp->d2, fp->d3); fp->d0, fp->d1, fp->d2, fp->d3);
printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
fp->d4, fp->d5, fp->a0, fp->a1); fp->d4, fp->d5, fp->a0, fp->a1);
if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
printk("Corrupted stack page\n");
printk("Process %s (pid: %d, stackpage=%08lx)\n", printk("Process %s (pid: %d, stackpage=%08lx)\n",
current->comm, current->pid, current->kernel_stack_page); current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
#ifdef CONFIG_KGDB #ifdef CONFIG_KGDB
} }
#endif #endif
......
...@@ -19,8 +19,7 @@ ENTRY(__down_failed) ...@@ -19,8 +19,7 @@ ENTRY(__down_failed)
movel %a1,-(%sp) movel %a1,-(%sp)
jbsr SYMBOL_NAME(__down) jbsr SYMBOL_NAME(__down)
movel (%sp)+,%a1 movel (%sp)+,%a1
movel (%sp)+,%d0 moveml (%sp)+,%a0/%d0/%d1
movel (%sp)+,%d1
rts rts
ENTRY(__down_failed_interruptible) ENTRY(__down_failed_interruptible)
...@@ -30,6 +29,7 @@ ENTRY(__down_failed_interruptible) ...@@ -30,6 +29,7 @@ ENTRY(__down_failed_interruptible)
jbsr SYMBOL_NAME(__down_interruptible) jbsr SYMBOL_NAME(__down_interruptible)
movel (%sp)+,%a1 movel (%sp)+,%a1
movel (%sp)+,%d1 movel (%sp)+,%d1
movel (%sp)+,%a0
rts rts
ENTRY(__up_wakeup) ENTRY(__up_wakeup)
...@@ -37,6 +37,5 @@ ENTRY(__up_wakeup) ...@@ -37,6 +37,5 @@ ENTRY(__up_wakeup)
movel %a1,-(%sp) movel %a1,-(%sp)
jbsr SYMBOL_NAME(__up) jbsr SYMBOL_NAME(__up)
movel (%sp)+,%a1 movel (%sp)+,%a1
movel (%sp)+,%d0 moveml (%sp)+,%a0/%d0/%d1
movel (%sp)+,%d1
rts rts
...@@ -32,14 +32,10 @@ extern const int frame_extra_sizes[]; /* in m68k/kernel/signal.c */ ...@@ -32,14 +32,10 @@ extern const int frame_extra_sizes[]; /* in m68k/kernel/signal.c */
asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code) unsigned long error_code)
{ {
void (*handler)(struct task_struct *,
struct vm_area_struct *,
unsigned long,
int);
struct task_struct *tsk = current; struct task_struct *tsk = current;
struct mm_struct *mm = tsk->mm; struct mm_struct *mm = tsk->mm;
struct vm_area_struct * vma; struct vm_area_struct * vma;
unsigned long fixup, fault_pc; unsigned long fixup;
int write; int write;
#ifdef DEBUG #ifdef DEBUG
...@@ -73,10 +69,8 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -73,10 +69,8 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
*/ */
good_area: good_area:
write = 0; write = 0;
handler = do_no_page;
switch (error_code & 3) { switch (error_code & 3) {
default: /* 3: write, present */ default: /* 3: write, present */
handler = do_wp_page;
/* fall through */ /* fall through */
case 2: /* write, not present */ case 2: /* write, not present */
if (!(vma->vm_flags & VM_WRITE)) if (!(vma->vm_flags & VM_WRITE))
...@@ -89,7 +83,7 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -89,7 +83,7 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
if (!(vma->vm_flags & (VM_READ | VM_EXEC))) if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
goto bad_area; goto bad_area;
} }
handler(tsk, vma, address, write); handle_mm_fault(current, vma, address, write);
up(&mm->mmap_sem); up(&mm->mmap_sem);
/* There seems to be a missing invalidate somewhere in do_no_page. /* There seems to be a missing invalidate somewhere in do_no_page.
...@@ -108,10 +102,10 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -108,10 +102,10 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
up(&mm->mmap_sem); up(&mm->mmap_sem);
/* Are we prepared to handle this fault? */ /* Are we prepared to handle this fault? */
fault_pc = regs->pc; if ((fixup = search_exception_table(regs->pc)) != 0) {
if ((fixup = search_exception_table(fault_pc)) != 0) {
struct pt_regs *tregs; struct pt_regs *tregs;
printk(KERN_DEBUG "Exception at [<%lx>] (%lx)\n", fault_pc, fixup); printk(KERN_DEBUG "%s: Exception at [<%lx>] (%lx)\n",
current->comm, regs->pc, fixup);
/* Create a new four word stack frame, discarding the old /* Create a new four word stack frame, discarding the old
one. */ one. */
regs->stkadj = frame_extra_sizes[regs->format]; regs->stkadj = frame_extra_sizes[regs->format];
......
...@@ -491,8 +491,6 @@ void free_initmem(void) ...@@ -491,8 +491,6 @@ void free_initmem(void)
atomic_set(&mem_map[MAP_NR(addr)].count, 1); atomic_set(&mem_map[MAP_NR(addr)].count, 1);
free_page(addr); free_page(addr);
} }
printk ("Freeing unused kernel memory: %dk freed\n",
(&__init_end - &__init_begin) >> 10);
} }
void si_meminfo(struct sysinfo *val) void si_meminfo(struct sysinfo *val)
......
...@@ -280,6 +280,8 @@ static unsigned long transp_transl_matches( unsigned long regval, ...@@ -280,6 +280,8 @@ static unsigned long transp_transl_matches( unsigned long regval,
return( (vaddr & mask) == (base & mask) ); return( (vaddr & mask) == (base & mask) );
} }
static unsigned long mm_vtop_fallback (unsigned long);
/* /*
* The following two routines map from a physical address to a kernel * The following two routines map from a physical address to a kernel
* virtual address and vice versa. * virtual address and vice versa.
...@@ -301,7 +303,13 @@ unsigned long mm_vtop (unsigned long vaddr) ...@@ -301,7 +303,13 @@ unsigned long mm_vtop (unsigned long vaddr)
offset += m68k_memory[i].size; offset += m68k_memory[i].size;
i++; i++;
}while (i < m68k_num_memory); }while (i < m68k_num_memory);
return mm_vtop_fallback(vaddr);
}
/* Separate function to make the common case faster (needs to save less
registers) */
static unsigned long mm_vtop_fallback (unsigned long vaddr)
{
/* not in one of the memory chunks; test for applying transparent /* not in one of the memory chunks; test for applying transparent
* translation */ * translation */
......
...@@ -9,6 +9,7 @@ SECTIONS ...@@ -9,6 +9,7 @@ SECTIONS
.text : { .text : {
*(.text) *(.text)
*(.fixup) *(.fixup)
*(.text.lock) /* out-of-line lock text */
*(.gnu.warning) *(.gnu.warning)
} = 0x4e75 } = 0x4e75
.rodata : { *(.rodata) } .rodata : { *(.rodata) }
...@@ -30,6 +31,9 @@ SECTIONS ...@@ -30,6 +31,9 @@ SECTIONS
CONSTRUCTORS CONSTRUCTORS
} }
. = ALIGN(8192);
init_task : { *(init_task) } /* The initial task and kernel stack */
_edata = .; /* End of data section */ _edata = .; /* End of data section */
. = ALIGN(4096); /* Init code and data */ . = ALIGN(4096); /* Init code and data */
......
/* $Id: srmmu.c,v 1.145 1997/05/04 10:02:15 ecd Exp $ /* $Id: srmmu.c,v 1.146 1997/05/18 21:11:09 davem Exp $
* srmmu.c: SRMMU specific routines for memory management. * srmmu.c: SRMMU specific routines for memory management.
* *
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
...@@ -2255,7 +2255,7 @@ static void srmmu_vac_update_mmu_cache(struct vm_area_struct * vma, ...@@ -2255,7 +2255,7 @@ static void srmmu_vac_update_mmu_cache(struct vm_area_struct * vma,
start += PAGE_SIZE; start += PAGE_SIZE;
} }
} }
} while ((vmaring = vmaring->vm_next_share) != inode->i_mmap); } while ((vmaring = vmaring->vm_next_share) != NULL);
if(alias_found && !(pte_val(pte) & _SUN4C_PAGE_NOCACHE)) { if(alias_found && !(pte_val(pte) & _SUN4C_PAGE_NOCACHE)) {
pgdp = srmmu_pgd_offset(vma->vm_mm, address); pgdp = srmmu_pgd_offset(vma->vm_mm, address);
......
/* $Id: sun4c.c,v 1.147 1997/05/01 08:53:42 davem Exp $ /* $Id: sun4c.c,v 1.148 1997/05/18 21:11:19 davem Exp $
* sun4c.c: Doing in software what should be done in hardware. * sun4c.c: Doing in software what should be done in hardware.
* *
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
...@@ -2467,7 +2467,7 @@ static void sun4c_vac_alias_fixup(struct vm_area_struct *vma, unsigned long addr ...@@ -2467,7 +2467,7 @@ static void sun4c_vac_alias_fixup(struct vm_area_struct *vma, unsigned long addr
start += PAGE_SIZE; start += PAGE_SIZE;
} }
} }
} while ((vmaring = vmaring->vm_next_share) != inode->i_mmap); } while ((vmaring = vmaring->vm_next_share) != NULL);
if(alias_found && !(pte_val(pte) & _SUN4C_PAGE_NOCACHE)) { if(alias_found && !(pte_val(pte) & _SUN4C_PAGE_NOCACHE)) {
pgdp = sun4c_pgd_offset(vma->vm_mm, address); pgdp = sun4c_pgd_offset(vma->vm_mm, address);
......
# $Id: Makefile,v 1.17 1997/05/04 07:20:58 davem Exp $ # $Id: Makefile,v 1.20 1997/05/18 08:42:11 davem Exp $
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
# Note! Dependencies are done automagically by 'make dep', which also # Note! Dependencies are done automagically by 'make dep', which also
...@@ -18,7 +18,7 @@ all: kernel.o head.o init_task.o ...@@ -18,7 +18,7 @@ all: kernel.o head.o init_task.o
O_TARGET := kernel.o O_TARGET := kernel.o
O_OBJS := etrap.o rtrap.o hack.o process.o setup.o cpu.o idprom.o \ O_OBJS := etrap.o rtrap.o hack.o process.o setup.o cpu.o idprom.o \
systbls.o traps.o entry.o devices.o auxio.o ioport.o \ systbls.o traps.o entry.o devices.o auxio.o ioport.o \
irq.o time.o sys_sparc.o irq.o time.o sys_sparc.o signal.o winfixup.o
OX_OBJS := sparc64_ksyms.o OX_OBJS := sparc64_ksyms.o
ifdef CONFIG_SPARC32_COMPAT ifdef CONFIG_SPARC32_COMPAT
...@@ -26,12 +26,17 @@ ifdef CONFIG_SPARC32_COMPAT ...@@ -26,12 +26,17 @@ ifdef CONFIG_SPARC32_COMPAT
endif endif
ifdef CONFIG_BINFMT_ELF32 ifdef CONFIG_BINFMT_ELF32
O_OBJS += sparcelf32.o O_OBJS += binfmt_elf32.o
endif endif
head.o: head.S ttable.S itlb_miss.S dtlb_miss.S dtlb_prot.S head.o: head.S ttable.S itlb_miss.S dtlb_miss.S dtlb_prot.S
$(CC) -D__ASSEMBLY__ -ansi -c $*.S -o $*.o $(CC) -D__ASSEMBLY__ -ansi -c $*.S -o $*.o
#
# This is just to get the dependencies...
#
binfmt_elf32.o: $(TOPDIR)/fs/binfmt_elf.c
check_asm: dummy check_asm: dummy
@echo "#include <linux/sched.h>" > tmp.c @echo "#include <linux/sched.h>" > tmp.c
$(CC) -E tmp.c -o tmp.i $(CC) -E tmp.c -o tmp.i
......
/* binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra.
*
*/
#define ELF_ARCH EM_SPARC
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB;
#include <asm/processor.h>
#include <linux/module.h>
#include <linux/config.h>
#define elf_addr_t u32
#define elf_caddr_t u32
#undef start_thread
#define start_thread start_thread32
#define init_elf_binfmt init_elf32_binfmt
#undef CONFIG_BINFMT_ELF
#ifdef CONFIG_BINFMT_ELF32
#define CONFIG_BINFMT_ELF CONFIG_BINFMT_ELF32
#endif
#undef CONFIG_BINFMT_ELF_MODULE
#ifdef CONFIG_BINFMT_ELF32_MODULE
#define CONFIG_BINFMT_ELF_MODULE CONFIG_BINFMT_ELF32_MODULE
#endif
#define ELF_FLAGS_INIT current->tss.flags |= SPARC_FLAG_32BIT
MODULE_DESCRIPTION("Binary format loader for compatibility with 32bit SparcLinux binaries on the Ultra");
MODULE_AUTHOR("Eric Youngdale, David S. Miller, Jakub Jelinek");
#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR
#include "../../../fs/binfmt_elf.c"
/* $Id: dtlb_prot.S,v 1.10 1997/03/25 09:47:13 davem Exp $ /* $Id: dtlb_prot.S,v 1.12 1997/05/18 10:04:43 davem Exp $
* dtlb_prot.S: Data TLB protection code, this is included directly * dtlb_prot.S: Data TLB protection code, this is included directly
* into the trap table. * into the trap table.
* *
...@@ -18,30 +18,30 @@ ...@@ -18,30 +18,30 @@
/*0x04*/ srlx %g1, 8, %g3 ! Position PGD offset /*0x04*/ srlx %g1, 8, %g3 ! Position PGD offset
/*0x08*/ sllx %g1, 2, %g4 ! Position PMD offset /*0x08*/ sllx %g1, 2, %g4 ! Position PMD offset
/*0x0c*/ and %g3, %g2, %g3 ! Mask PGD offset /*0x0c*/ and %g3, %g2, %g3 ! Mask PGD offset
/*0x10*/ and %g4, %g2, %g3 ! Mask PMD offset /*0x10*/ and %g4, %g2, %g4 ! Mask PMD offset
/*0x14*/ ldxa [%g7 + %g3] ASI_PHYS_USE_EC, %g5 ! Load PGD /*0x14*/ ldxa [%g7 + %g3] ASI_PHYS_USE_EC, %g5 ! Load PGD
/*0x18*/ ldxa [%g5 + %g3] ASI_PHYS_USE_EC, %g4 ! Load PMD /*0x18*/ ldxa [%g5 + %g4] ASI_PHYS_USE_EC, %g4 ! Load PMD
/*0x1c*/ ldxa [%g0] ASI_DMMU_TSB_8KB_PTR, %g1 ! For PTE offset /*0x1c*/ ldxa [%g0] ASI_DMMU_TSB_8KB_PTR, %g1 ! For PTE offset
/* ICACHE line 2 */ /* ICACHE line 2 */
/*0x20*/ srlx %g1, 1, %g1 ! PTE offset /*0x20*/ srlx %g1, 1, %g1 ! PTE offset
/*0x24*/ ldxa [%g4 + %g1] ASI_PHYS_USE_EC, %g3 ! Load PTE /*0x24*/ ldxa [%g4 + %g1] ASI_PHYS_USE_EC, %g3 ! Load PTE
/*0x28*/ andcc %g3, _PAGE_WRITE, %g0 ! Writable? /*0x28*/ andcc %g3, _PAGE_WRITE, %g0 ! Writable?
/*0x2c*/ be,pt %xcc, sparc64_dtlb_fault ! Nope... /*0x2c*/ be,pt %xcc, sparc64_dtlb_prot_catch ! Nope...
/*0x30*/ or %g3, (MODIFIED_BITS), %g3 ! Yes it is /*0x30*/ or %g3, (MODIFIED_BITS), %g3 ! Yes it is
/*0x34*/ mov TLB_TAG_ACCESS, %g5 ! Get the page /*0x34*/ mov TLB_TAG_ACCESS, %g5 ! Get the page
/*0x38*/ ldxa [%g5] ASI_DMMU, %g1 ! From MMU /*0x38*/ add %g1, %g4, %g1 ! to get a tmpreg
/*0x3c*/ add %g2, 7, %g5 ! Compute mask /*0x3c*/ ldxa [%g5] ASI_DMMU, %g4 ! From MMU
/* ICACHE line 3 */ /* ICACHE line 3 */
/*0x40*/ andn %g1, %g5, %g1 ! Mask page /*0x40*/ add %g2, 7, %g5 ! Compute mask
/*0x44*/ or %g1, 0x10, %g1 ! 2ndary Context /*0x44*/ andn %g4, %g5, %g4 ! Mask page
/*0x48*/ stxa %g0, [%g1] ASI_DMMU_DEMAP ! TLB flush page /*0x48*/ or %g4, 0x10, %g4 ! 2ndary Context
/*0x4c*/ membar #Sync ! Synchronize /*0x4c*/ stxa %g0, [%g4] ASI_DMMU_DEMAP ! TLB flush page
/*0x50*/ stxa %g3, [%g4 + %g1] ASI_PHYS_USE_EC ! Update sw PTE /*0x50*/ membar #Sync ! Synchronize
/*0x54*/ stxa %g3, [%g0] ASI_DTLB_DATA_IN ! TLB load /*0x54*/ stxa %g3, [%g1] ASI_PHYS_USE_EC ! Update sw PTE
/*0x58*/ retry ! Trap return /*0x58*/ stxa %g3, [%g0] ASI_DTLB_DATA_IN ! TLB load
/*0x5c*/ nop /*0x5c*/ retry ! Trap return
/* ICACHE line 4 */ /* ICACHE line 4 */
/*0x60*/ nop /*0x60*/ nop
......
/* $Id: entry.S,v 1.15 1997/04/28 14:57:08 davem Exp $ /* $Id: entry.S,v 1.21 1997/05/18 10:04:44 davem Exp $
* arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points. * arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points.
* *
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
...@@ -24,35 +24,55 @@ ...@@ -24,35 +24,55 @@
.text .text
.align 4 .align 4
/* FIXME: This is still debugging hack */ .globl sparc64_dtlb_prot_catch, sparc64_dtlb_refbit_catch
.globl sparc64_dtlb_fault, sparc64_dtlb_refbit_catch, sparc64_itlb_refbit_catch .globl sparc64_itlb_refbit_catch
sparc64_dtlb_fault:
rdpr %pstate, %g1
wrpr %g1, PSTATE_AG|PSTATE_MG, %pstate
ba,pt %xcc, etrap
rd %pc, %g7
call sparc64_dtlb_fault_handler
nop
/* Note, DMMU SFAR not updated for fast tlb data access miss /* Note, DMMU SFAR not updated for fast tlb data access miss
* traps, so we must use tag access to find the right page. * traps, so we must use tag access to find the right page.
* However for DMMU fast protection traps it is updated so
* we use, but we must also clear it _before_ we enable interrupts
* and save state because there is a race where we can push a user
* window right now in etrap, a protection fault happens (for example
* to update the dirty bit) and since we left crap in the sfsr
* it will not get updated properly.
*/ */
sparc64_dtlb_refbit_catch: sparc64_dtlb_prot_catch:
wr %g0, ASI_DMMU, %asi wr %g0, ASI_DMMU, %asi
rdpr %pstate, %g1 rdpr %pstate, %g1
wrpr %g1, PSTATE_AG|PSTATE_MG, %pstate wrpr %g1, PSTATE_AG|PSTATE_MG, %pstate
rdpr %tl, %g2
ldxa [%g0 + TLB_TAG_ACCESS] %asi, %g5 ldxa [%g0 + TLB_TAG_ACCESS] %asi, %g5
srlx %g5, PAGE_SHIFT, %g5
ldxa [%g0 + TLB_SFSR] %asi, %g4 ldxa [%g0 + TLB_SFSR] %asi, %g4
sllx %g5, PAGE_SHIFT, %g5 cmp %g2, 1
stxa %g0, [%g0 + TLB_SFSR] %asi
bgu,a %icc, winfix_trampoline
rdpr %tpc, %g5
ba,pt %xcc, etrap ba,pt %xcc, etrap
rd %pc, %g7 rd %pc, %g7
b,a,pt %xcc, 1f
sparc64_dtlb_refbit_catch:
wr %g0, ASI_DMMU, %asi
rdpr %pstate, %g1
wrpr %g1, PSTATE_AG|PSTATE_MG, %pstate
rdpr %tl, %g2
ldxa [%g0 + TLB_TAG_ACCESS] %asi, %g5
cmp %g2, 1
clr %g4 ! sfsr not updated for tlb misses
bgu,a %icc, winfix_trampoline
rdpr %tpc, %g5
ba,pt %xcc, etrap
rd %pc, %g7
1:
mov %l5, %o4 ! raw tag access
mov %l4, %o5 ! raw sfsr
srlx %l5, PAGE_SHIFT, %o3
clr %o1 ! text_fault == 0 clr %o1 ! text_fault == 0
mov %l5, %o3 ! address == sfar sllx %o3, PAGE_SHIFT, %o3 ! address
and %l4, 0x4, %o2 ! write == sfsr.W and %l4, 0x4, %o2 ! write == sfsr.W
call do_sparc64_fault call do_sparc64_fault
add %sp, STACK_BIAS + REGWIN_SZ, %o0 ! pt_regs ptr add %sp, STACK_BIAS + REGWIN_SZ, %o0 ! pt_regs ptr
ba,a,pt %xcc, rtrap
sparc64_itlb_refbit_catch: sparc64_itlb_refbit_catch:
rdpr %pstate, %g1 rdpr %pstate, %g1
...@@ -63,8 +83,11 @@ sparc64_itlb_refbit_catch: ...@@ -63,8 +83,11 @@ sparc64_itlb_refbit_catch:
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC], %o3 ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC], %o3
mov 1, %o1 ! text_fault == 1 mov 1, %o1 ! text_fault == 1
clr %o2 ! write == 0 clr %o2 ! write == 0
clr %o4 ! tag access (N/A)
clr %o5 ! raw sfsr (N/A)
call do_sparc64_fault call do_sparc64_fault
add %sp, STACK_BIAS + REGWIN_SZ, %o0 ! pt_regs ptr add %sp, STACK_BIAS + REGWIN_SZ, %o0 ! pt_regs ptr
ba,a,pt %xcc, rtrap
/* Note check out head.h, this code isn't even used for UP, /* Note check out head.h, this code isn't even used for UP,
* for SMP things will be different. In particular the data * for SMP things will be different. In particular the data
...@@ -137,6 +160,7 @@ breakpoint_trap: ...@@ -137,6 +160,7 @@ breakpoint_trap:
ba,a,pt %xcc, rtrap ba,a,pt %xcc, rtrap
.globl sys_pipe, sys_execve, sys_sigpause, sys_nis_syscall .globl sys_pipe, sys_execve, sys_sigpause, sys_nis_syscall
.globl sys_sigsuspend, sys_sigreturn
sys_pipe: sys_pipe:
sethi %hi(sparc_pipe), %g1 sethi %hi(sparc_pipe), %g1
...@@ -161,14 +185,37 @@ sys_sigpause: ...@@ -161,14 +185,37 @@ sys_sigpause:
call do_sigpause call do_sigpause
add %sp, STACK_BIAS + REGWIN_SZ, %o1 add %sp, STACK_BIAS + REGWIN_SZ, %o1
ld [%curptr + AOFF_task_flags], %l5
andcc %l5, 0x20, %g0
be,pt %icc, rtrap
nop
call syscall_trace
nop
ba,a,pt %xcc, rtrap
sys_sigsuspend:
call do_sigsuspend
add %sp, STACK_BIAS + REGWIN_SZ, %o0
ld [%curptr + AOFF_task_flags], %l5 ld [%curptr + AOFF_task_flags], %l5
andcc %l5, 0x20, %g0 andcc %l5, 0x20, %g0
be,pt %icc, ret_sys_call be,pt %icc, ret_sys_call
clr %o0 nop
call syscall_trace call syscall_trace
nop nop
ba,pt %xcc, ret_sys_call ba,a,pt %xcc, rtrap
clr %o0
sys_sigreturn:
call do_sigreturn
add %sp, STACK_BIAS + REGWIN_SZ, %o0
ld [%curptr + AOFF_task_flags], %l5
andcc %l5, 0x20, %g0
be,pt %icc, ret_sys_call
nop
call syscall_trace
nop
ba,a,pt %xcc, rtrap
/* This is how fork() was meant to be done, 11 instruction entry. -DaveM */ /* This is how fork() was meant to be done, 11 instruction entry. -DaveM */
.globl sys_fork, sys_vfork, sys_clone .globl sys_fork, sys_vfork, sys_clone
...@@ -216,7 +263,7 @@ linux_syscall_trace: ...@@ -216,7 +263,7 @@ linux_syscall_trace:
.globl ret_from_syscall .globl ret_from_syscall
ret_from_syscall: ret_from_syscall:
ba,pt %xcc, ret_sys_call ba,pt %xcc, ret_sys_call
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_I0], %o0 ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0], %o0
/* Linux native and SunOS system calls enter here... */ /* Linux native and SunOS system calls enter here... */
.align 4 .align 4
...@@ -248,13 +295,18 @@ syscall_is_too_hard: ...@@ -248,13 +295,18 @@ syscall_is_too_hard:
call %l7 call %l7
mov %i5, %o5 mov %i5, %o5
stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_I0] stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0]
#if 0
/* Debugging... */
call syscall_trace_exit
add %sp, STACK_BIAS + REGWIN_SZ, %o0
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0], %o0
#endif
.globl ret_sys_call .globl ret_sys_call
ret_sys_call: ret_sys_call:
ldx [%curptr + AOFF_task_flags], %l6 ldx [%curptr + AOFF_task_flags], %l6
mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_TSTATE], %g3 ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3
cmp %o0, -ENOIOCTLCMD cmp %o0, -ENOIOCTLCMD
sllx %g2, 32, %g2 sllx %g2, 32, %g2
bgeu,pn %xcc, 1f bgeu,pn %xcc, 1f
...@@ -263,34 +315,34 @@ ret_sys_call: ...@@ -263,34 +315,34 @@ ret_sys_call:
/* System call success, clear Carry condition code. */ /* System call success, clear Carry condition code. */
andn %g3, %g2, %g3 andn %g3, %g2, %g3
clr %l6 clr %l6
stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_TSTATE] stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE]
bne,pn %icc, linux_syscall_trace2 bne,pn %icc, linux_syscall_trace2
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_TNPC], %l1 /* pc = npc */ ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC], %l1 /* pc = npc */
add %l1, 0x4, %l2 /* npc = npc+4 */ add %l1, 0x4, %l2 /* npc = npc+4 */
stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_TPC] stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC]
ba,pt %xcc, rtrap ba,pt %xcc, rtrap
stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_TNPC] stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC]
1: 1:
/* System call failure, set Carry condition code. /* System call failure, set Carry condition code.
* Also, get abs(errno) to return to the process. * Also, get abs(errno) to return to the process.
*/ */
sub %g0, %o0, %o0 sub %g0, %o0, %o0
or %g3, %g2, %g3 or %g3, %g2, %g3
stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_I0] stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0]
mov 1, %l6 mov 1, %l6
stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_TSTATE] stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE]
bne,pn %icc, linux_syscall_trace2 bne,pn %icc, linux_syscall_trace2
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_TNPC], %l1 /* pc = npc */ ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC], %l1 /* pc = npc */
add %l1, 0x4, %l2 /* npc = npc+4 */ add %l1, 0x4, %l2 /* npc = npc+4 */
stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_TPC] stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC]
ba,pt %xcc, rtrap ba,pt %xcc, rtrap
stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_TNPC] stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC]
linux_syscall_trace2: linux_syscall_trace2:
call syscall_trace call syscall_trace
add %l1, 0x4, %l2 /* npc = npc+4 */ add %l1, 0x4, %l2 /* npc = npc+4 */
stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_TPC] stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC]
ba,pt %xcc, rtrap ba,pt %xcc, rtrap
stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_TNPC] stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC]
/* End of entry.S */ /* End of entry.S */
/* $Id: etrap.S,v 1.13 1997/05/04 07:21:00 davem Exp $ /* $Id: etrap.S,v 1.17 1997/05/18 22:52:09 davem Exp $
* etrap.S: Preparing for entry into the kernel on Sparc V9. * etrap.S: Preparing for entry into the kernel on Sparc V9.
* *
* Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
...@@ -50,27 +50,11 @@ etrap_irq: ...@@ -50,27 +50,11 @@ etrap_irq:
mov SECONDARY_CONTEXT, %g1 mov SECONDARY_CONTEXT, %g1
stxa %g2, [%g1] ASI_DMMU stxa %g2, [%g1] ASI_DMMU
rdpr %wstate, %g1 rd %pic, %g1
sll %g1, 3, %g1 sethi %hi((PAGE_SIZE<<1)-TRACEREG_SZ-REGWIN_SZ), %g2
wrpr %g1, %wstate or %g2, %lo((PAGE_SIZE<<1)-TRACEREG_SZ-REGWIN_SZ), %g2
sethi %uhi(KERNBASE), %g2
or %g2, %ulo(KERNBASE), %g2
sethi %hi(current_set), %g1
or %g1, %lo(current_set), %g1
sllx %g2, 32, %g2
ldx [%g1 + %g2], %g1
#ifdef __SMP__
/* FIXME: Fix the above insn for SMP */
#endif
rdpr %canrestore, %g2
wrpr %g0, 0, %canrestore
wrpr %g2, 0, %otherwin
mov 1, %g2
sllx %g2, (PAGE_SHIFT + 1), %g2
sub %g2, (TRACEREG_SZ + REGWIN_SZ), %g2
add %g1, %g2, %g2 add %g1, %g2, %g2
rdpr %tstate, %g1
1: 1:
stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE] stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE]
rdpr %tpc, %g1 rdpr %tpc, %g1
...@@ -81,9 +65,23 @@ etrap_irq: ...@@ -81,9 +65,23 @@ etrap_irq:
stx %g1, [%g2 + REGWIN_SZ + PT_V9_Y] stx %g1, [%g2 + REGWIN_SZ + PT_V9_Y]
wrpr %g0, 0x0, %tl wrpr %g0, 0x0, %tl
rdpr %pstate, %g1 rdpr %pstate, %g1
save %g2, -STACK_BIAS, %sp save %g2, -STACK_BIAS, %sp
/* Must guarentee that here andcc of TSTATE_PRIV at the top is
* still valid in %ccr register. Don't show this trick to your
* mom. -DaveM
*/
bne,pn %xcc, 1f
rdpr %canrestore, %g3
wrpr %g0, 0, %canrestore
wrpr %g3, 0, %otherwin
rdpr %wstate, %g6
sll %g6, 3, %g6
wrpr %g6, %wstate
1:
mov %g1, %l1 mov %g1, %l1
mov %g4, %l4 mov %g4, %l4
mov %g5, %l5 mov %g5, %l5
...@@ -105,15 +103,10 @@ etrap_irq: ...@@ -105,15 +103,10 @@ etrap_irq:
stx %i6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I6] stx %i6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I6]
stx %i7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I7] stx %i7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I7]
wrpr %l1, (PSTATE_IE | PSTATE_AG), %pstate wrpr %l1, (PSTATE_IE | PSTATE_AG), %pstate
sethi %uhi(KERNBASE), %g4 srlx %sp, 43, %g4
or %g4, %ulo(KERNBASE), %g4 rd %pic, %g6
srlx %sp, (PAGE_SHIFT + 1), %g6
sllx %g4, 32, %g4
jmpl %l2 + 0x4, %g0 jmpl %l2 + 0x4, %g0
sllx %g6, (PAGE_SHIFT + 1), %g6 sllx %g4, 43, %g4
#ifdef __SMP__
/* FIXME: Fix the above insn for SMP */
#endif
.globl etraptl1 .globl etraptl1
etraptl1: etraptl1:
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
to compile... */ to compile... */
.text .text
.align 8 .align 8
.globl _sigpause_common
_sigpause_common: retl;nop
.globl breakpoint .globl breakpoint
breakpoint: retl;nop breakpoint: retl;nop
.globl do_cee .globl do_cee
...@@ -36,8 +34,6 @@ do_fpother_tl1: retl;nop ...@@ -36,8 +34,6 @@ do_fpother_tl1: retl;nop
do_iae: retl;nop do_iae: retl;nop
.globl do_iae_tl1 .globl do_iae_tl1
do_iae_tl1: retl;nop do_iae_tl1: retl;nop
.globl do_ill
do_ill: retl;nop
.globl do_ill_tl1 .globl do_ill_tl1
do_ill_tl1: retl;nop do_ill_tl1: retl;nop
.globl do_irq .globl do_irq
...@@ -48,8 +44,6 @@ do_irq_tl1: retl;nop ...@@ -48,8 +44,6 @@ do_irq_tl1: retl;nop
do_lddfmna: retl;nop do_lddfmna: retl;nop
.globl do_lddfmna_tl1 .globl do_lddfmna_tl1
do_lddfmna_tl1: retl;nop do_lddfmna_tl1: retl;nop
.globl do_mna
do_mna: retl;nop
.globl do_mna_tl1 .globl do_mna_tl1
do_mna_tl1: retl;nop do_mna_tl1: retl;nop
.globl do_paw .globl do_paw
...@@ -60,8 +54,6 @@ do_paw_tl1: retl;nop ...@@ -60,8 +54,6 @@ do_paw_tl1: retl;nop
do_privact: retl;nop do_privact: retl;nop
.globl do_privop .globl do_privop
do_privop: retl;nop do_privop: retl;nop
.globl do_signal
do_signal: retl;nop
.globl do_stdfmna .globl do_stdfmna
do_stdfmna: retl;nop do_stdfmna: retl;nop
.globl do_stdfmna_tl1 .globl do_stdfmna_tl1
...@@ -200,15 +192,7 @@ sunos_write: retl;nop ...@@ -200,15 +192,7 @@ sunos_write: retl;nop
sunos_writev: retl;nop sunos_writev: retl;nop
.globl sys_ptrace .globl sys_ptrace
sys_ptrace: retl;nop sys_ptrace: retl;nop
.globl sys_sigreturn
sys_sigreturn: retl;nop
.globl sys_sigstack
sys_sigstack: retl;nop
.globl sys_sigsuspend
sys_sigsuspend: retl;nop
.globl syscall_trace .globl syscall_trace
syscall_trace: retl;nop syscall_trace: retl;nop
.globl sys32_ptrace .globl sys32_ptrace
sys32_ptrace: retl;nop sys32_ptrace: retl;nop
.globl do_sigpause
do_sigpause: retl;nop
/* $Id: head.S,v 1.28 1997/05/04 07:21:02 davem Exp $ /* $Id: head.S,v 1.30 1997/05/18 22:52:12 davem Exp $
* head.S: Initial boot code for the Sparc64 port of Linux. * head.S: Initial boot code for the Sparc64 port of Linux.
* *
* Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu)
...@@ -268,6 +268,10 @@ sun4u_init: ...@@ -268,6 +268,10 @@ sun4u_init:
mov %sp, %l6 mov %sp, %l6
mov %o4, %l7 mov %o4, %l7
/* Setup "Linux Current Register", thanks Sun 8-) */
wr %g0, 0x1, %pcr
wr %g6, 0x0, %pic
mov 1, %g5 mov 1, %g5
sllx %g5, (PAGE_SHIFT + 1), %g5 sllx %g5, (PAGE_SHIFT + 1), %g5
sub %g5, (REGWIN_SZ + STACK_BIAS), %g5 sub %g5, (REGWIN_SZ + STACK_BIAS), %g5
...@@ -289,14 +293,20 @@ sun4u_init: ...@@ -289,14 +293,20 @@ sun4u_init:
add %l2, 1, %l2 add %l2, 1, %l2
add %l0, %g4, %o0 add %l0, %g4, %o0
1: 1:
call bzero_1page clr %o1
sethi %hi(PAGE_SIZE), %o2
or %o2, %lo(PAGE_SIZE), %o2
call __memset
add %l0, %l2, %l0 add %l0, %l2, %l0
cmp %l0, %l1 cmp %l0, %l1
blu,pt %xcc, 1b blu,pt %xcc, 1b
add %l0, %g4, %o0 add %l0, %g4, %o0
/* Now clear empty_zero_page */ /* Now clear empty_zero_page */
call bzero_1page clr %o1
sethi %hi(PAGE_SIZE), %o2
or %o2, %lo(PAGE_SIZE), %o2
call __memset
mov %g4, %o0 mov %g4, %o0
mov %l6, %o1 ! OpenPROM stack mov %l6, %o1 ! OpenPROM stack
......
/* $Id: process.c,v 1.8 1997/05/14 20:45:06 davem Exp $ /* $Id: process.c,v 1.11 1997/05/18 22:52:19 davem Exp $
* arch/sparc64/kernel/process.c * arch/sparc64/kernel/process.c
* *
* Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include <asm/elf.h> #include <asm/elf.h>
#include <asm/fpumacro.h> #include <asm/fpumacro.h>
struct task_struct *current_set[NR_CPUS] = {&init_task, };
#ifndef __SMP__ #ifndef __SMP__
/* /*
...@@ -348,7 +346,14 @@ void flush_thread(void) ...@@ -348,7 +346,14 @@ void flush_thread(void)
} }
/* Now, this task is no longer a kernel thread. */ /* Now, this task is no longer a kernel thread. */
current->tss.flags &= ~SPARC_FLAG_KTHREAD; if(current->tss.flags & SPARC_FLAG_KTHREAD) {
current->tss.flags &= ~SPARC_FLAG_KTHREAD;
/* exec_mmap() set context to NO_CONTEXT, here is
* where we grab a new one.
*/
get_mmu_context(current);
}
current->tss.current_ds = USER_DS; current->tss.current_ds = USER_DS;
} }
...@@ -418,6 +423,64 @@ clone_stackframe(struct sparc_stackf *dst, struct sparc_stackf *src) ...@@ -418,6 +423,64 @@ clone_stackframe(struct sparc_stackf *dst, struct sparc_stackf *src)
return sp; return sp;
} }
/* Standard stuff. */
static inline void shift_window_buffer(int first_win, int last_win,
struct thread_struct *tp)
{
int i;
for(i = first_win; i < last_win; i++) {
tp->rwbuf_stkptrs[i] = tp->rwbuf_stkptrs[i+1];
memcpy(&tp->reg_window[i], &tp->reg_window[i+1],
sizeof(struct reg_window));
}
}
void synchronize_user_stack(void)
{
struct thread_struct *tp = &current->tss;
unsigned long window = tp->w_saved;
flush_user_windows();
if(window) {
int winsize = REGWIN_SZ;
if(tp->flags & SPARC_FLAG_32BIT)
winsize = REGWIN32_SZ;
window -= 1;
do {
unsigned long sp = tp->rwbuf_stkptrs[window];
struct reg_window *rwin = &tp->reg_window[window];
if(!copy_to_user((char *)sp, rwin, winsize)) {
shift_window_buffer(window, tp->w_saved - 1, tp);
tp->w_saved--;
}
} while(window--);
}
}
void fault_in_user_windows(struct pt_regs *regs)
{
struct thread_struct *tp = &current->tss;
unsigned long window = tp->w_saved;
int winsize = REGWIN_SZ;
if(tp->flags & SPARC_FLAG_32BIT)
winsize = REGWIN32_SZ;
if(window) {
window -= 1;
do {
unsigned long sp = tp->rwbuf_stkptrs[window];
struct reg_window *rwin = &tp->reg_window[window];
if(copy_to_user((char *)sp, rwin, winsize))
do_exit(SIGILL);
} while(window--);
}
current->tss.w_saved = 0;
}
/* Copy a Sparc thread. The fork() return value conventions /* Copy a Sparc thread. The fork() return value conventions
* under SunOS are nothing short of bletcherous: * under SunOS are nothing short of bletcherous:
......
/* $Id: rtrap.S,v 1.11 1997/04/03 13:03:50 davem Exp $ /* $Id: rtrap.S,v 1.14 1997/05/18 08:42:14 davem Exp $
* rtrap.S: Preparing for return from trap on Sparc V9. * rtrap.S: Preparing for return from trap on Sparc V9.
* *
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
...@@ -71,12 +71,11 @@ rtrap: ...@@ -71,12 +71,11 @@ rtrap:
/* We came here from to_user, ie. we have now AG. /* We came here from to_user, ie. we have now AG.
* Also have to push user context back into primary. * Also have to push user context back into primary.
*/ */
restore
mov SECONDARY_CONTEXT, %g6 mov SECONDARY_CONTEXT, %g6
mov PRIMARY_CONTEXT, %g7 mov PRIMARY_CONTEXT, %g7
ldxa [%g6] ASI_DMMU, %g4 ldxa [%g6] ASI_DMMU, %g4
stxa %g4, [%g7] ASI_DMMU stxa %g4, [%g7] ASI_DMMU
membar #Sync /* XXX flushi would be better -DaveM */
rdpr %wstate, %g1 rdpr %wstate, %g1
rdpr %otherwin, %g2 rdpr %otherwin, %g2
...@@ -84,7 +83,6 @@ rtrap: ...@@ -84,7 +83,6 @@ rtrap:
wrpr %g2, %g0, %canrestore wrpr %g2, %g0, %canrestore
wrpr %g1, %g0, %wstate wrpr %g1, %g0, %wstate
wrpr %g0, %g0, %otherwin wrpr %g0, %g0, %otherwin
retry
1: 1:
restore restore
retry retry
...@@ -101,9 +99,14 @@ to_user: ...@@ -101,9 +99,14 @@ to_user:
ldx [%g6 + AOFF_task_blocked], %o0 ldx [%g6 + AOFF_task_blocked], %o0
or %l7, PSTATE_AG, %l7 ! Will need this for setting back wstate or %l7, PSTATE_AG, %l7 ! Will need this for setting back wstate
andncc %l0, %o0, %g0 andncc %l0, %o0, %g0
be,pt %xcc, 3b be,pt %xcc, check_user_wins
mov %l5, %o2 mov %l5, %o2
mov %l6, %o3 mov %l6, %o3
add %sp, STACK_BIAS + REGWIN_SZ, %o1
call do_signal call do_signal
add %sp, STACK_BIAS + REGWIN_SZ, %o1
check_user_wins:
ldx [%g6 + AOFF_task_tss + AOFF_thread_w_saved], %o2
brz,pt %o2, 3b
add %sp, STACK_BIAS + REGWIN_SZ, %o1
call fault_in_user_windows
add %o7, 3b-.-4, %o7 add %o7, 3b-.-4, %o7
This diff is collapsed.
/* $Id: signal32.c,v 1.6 1997/04/16 10:27:17 jj Exp $ /* $Id: signal32.c,v 1.8 1997/05/18 08:42:15 davem Exp $
* arch/sparc64/kernel/signal32.c * arch/sparc64/kernel/signal32.c
* *
* Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1991, 1992 Linus Torvalds
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP))) #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
#define synchronize_user_stack() do { } while (0)
asmlinkage int sys_wait4(pid_t pid, unsigned long *stat_addr, asmlinkage int sys_wait4(pid_t pid, unsigned long *stat_addr,
int options, unsigned long *ru); int options, unsigned long *ru);
...@@ -117,17 +115,6 @@ asmlinkage void _sigpause32_common(unsigned int set, struct pt_regs *regs) ...@@ -117,17 +115,6 @@ asmlinkage void _sigpause32_common(unsigned int set, struct pt_regs *regs)
} }
} }
asmlinkage void do_sigpause32(unsigned int set, struct pt_regs *regs)
{
_sigpause32_common(set, regs);
}
asmlinkage void do_sigsuspend32(struct pt_regs *regs)
{
_sigpause32_common(regs->u_regs[UREG_I0], regs);
}
static inline void static inline void
restore_fpu_state32(struct pt_regs *regs, __siginfo_fpu32_t *fpu) restore_fpu_state32(struct pt_regs *regs, __siginfo_fpu32_t *fpu)
{ {
...@@ -248,7 +235,9 @@ setup_frame32(struct sigaction *sa, unsigned long pc, unsigned long npc, ...@@ -248,7 +235,9 @@ setup_frame32(struct sigaction *sa, unsigned long pc, unsigned long npc,
{ {
struct signal_sframe32 *sframep; struct signal_sframe32 *sframep;
struct sigcontext32 *sc; struct sigcontext32 *sc;
#if 0
int window = 0; int window = 0;
#endif
int old_status = current->tss.sstk_info.cur_status; int old_status = current->tss.sstk_info.cur_status;
unsigned psr; unsigned psr;
int i; int i;
...@@ -424,7 +413,9 @@ setup_svr4_frame32(struct sigaction *sa, unsigned long pc, unsigned long npc, ...@@ -424,7 +413,9 @@ setup_svr4_frame32(struct sigaction *sa, unsigned long pc, unsigned long npc,
svr4_mcontext_t *mc; svr4_mcontext_t *mc;
svr4_gwindows_t *gw; svr4_gwindows_t *gw;
svr4_ucontext_t *uc; svr4_ucontext_t *uc;
#if 0
int window = 0; int window = 0;
#endif
unsigned psr; unsigned psr;
int i; int i;
......
This diff is collapsed.
/* $Id: sys_sparc32.c,v 1.12 1997/05/14 14:50:58 jj Exp $ /* $Id: sys_sparc32.c,v 1.13 1997/05/18 04:16:44 davem Exp $
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
* *
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
...@@ -34,9 +34,12 @@ ...@@ -34,9 +34,12 @@
#include <asm/ipc.h> #include <asm/ipc.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
/* As gcc will warn about casting u32 to some ptr, we have to cast it to unsigned long first, and that's what is A() for. /* As gcc will warn about casting u32 to some ptr, we have to cast it to
* You just do (void *)A(x), instead of having to type (void *)((unsigned long)x) or instead of just (void *)x, which will * unsigned long first, and that's what is A() for.
* produce warnings */ * You just do (void *)A(x), instead of having to
* type (void *)((unsigned long)x) or instead of just (void *)x, which will
* produce warnings.
*/
#define A(x) ((unsigned long)x) #define A(x) ((unsigned long)x)
extern asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on); extern asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
......
/* $Id: traps.c,v 1.5 1997/04/14 06:56:55 davem Exp $ /* $Id: traps.c,v 1.10 1997/05/18 08:42:16 davem Exp $
* arch/sparc/kernel/traps.c * arch/sparc/kernel/traps.c
* *
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/uaccess.h>
/* #define TRAP_DEBUG */ /* #define TRAP_DEBUG */
...@@ -42,6 +43,8 @@ void syscall_trace_entry(struct pt_regs *regs) ...@@ -42,6 +43,8 @@ void syscall_trace_entry(struct pt_regs *regs)
void syscall_trace_exit(struct pt_regs *regs) void syscall_trace_exit(struct pt_regs *regs)
{ {
printk("Syscall return check, reg dump.\n");
show_regs(regs);
} }
void sparc64_dtlb_fault_handler (void) void sparc64_dtlb_fault_handler (void)
...@@ -116,25 +119,45 @@ void die_if_kernel(char *str, struct pt_regs *regs) ...@@ -116,25 +119,45 @@ void die_if_kernel(char *str, struct pt_regs *regs)
show_regs(regs); show_regs(regs);
printk("Instruction DUMP:"); printk("Instruction DUMP:");
instruction_dump ((unsigned int *) regs->tpc); instruction_dump ((unsigned int *) regs->tpc);
while(1)
barrier();
if(regs->tstate & TSTATE_PRIV) if(regs->tstate & TSTATE_PRIV)
do_exit(SIGKILL); do_exit(SIGKILL);
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc, void do_illegal_instruction(struct pt_regs *regs)
unsigned long tstate)
{ {
unsigned long pc = regs->tpc;
unsigned long tstate = regs->tstate;
lock_kernel(); lock_kernel();
if(tstate & TSTATE_PRIV) if(tstate & TSTATE_PRIV)
die_if_kernel("Kernel illegal instruction", regs); die_if_kernel("Kernel illegal instruction", regs);
#ifdef TRAP_DEBUG #if 1
printk("Ill instr. at pc=%016lx instruction is %08x\n", {
regs->tpc, *(unsigned int *)regs->tpc); unsigned int insn;
printk("Ill instr. at pc=%016lx ", pc);
get_user(insn, ((unsigned int *)pc));
printk("insn=[%08x]\n", insn);
}
#endif #endif
current->tss.sig_address = pc; current->tss.sig_address = pc;
current->tss.sig_desc = SUBSIG_ILLINST; current->tss.sig_desc = SUBSIG_ILLINST;
send_sig(SIGILL, current, 1); send_sig(SIGILL, current, 1);
unlock_kernel(); unlock_kernel();
while(1)
barrier();
}
void do_mna(struct pt_regs *regs)
{
printk("AIEEE: do_mna at %016lx\n", regs->tpc);
show_regs(regs);
while(1)
barrier();
} }
void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc, void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc,
......
/* $Id: ttable.S,v 1.11 1997/03/25 09:47:21 davem Exp $ /* $Id: ttable.S,v 1.12 1997/05/17 08:22:30 davem Exp $
* ttable.S: Sparc V9 Trap Table(s) with SpitFire extensions. * ttable.S: Sparc V9 Trap Table(s) with SpitFire extensions.
* *
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
...@@ -13,7 +13,7 @@ tl0_iax: ACCESS_EXCEPTION_TRAP(instruction_access_exception) ...@@ -13,7 +13,7 @@ tl0_iax: ACCESS_EXCEPTION_TRAP(instruction_access_exception)
tl0_resv009: BTRAP(0x9) tl0_resv009: BTRAP(0x9)
tl0_iae: TRAP(do_iae) tl0_iae: TRAP(do_iae)
tl0_resv00b: BTRAP(0xb) BTRAP(0xc) BTRAP(0xd) BTRAP(0xe) BTRAP(0xf) tl0_resv00b: BTRAP(0xb) BTRAP(0xc) BTRAP(0xd) BTRAP(0xe) BTRAP(0xf)
tl0_ill: TRAP(do_ill) tl0_ill: TRAP(do_illegal_instruction)
tl0_privop: TRAP(do_privop) tl0_privop: TRAP(do_privop)
tl0_resv012: BTRAP(0x12) BTRAP(0x13) BTRAP(0x14) BTRAP(0x15) BTRAP(0x16) BTRAP(0x17) tl0_resv012: BTRAP(0x12) BTRAP(0x13) BTRAP(0x14) BTRAP(0x15) BTRAP(0x16) BTRAP(0x17)
tl0_resv018: BTRAP(0x18) BTRAP(0x19) BTRAP(0x1a) BTRAP(0x1b) BTRAP(0x1c) BTRAP(0x1d) tl0_resv018: BTRAP(0x18) BTRAP(0x19) BTRAP(0x1a) BTRAP(0x1b) BTRAP(0x1c) BTRAP(0x1d)
...@@ -226,27 +226,3 @@ tl1_f4o: FILL_4_OTHER ...@@ -226,27 +226,3 @@ tl1_f4o: FILL_4_OTHER
tl1_f5o: FILL_5_OTHER tl1_f5o: FILL_5_OTHER
tl1_f6o: FILL_6_OTHER tl1_f6o: FILL_6_OTHER
tl1_f7o: FILL_7_OTHER tl1_f7o: FILL_7_OTHER
#if 0
/* Unless we are going to have software trap insns in the kernel code, we
* don't need this. For now we just save 8KB.
*/
#define BTRAPSTL1(x) BTRAPTL1(x) BTRAPTL1(x+1) BTRAPTL1(x+2) BTRAPTL1(x+3) BTRAPTL1(x+4) BTRAPTL1(x+5) BTRAPTL1(x+6) BTRAPTL1(x+7)
tl1_sunos: BTRAPTL1(0x100)
tl1_bkpt: BREAKPOINT_TRAP
tl1_resv102: BTRAPTL1(0x102)
tl1_flushw: FLUSH_WINDOW_TRAP
tl1_resv104: BTRAPTL1(0x104) BTRAPTL1(0x105) BTRAPTL1(0x106)
tl1_resv107: BTRAPTL1(0x107) BTRAPTL1(0x108) BTRAPTL1(0x109) BTRAPTL1(0x10a)
tl1_resv10b: BTRAPTL1(0x10b) BTRAPTL1(0x10c) BTRAPTL1(0x10d) BTRAPTL1(0x10e)
tl1_resv10f: BTRAPTL1(0x10f)
tl1_resv110: BTRAPSTL1(0x110) BTRAPSTL1(0x118)
tl1_resv120: BTRAPSTL1(0x120) BTRAPSTL1(0x128)
tl1_resv130: BTRAPSTL1(0x130) BTRAPSTL1(0x138)
tl1_resv140: BTRAPSTL1(0x140) BTRAPSTL1(0x148)
tl1_resv150: BTRAPSTL1(0x150) BTRAPSTL1(0x158)
tl1_resv160: BTRAPSTL1(0x160) BTRAPSTL1(0x168)
tl1_resv170: BTRAPSTL1(0x170) BTRAPSTL1(0x178)
#endif
/* $Id: winfixup.S,v 1.3 1997/05/18 22:52:26 davem Exp $
*
* winfixup.S: Handle cases where user stack pointer is found to be bogus.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
*/
#include <asm/asi.h>
#include <asm/head.h>
#include <asm/page.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
#include <asm/asm_offsets.h>
.text
.align 32
/* Here are the rules, pay attention.
*
* The kernel is disallowed from touching user space while
* the trap level is greater than zero, except for from within
* the window spill/fill handlers. This must be followed
* so that we can easily detect the case where we tried to
* spill/fill with a bogus (or unmapped) user stack pointer.
*
* These are layed out in a special way for cache reasons,
* don't touch...
*/
.globl winfix_trampoline, fill_fixup, spill_fixup
fill_fixup:
ba,pt %xcc, etrap
rd %pc, %g7
mov %l5, %o4
mov %l4, %o5
srlx %l5, PAGE_SHIFT, %o3
clr %o1
sllx %o3, PAGE_SHIFT, %o3
and %l4, 0x4, %o2
call do_sparc64_fault
add %sp, STACK_BIAS + REGWIN_SZ, %o0
ba,a,pt %xcc, rtrap
nop
winfix_trampoline:
andn %g5, 0x7f, %g5
add %g5, 0x7c, %g5
wrpr %g5, %tnpc
done
spill_fixup:
rd %pic, %g1
ldx [%g1 + AOFF_task_tss + AOFF_thread_w_saved], %g2
sll %g2, 3, %g5
ldx [%g1 + AOFF_task_tss + AOFF_thread_flags], %g7
add %g1, %g5, %g5
andcc %g7, SPARC_FLAG_32BIT, %g0
stx %sp, [%g5 + AOFF_task_tss + AOFF_thread_rwbuf_stkptrs]
sll %g2, 5, %g5
bne,pt %xcc, 1f
add %g1, %g5, %g5
stx %l0, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x00]
stx %l1, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x08]
stx %l2, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x10]
stx %l3, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x18]
stx %l4, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x20]
stx %l5, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x28]
stx %l6, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x30]
stx %l7, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x38]
stx %i0, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x40]
stx %i1, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x48]
stx %i2, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x50]
stx %i3, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x58]
stx %i4, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x60]
stx %i5, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x68]
stx %i6, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x70]
stx %i7, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x78]
b,a,pt %xcc, 2f
add %g2, 1, %g2
1:
std %l0, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x00]
std %l2, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x08]
std %l4, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x10]
std %l6, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x18]
std %i0, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x20]
std %i2, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x28]
std %i4, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x30]
std %i6, [%g5 + AOFF_task_tss + AOFF_thread_reg_window + 0x38]
add %g2, 1, %g2
2:
stx %g2, [%g1 + AOFF_task_tss + AOFF_thread_w_saved]
rdpr %tstate, %g1
nop
andcc %g1, TSTATE_PRIV, %g0
be,pn %xcc, fill_fixup
saved
retry
/* $Id: blockops.S,v 1.5 1997/03/26 18:34:28 jj Exp $ /* $Id: blockops.S,v 1.6 1997/05/18 04:16:49 davem Exp $
* arch/sparc64/lib/blockops.S: UltraSparc block zero optimized routines. * arch/sparc64/lib/blockops.S: UltraSparc block zero optimized routines.
* *
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
...@@ -31,37 +31,8 @@ ...@@ -31,37 +31,8 @@
.text .text
.align 4 .align 4
.globl bzero_2page, bzero_1page #if 0
bzero_2page: .globl bzero_1page
/* %o0 = buf */
mov %o0, %o1
wr %g0, ASI_BLK_P, %asi
mov 0x10, %g2
membar #Sync|#StoreLoad
fzero %f48
fzero %f50
fzero %f52
fzero %f54
fzero %f56
fzero %f58
fzero %f60
fzero %f62
1:
BLAST_BLOCK(%o0, 0x000)
BLAST_BLOCK(%o0, 0x100)
BLAST_BLOCK(%o0, 0x200)
BLAST_BLOCK(%o0, 0x300)
subcc %g2, 1, %g2
bne,pt %icc, 1b
add %o0, 0x400, %o0
membar #Sync|#LoadStore|#StoreStore
retl
mov %o1, %o0
bzero_1page: bzero_1page:
/* %o0 = buf */ /* %o0 = buf */
mov %o0, %o1 mov %o0, %o1
...@@ -89,9 +60,36 @@ bzero_1page: ...@@ -89,9 +60,36 @@ bzero_1page:
retl retl
mov %o1, %o0 mov %o1, %o0
#endif
.globl __bfill64 .globl __bfill64
__bfill64: __bfill64:
#if 1
/* %o0 = buf, %o1 = 64-bit pattern */
#define FILL_BLOCK(buf, offset) \
stx %o1, [buf + offset + 0x38]; \
stx %o1, [buf + offset + 0x30]; \
stx %o1, [buf + offset + 0x28]; \
stx %o1, [buf + offset + 0x20]; \
stx %o1, [buf + offset + 0x18]; \
stx %o1, [buf + offset + 0x10]; \
stx %o1, [buf + offset + 0x08]; \
stx %o1, [buf + offset + 0x00];
mov 0x20, %g2
1:
FILL_BLOCK(%o0, 0x00)
FILL_BLOCK(%o0, 0x40)
FILL_BLOCK(%o0, 0x80)
FILL_BLOCK(%o0, 0xc0)
subcc %g2, 1, %g2
bne,pt %icc, 1b
add %o0, 0x100, %o0
retl
nop
#undef FILL_BLOCK
#else
/* %o0 = buf */ /* %o0 = buf */
stx %o1, [%sp + 0x7ff + 128] stx %o1, [%sp + 0x7ff + 128]
wr %g0, ASI_BLK_P, %asi wr %g0, ASI_BLK_P, %asi
...@@ -116,7 +114,9 @@ __bfill64: ...@@ -116,7 +114,9 @@ __bfill64:
retl retl
membar #Sync|#LoadStore|#StoreStore membar #Sync|#LoadStore|#StoreStore
#endif
#if 0
.globl __copy_1page .globl __copy_1page
__copy_1page: __copy_1page:
/* %o0 = dst, %o1 = src */ /* %o0 = dst, %o1 = src */
...@@ -135,4 +135,4 @@ __copy_1page: ...@@ -135,4 +135,4 @@ __copy_1page:
retl retl
membar #Sync|#LoadStore|#StoreStore membar #Sync|#LoadStore|#StoreStore
#endif
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
* Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/ */
#include <asm/asi.h>
#define LO_MAGIC 0x01010101 #define LO_MAGIC 0x01010101
#define HI_MAGIC 0x80808080 #define HI_MAGIC 0x80808080
...@@ -19,21 +21,21 @@ __strlen_user: ...@@ -19,21 +21,21 @@ __strlen_user:
be,pt %icc, 9f be,pt %icc, 9f
sethi %hi(HI_MAGIC), %o4 sethi %hi(HI_MAGIC), %o4
10: 10:
ldub [%o0], %o5 lduba [%o0] ASI_S, %o5
brz,pn %o5, 21f brz,pn %o5, 21f
add %o0, 1, %o0 add %o0, 1, %o0
andcc %o0, 3, %g0 andcc %o0, 3, %g0
be,pn %icc, 4f be,pn %icc, 4f
or %o4, %lo(HI_MAGIC), %o3 or %o4, %lo(HI_MAGIC), %o3
11: 11:
ldub [%o0], %o5 lduba [%o0] ASI_S, %o5
brz,pn %o5, 22f brz,pn %o5, 22f
add %o0, 1, %o0 add %o0, 1, %o0
andcc %o0, 3, %g0 andcc %o0, 3, %g0
be,pt %icc, 5f be,pt %icc, 5f
sethi %hi(LO_MAGIC), %o4 sethi %hi(LO_MAGIC), %o4
12: 12:
ldub [%o0], %o5 lduba [%o0] ASI_S, %o5
brz,pn %o5, 23f brz,pn %o5, 23f
add %o0, 1, %o0 add %o0, 1, %o0
ba,pt %icc, 13f ba,pt %icc, 13f
...@@ -45,7 +47,7 @@ __strlen_user: ...@@ -45,7 +47,7 @@ __strlen_user:
5: 5:
or %o4, %lo(LO_MAGIC), %o2 or %o4, %lo(LO_MAGIC), %o2
13: 13:
ld [%o0], %o5 lda [%o0] ASI_S, %o5
2: 2:
sub %o5, %o2, %o4 sub %o5, %o2, %o4
andcc %o4, %o3, %g0 andcc %o4, %o3, %g0
...@@ -68,7 +70,7 @@ __strlen_user: ...@@ -68,7 +70,7 @@ __strlen_user:
andcc %o5, 0xff, %g0 andcc %o5, 0xff, %g0
bne,a,pt %icc, 2b bne,a,pt %icc, 2b
14: 14:
ld [%o0], %o5 lda [%o0] ASI_S, %o5
add %o4, 1, %o4 add %o4, 1, %o4
1: 1:
retl retl
......
...@@ -24,14 +24,14 @@ __strncpy_from_user: ...@@ -24,14 +24,14 @@ __strncpy_from_user:
sub %g0, %o2, %o3 sub %g0, %o2, %o3
add %o0, %o2, %o0 add %o0, %o2, %o0
10: 10:
ldub [%o1 + %o3], %o4 lduba [%o1 + %o3] ASI_S, %o4
1: 1:
brz,pn %o4, 2f brz,pn %o4, 2f
stb %o4, [%o0 + %o3] stb %o4, [%o0 + %o3]
addcc %o3, 1, %o3 addcc %o3, 1, %o3
bne,pt %xcc, 1b bne,pt %xcc, 1b
11: 11:
ldub [%o1 + %o3], %o4 lduba [%o1 + %o3] ASI_S, %o4
retl retl
mov %o2, %o0 mov %o2, %o0
2: 2:
......
/* $Id: fault.c,v 1.5 1997/05/15 21:14:31 davem Exp $ /* $Id: fault.c,v 1.8 1997/05/18 04:16:52 davem Exp $
* arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc. * arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc.
* *
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
...@@ -134,8 +134,11 @@ asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc, ...@@ -134,8 +134,11 @@ asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc,
return 0; return 0;
} }
/* #define FAULT_TRACER */
asmlinkage void do_sparc64_fault(struct pt_regs *regs, int text_fault, int write, asmlinkage void do_sparc64_fault(struct pt_regs *regs, int text_fault, int write,
unsigned long address) unsigned long address, unsigned long tag,
unsigned long sfsr)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
struct task_struct *tsk = current; struct task_struct *tsk = current;
...@@ -143,7 +146,19 @@ asmlinkage void do_sparc64_fault(struct pt_regs *regs, int text_fault, int write ...@@ -143,7 +146,19 @@ asmlinkage void do_sparc64_fault(struct pt_regs *regs, int text_fault, int write
unsigned long fixup; unsigned long fixup;
unsigned long g2; unsigned long g2;
int from_user = !(regs->tstate & TSTATE_PRIV); int from_user = !(regs->tstate & TSTATE_PRIV);
#ifdef FAULT_TRACER
static unsigned long last_addr = 0;
static int rcnt = 0;
printk("do_sparc64_fault(PC[%016lx],t[%d],w[%d],addr[%016lx]tag[%016lx]"
"sfar[%016lx])\n", regs->tpc, text_fault, write, address, tag, sfsr);
if(address == last_addr && rcnt++ > 5) {
printk("Wheee lotsa bogus faults, something wrong, spinning\n");
while(1)
barrier();
}
last_addr = address;
#endif
lock_kernel (); lock_kernel ();
down(&mm->mmap_sem); down(&mm->mmap_sem);
vma = find_vma(mm, address); vma = find_vma(mm, address);
......
/* $Id: init.c,v 1.25 1997/04/28 14:57:11 davem Exp $ /* $Id: init.c,v 1.28 1997/05/18 04:16:53 davem Exp $
* arch/sparc64/mm/init.c * arch/sparc64/mm/init.c
* *
* Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu)
...@@ -457,16 +457,18 @@ void sparc_ultra_unmapioaddr(unsigned long virt_addr) ...@@ -457,16 +457,18 @@ void sparc_ultra_unmapioaddr(unsigned long virt_addr)
pte_clear(ptep); pte_clear(ptep);
} }
#ifdef DEBUG_MMU
void sparc_ultra_dump_itlb(void) void sparc_ultra_dump_itlb(void)
{ {
int slot; int slot;
prom_printf ("Contents of itlb:\n"); printk ("Contents of itlb: ");
for (slot = 0; slot < 64; slot+=2) { for (slot = 0; slot < 14; slot++) printk (" ");
prom_printf ("%2x:%016lx,%016lx %2x:%016lx,%016lx\n", printk ("%2x:%016lx,%016lx\n", 0, spitfire_get_itlb_tag(0), spitfire_get_itlb_data(0));
for (slot = 1; slot < 64; slot+=3) {
printk ("%2x:%016lx,%016lx %2x:%016lx,%016lx %2x:%016lx,%016lx\n",
slot, spitfire_get_itlb_tag(slot), spitfire_get_itlb_data(slot), slot, spitfire_get_itlb_tag(slot), spitfire_get_itlb_data(slot),
slot+1, spitfire_get_itlb_tag(slot+1), spitfire_get_itlb_data(slot+1)); slot+1, spitfire_get_itlb_tag(slot+1), spitfire_get_itlb_data(slot+1),
slot+2, spitfire_get_itlb_tag(slot+2), spitfire_get_itlb_data(slot+2));
} }
} }
...@@ -474,14 +476,16 @@ void sparc_ultra_dump_dtlb(void) ...@@ -474,14 +476,16 @@ void sparc_ultra_dump_dtlb(void)
{ {
int slot; int slot;
prom_printf ("Contents of dtlb:\n"); printk ("Contents of dtlb: ");
for (slot = 0; slot < 64; slot+=2) { for (slot = 0; slot < 14; slot++) printk (" ");
prom_printf ("%2x:%016lx,%016lx %2x:%016lx,%016lx\n", printk ("%2x:%016lx,%016lx\n", 0, spitfire_get_dtlb_tag(0), spitfire_get_dtlb_data(0));
for (slot = 1; slot < 64; slot+=3) {
printk ("%2x:%016lx,%016lx %2x:%016lx,%016lx %2x:%016lx,%016lx\n",
slot, spitfire_get_dtlb_tag(slot), spitfire_get_dtlb_data(slot), slot, spitfire_get_dtlb_tag(slot), spitfire_get_dtlb_data(slot),
slot+1, spitfire_get_dtlb_tag(slot+1), spitfire_get_dtlb_data(slot+1)); slot+1, spitfire_get_dtlb_tag(slot+1), spitfire_get_dtlb_data(slot+1),
slot+2, spitfire_get_dtlb_tag(slot+2), spitfire_get_dtlb_data(slot+2));
} }
} }
#endif
/* paging_init() sets up the page tables */ /* paging_init() sets up the page tables */
...@@ -643,7 +647,7 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem)) ...@@ -643,7 +647,7 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
high_memory = (void *) end_mem; high_memory = (void *) end_mem;
start_mem = PAGE_ALIGN(start_mem); start_mem = PAGE_ALIGN(start_mem);
num_physpages = (start_mem - phys_base - PAGE_OFFSET) >> PAGE_SHIFT; num_physpages = (start_mem - PAGE_OFFSET) >> PAGE_SHIFT;
addr = PAGE_OFFSET; addr = PAGE_OFFSET;
while(addr < start_mem) { while(addr < start_mem) {
...@@ -707,9 +711,14 @@ void free_initmem (void) ...@@ -707,9 +711,14 @@ void free_initmem (void)
addr = (unsigned long)(&__init_begin); addr = (unsigned long)(&__init_begin);
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
mem_map[MAP_NR(addr)].flags &= ~(1 << PG_reserved); unsigned long page = addr;
atomic_set(&mem_map[MAP_NR(addr)].count, 1);
free_page(addr); if(page < ((unsigned long)__va(phys_base)))
page += phys_base;
mem_map[MAP_NR(page)].flags &= ~(1 << PG_reserved);
atomic_set(&mem_map[MAP_NR(page)].count, 1);
free_page(page);
} }
} }
......
...@@ -30,6 +30,22 @@ else ...@@ -30,6 +30,22 @@ else
endif endif
endif endif
ifeq ($(CONFIG_ATARI_ACSI),y)
LX_OBJS += acsi.o
else
ifeq ($(CONFIG_ATARI_ACSI),m)
MX_OBJS += acsi.o
endif
endif
ifeq ($(CONFIG_ATARI_SLM),y)
L_OBJS += acsi_slm.o
else
ifeq ($(CONFIG_ATARI_SLM),m)
M_OBJS += acsi_slm.o
endif
endif
ifeq ($(CONFIG_AMIGA_Z2RAM),y) ifeq ($(CONFIG_AMIGA_Z2RAM),y)
L_OBJS += z2ram.o L_OBJS += z2ram.o
else else
......
...@@ -573,12 +573,12 @@ static int sun_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sec ...@@ -573,12 +573,12 @@ static int sun_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sec
spc = be16_to_cpu(label->ntrks) * be16_to_cpu(label->nsect); spc = be16_to_cpu(label->ntrks) * be16_to_cpu(label->nsect);
for(i=0; i < 8; i++, p++) { for(i=0; i < 8; i++, p++) {
unsigned long st_sector; unsigned long st_sector;
int num_sectors;
/* We register all partitions, even if zero size, so that
* the minor numbers end up ok as per SunOS interpretation.
*/
st_sector = first_sector + be32_to_cpu(p->start_cylinder) * spc; st_sector = first_sector + be32_to_cpu(p->start_cylinder) * spc;
add_partition(hd, current_minor, st_sector, be32_to_cpu(p->num_sectors)); num_sectors = be32_to_cpu(p->num_sectors);
if (num_sectors)
add_partition(hd, current_minor, st_sector, num_sectors);
current_minor++; current_minor++;
} }
printk("\n"); printk("\n");
...@@ -592,10 +592,10 @@ static int sun_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sec ...@@ -592,10 +592,10 @@ static int sun_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sec
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/affs_hardblocks.h> #include <linux/affs_hardblocks.h>
static __inline__ __u32 static __inline__ u32
checksum_block(__u32 *m, int size) checksum_block(u32 *m, int size)
{ {
__u32 sum = 0; u32 sum = 0;
while (size--) while (size--)
sum += htonl(*m++); sum += htonl(*m++);
......
...@@ -359,6 +359,10 @@ mcdx_ioctl( ...@@ -359,6 +359,10 @@ mcdx_ioctl(
msf.cdmsf_sec1 = uint2bcd(msf.cdmsf_sec1); msf.cdmsf_sec1 = uint2bcd(msf.cdmsf_sec1);
msf.cdmsf_frame1 = uint2bcd(msf.cdmsf_frame1); msf.cdmsf_frame1 = uint2bcd(msf.cdmsf_frame1);
stuffp->stop.dt.minute = msf.cdmsf_min1;
stuffp->stop.dt.second = msf.cdmsf_sec1;
stuffp->stop.dt.frame = msf.cdmsf_frame1;
return mcdx_playmsf(stuffp, &msf); return mcdx_playmsf(stuffp, &msf);
} }
......
...@@ -39,7 +39,10 @@ endif ...@@ -39,7 +39,10 @@ endif
ifndef CONFIG_SUN_KEYBOARD ifndef CONFIG_SUN_KEYBOARD
ifdef CONFIG_VT ifdef CONFIG_VT
L_OBJS += keyboard.o defkeymap.o L_OBJS += keyboard.o
endif
ifneq ($(ARCH),m68k)
L_OBJS += pc_keyb.o defkeymap.o
endif endif
endif endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -226,6 +226,11 @@ static const char *version = "defxx.c:v1.04 09/16/96 Lawrence V. Stefani (stefa ...@@ -226,6 +226,11 @@ static const char *version = "defxx.c:v1.04 09/16/96 Lawrence V. Stefani (stefa
#include "defxx.h" #include "defxx.h"
#define DYNAMIC_BUFFERS 1
#define SKBUFF_RX_COPYBREAK 200
#define NEW_SKB_SIZE (PI_RCV_DATA_K_SIZE_MAX)
/* Define global routines */ /* Define global routines */
int dfx_probe(struct device *dev); int dfx_probe(struct device *dev);
...@@ -1083,7 +1088,9 @@ __initfunc(int dfx_driver_init( ...@@ -1083,7 +1088,9 @@ __initfunc(int dfx_driver_init(
alloc_size = sizeof(PI_DESCR_BLOCK) + alloc_size = sizeof(PI_DESCR_BLOCK) +
PI_CMD_REQ_K_SIZE_MAX + PI_CMD_REQ_K_SIZE_MAX +
PI_CMD_RSP_K_SIZE_MAX + PI_CMD_RSP_K_SIZE_MAX +
#ifndef DYNAMIC_BUFFERS
(bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) + (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) +
#endif
sizeof(PI_CONSUMER_BLOCK) + sizeof(PI_CONSUMER_BLOCK) +
(PI_ALIGN_K_DESC_BLK - 1); (PI_ALIGN_K_DESC_BLK - 1);
top_v = (char *) kmalloc(alloc_size, GFP_KERNEL); top_v = (char *) kmalloc(alloc_size, GFP_KERNEL);
...@@ -1135,8 +1142,11 @@ __initfunc(int dfx_driver_init( ...@@ -1135,8 +1142,11 @@ __initfunc(int dfx_driver_init(
bp->rcv_block_virt = curr_v; bp->rcv_block_virt = curr_v;
bp->rcv_block_phys = curr_p; bp->rcv_block_phys = curr_p;
#ifndef DYNAMIC_BUFFERS
curr_v += (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX); curr_v += (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX);
curr_p += (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX); curr_p += (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX);
#endif
/* Reserve space for the consumer block */ /* Reserve space for the consumer block */
...@@ -2926,6 +2936,22 @@ void dfx_rcv_init( ...@@ -2926,6 +2936,22 @@ void dfx_rcv_init(
* driver initialization when we allocated memory for the receive buffers. * driver initialization when we allocated memory for the receive buffers.
*/ */
#ifdef DYNAMIC_BUFFERS
for (i = 0; i < (int)(bp->rcv_bufs_to_post); i++)
for (j = 0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post)
{
struct sk_buff *newskb;
bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP |
((PI_RCV_DATA_K_SIZE_MAX / PI_ALIGN_K_RCV_DATA_BUFF) << PI_RCV_DESCR_V_SEG_LEN));
newskb = dev_alloc_skb(NEW_SKB_SIZE);
bp->descr_block_virt->rcv_data[i+j].long_1 = virt_to_bus(newskb->data);
/*
* p_rcv_buff_va is only used inside the
* kernel so we put the skb pointer here.
*/
bp->p_rcv_buff_va[i+j] = (char *) newskb;
}
#else
for (i=0; i < (int)(bp->rcv_bufs_to_post); i++) for (i=0; i < (int)(bp->rcv_bufs_to_post); i++)
for (j=0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post) for (j=0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post)
{ {
...@@ -2934,6 +2960,7 @@ void dfx_rcv_init( ...@@ -2934,6 +2960,7 @@ void dfx_rcv_init(
bp->descr_block_virt->rcv_data[i+j].long_1 = (u32) (bp->rcv_block_phys + (i * PI_RCV_DATA_K_SIZE_MAX)); bp->descr_block_virt->rcv_data[i+j].long_1 = (u32) (bp->rcv_block_phys + (i * PI_RCV_DATA_K_SIZE_MAX));
bp->p_rcv_buff_va[i+j] = (char *) (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX)); bp->p_rcv_buff_va[i+j] = (char *) (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX));
} }
#endif
/* Update receive producer and Type 2 register */ /* Update receive producer and Type 2 register */
...@@ -2985,6 +3012,8 @@ void dfx_rcv_queue_process( ...@@ -2985,6 +3012,8 @@ void dfx_rcv_queue_process(
u32 descr, pkt_len; /* FMC descriptor field and packet length */ u32 descr, pkt_len; /* FMC descriptor field and packet length */
struct sk_buff *skb; /* pointer to a sk_buff to hold incoming packet data */ struct sk_buff *skb; /* pointer to a sk_buff to hold incoming packet data */
static int testing_dyn;
/* Service all consumed LLC receive frames */ /* Service all consumed LLC receive frames */
p_type_2_cons = (PI_TYPE_2_CONSUMER *)(&bp->cons_block_virt->xmt_rcv_data); p_type_2_cons = (PI_TYPE_2_CONSUMER *)(&bp->cons_block_virt->xmt_rcv_data);
...@@ -2992,7 +3021,14 @@ void dfx_rcv_queue_process( ...@@ -2992,7 +3021,14 @@ void dfx_rcv_queue_process(
{ {
/* Process any errors */ /* Process any errors */
p_buff = (char *) bp->p_rcv_buff_va[bp->rcv_xmt_reg.index.rcv_comp]; int entry;
entry = bp->rcv_xmt_reg.index.rcv_comp;
#ifdef DYNAMIC_BUFFERS
p_buff = (char *) (((struct sk_buff *)bp->p_rcv_buff_va[entry])->data);
#else
p_buff = (char *) bp->p_rcv_buff_va[entry];
#endif
memcpy(&descr, p_buff + RCV_BUFF_K_DESCR, sizeof(u32)); memcpy(&descr, p_buff + RCV_BUFF_K_DESCR, sizeof(u32));
if (descr & PI_FMC_DESCR_M_RCC_FLUSH) if (descr & PI_FMC_DESCR_M_RCC_FLUSH)
...@@ -3003,29 +3039,60 @@ void dfx_rcv_queue_process( ...@@ -3003,29 +3039,60 @@ void dfx_rcv_queue_process(
bp->rcv_frame_status_errors++; bp->rcv_frame_status_errors++;
} }
else else
{ {
int rx_in_place = 0;
/* The frame was received without errors - verify packet length */ /* The frame was received without errors - verify packet length */
pkt_len = (u32)((descr & PI_FMC_DESCR_M_LEN) >> PI_FMC_DESCR_V_LEN); pkt_len = (u32)((descr & PI_FMC_DESCR_M_LEN) >> PI_FMC_DESCR_V_LEN);
pkt_len -= 4; /* subtract 4 byte CRC */ pkt_len -= 4; /* subtract 4 byte CRC */
if (!IN_RANGE(pkt_len, FDDI_K_LLC_ZLEN, FDDI_K_LLC_LEN)) if (!IN_RANGE(pkt_len, FDDI_K_LLC_ZLEN, FDDI_K_LLC_LEN))
bp->rcv_length_errors++; bp->rcv_length_errors++;
else else{
{ #ifdef DYNAMIC_BUFFERS
skb = dev_alloc_skb(pkt_len+3); /* alloc new buffer to pass up, add room for PRH */ if (pkt_len > SKBUFF_RX_COPYBREAK) {
struct sk_buff *newskb;
newskb = dev_alloc_skb(NEW_SKB_SIZE);
if (newskb){
rx_in_place = 1;
#define JES_TESTING
#ifdef JES_TESTING
if(testing_dyn++ < 5)
printk("Skipping a memcpy\n");
skb = (struct sk_buff *)bp->p_rcv_buff_va[entry];
skb->data += RCV_BUFF_K_PADDING;
bp->p_rcv_buff_va[entry] = (char *)newskb;
bp->descr_block_virt->rcv_data[entry].long_1 = virt_to_bus(newskb->data);
#else
memcpy(newskb->data, p_buff + RCV_BUFF_K_PADDING, pkt_len+3);
skb = newskb;
#endif
} else
skb = 0;
} else
#endif
skb = dev_alloc_skb(pkt_len+3); /* alloc new buffer to pass up, add room for PRH */
if (skb == NULL) if (skb == NULL)
{ {
printk("%s: Could not allocate receive buffer. Dropping packet.\n", bp->dev->name); printk("%s: Could not allocate receive buffer. Dropping packet.\n", bp->dev->name);
bp->rcv_discards++; bp->rcv_discards++;
break;
} }
else else {
#ifndef DYNAMIC_BUFFERS
if (! rx_in_place)
#endif
{ {
/* Receive buffer allocated, pass receive packet up */ /* Receive buffer allocated, pass receive packet up */
memcpy(skb->data, p_buff + RCV_BUFF_K_PADDING, pkt_len+3);
}
memcpy(skb->data, p_buff + RCV_BUFF_K_PADDING, pkt_len+3);
skb->data += 3; /* adjust data field so that it points to FC byte */ skb->data += 3; /* adjust data field so that it points to FC byte */
skb->len = pkt_len; /* pass up packet length, NOT including CRC */ skb->len = pkt_len; /* pass up packet length, NOT including CRC */
skb->dev = bp->dev; /* pass up device pointer */ skb->dev = bp->dev; /* pass up device pointer */
skb->protocol = fddi_type_trans(skb, bp->dev); skb->protocol = fddi_type_trans(skb, bp->dev);
netif_rx(skb); netif_rx(skb);
...@@ -3034,9 +3101,9 @@ void dfx_rcv_queue_process( ...@@ -3034,9 +3101,9 @@ void dfx_rcv_queue_process(
bp->rcv_total_frames++; bp->rcv_total_frames++;
if (*(p_buff + RCV_BUFF_K_DA) & 0x01) if (*(p_buff + RCV_BUFF_K_DA) & 0x01)
bp->rcv_multicast_frames++; bp->rcv_multicast_frames++;
}
} }
} }
}
/* /*
* Advance the producer (for recycling) and advance the completion * Advance the producer (for recycling) and advance the completion
...@@ -3140,6 +3207,7 @@ int dfx_xmt_queue_pkt( ...@@ -3140,6 +3207,7 @@ int dfx_xmt_queue_pkt(
dev->name, skb->len); dev->name, skb->len);
bp->xmt_length_errors++; /* bump error counter */ bp->xmt_length_errors++; /* bump error counter */
dev_tint(dev); /* dequeue packets from xmt queue and send them */ dev_tint(dev); /* dequeue packets from xmt queue and send them */
dev_kfree_skb(skb, FREE_WRITE);
return(0); /* return "success" */ return(0); /* return "success" */
} }
/* /*
......
...@@ -134,7 +134,7 @@ int init_module(void) ...@@ -134,7 +134,7 @@ int init_module(void)
{ {
/* Find a name for this unit */ /* Find a name for this unit */
int err=dev_alloc_name(&dev_dummy,"dummy%d"); int err=dev_alloc_name(&dev_dummy,"dummy%d");
if(err) if(err<0)
return err; return err;
if (register_netdev(&dev_dummy) != 0) if (register_netdev(&dev_dummy) != 0)
return -EIO; return -EIO;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -150,6 +150,7 @@ struct pci_dev_info dev_info[] = { ...@@ -150,6 +150,7 @@ struct pci_dev_info dev_info[] = {
DEVICE( CMD, CMD_646, "646"), DEVICE( CMD, CMD_646, "646"),
DEVICE( VISION, VISION_QD8500, "QD-8500"), DEVICE( VISION, VISION_QD8500, "QD-8500"),
DEVICE( VISION, VISION_QD8580, "QD-8580"), DEVICE( VISION, VISION_QD8580, "QD-8580"),
DEVICE( BROOKTREE, BT848, "Brooktree 848"),
DEVICE( SIERRA, SIERRA_STB, "STB Horizon 64"), DEVICE( SIERRA, SIERRA_STB, "STB Horizon 64"),
DEVICE( ACC, ACC_2056, "2056"), DEVICE( ACC, ACC_2056, "2056"),
DEVICE( WINBOND, WINBOND_83769, "W83769F"), DEVICE( WINBOND, WINBOND_83769, "W83769F"),
...@@ -264,6 +265,7 @@ struct pci_dev_info dev_info[] = { ...@@ -264,6 +265,7 @@ struct pci_dev_info dev_info[] = {
DEVICE( INTEL, INTEL_82437VX, "82437VX Triton II"), DEVICE( INTEL, INTEL_82437VX, "82437VX Triton II"),
DEVICE( INTEL, INTEL_82371AB, "82371AB 430TX PIIX4"), DEVICE( INTEL, INTEL_82371AB, "82371AB 430TX PIIX4"),
DEVICE( INTEL, INTEL_P6, "Orion P6"), DEVICE( INTEL, INTEL_P6, "Orion P6"),
DEVICE( INTEL, INTEL_P6_2, "82450GX Orion P6"),
DEVICE( KTI, KTI_ET32P2, "ET32P2"), DEVICE( KTI, KTI_ET32P2, "ET32P2"),
DEVICE( ADAPTEC, ADAPTEC_7850, "AIC-7850"), DEVICE( ADAPTEC, ADAPTEC_7850, "AIC-7850"),
DEVICE( ADAPTEC, ADAPTEC_7855, "AIC-7855"), DEVICE( ADAPTEC, ADAPTEC_7855, "AIC-7855"),
...@@ -518,6 +520,7 @@ const char *pci_strvendor(unsigned int vendor) ...@@ -518,6 +520,7 @@ const char *pci_strvendor(unsigned int vendor)
case PCI_VENDOR_ID_OLICOM: return "Olicom"; case PCI_VENDOR_ID_OLICOM: return "Olicom";
case PCI_VENDOR_ID_CMD: return "CMD"; case PCI_VENDOR_ID_CMD: return "CMD";
case PCI_VENDOR_ID_VISION: return "Vision"; case PCI_VENDOR_ID_VISION: return "Vision";
case PCI_VENDOR_ID_BROOKTREE: return "Brooktree";
case PCI_VENDOR_ID_SIERRA: return "Sierra"; case PCI_VENDOR_ID_SIERRA: return "Sierra";
case PCI_VENDOR_ID_ACC: return "ACC MICROELECTRONICS"; case PCI_VENDOR_ID_ACC: return "ACC MICROELECTRONICS";
case PCI_VENDOR_ID_WINBOND: return "Winbond"; case PCI_VENDOR_ID_WINBOND: return "Winbond";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1026,6 +1026,10 @@ static unsigned long atari_dma_xfer_len( unsigned long wanted_len, ...@@ -1026,6 +1026,10 @@ static unsigned long atari_dma_xfer_len( unsigned long wanted_len,
{ {
unsigned long possible_len, limit; unsigned long possible_len, limit;
if (is_hades)
/* Hades has no SCSI DMA at all :-( Always force use of PIO */
return( 0 );
if (IS_A_TT()) if (IS_A_TT())
/* TT SCSI DMA can transfer arbitrary #bytes */ /* TT SCSI DMA can transfer arbitrary #bytes */
return( wanted_len ); return( wanted_len );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment