aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/Kconfig330
-rw-r--r--arch/sparc64/kernel/entry.S309
-rw-r--r--arch/sparc64/kernel/head.S3
-rw-r--r--arch/sparc64/kernel/kprobes.c36
-rw-r--r--arch/sparc64/kernel/pci.c3
-rw-r--r--arch/sparc64/kernel/rtrap.S13
-rw-r--r--arch/sparc64/kernel/setup.c12
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c3
-rw-r--r--arch/sparc64/kernel/sunos_ioctl32.c9
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c24
-rw-r--r--arch/sparc64/kernel/time.c2
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S1
-rw-r--r--arch/sparc64/lib/PeeCeeI.c77
-rw-r--r--arch/sparc64/lib/copy_page.S13
-rw-r--r--arch/sparc64/mm/fault.c8
-rw-r--r--arch/sparc64/mm/generic.c31
-rw-r--r--arch/sparc64/mm/init.c3
-rw-r--r--arch/sparc64/mm/ultra.S41
18 files changed, 324 insertions, 594 deletions
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 9afd28e2c4d5..1e9d8638a28a 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -5,6 +5,16 @@
5 5
6mainmenu "Linux/UltraSPARC Kernel Configuration" 6mainmenu "Linux/UltraSPARC Kernel Configuration"
7 7
8config SPARC64
9 bool
10 default y
11 help
12 SPARC is a family of RISC microprocessors designed and marketed by
13 Sun Microsystems, incorporated. This port covers the newer 64-bit
14 UltraSPARC. The UltraLinux project maintains both the SPARC32 and
15 SPARC64 ports; its web page is available at
16 <http://www.ultralinux.org/>.
17
8config 64BIT 18config 64BIT
9 def_bool y 19 def_bool y
10 20
@@ -16,6 +26,10 @@ config TIME_INTERPOLATION
16 bool 26 bool
17 default y 27 default y
18 28
29config ARCH_MAY_HAVE_PC_FDC
30 bool
31 default y
32
19choice 33choice
20 prompt "Kernel page size" 34 prompt "Kernel page size"
21 default SPARC64_PAGE_SIZE_8KB 35 default SPARC64_PAGE_SIZE_8KB
@@ -71,75 +85,6 @@ config SYSVIPC_COMPAT
71 85
72menu "General machine setup" 86menu "General machine setup"
73 87
74config BBC_I2C
75 tristate "UltraSPARC-III bootbus i2c controller driver"
76 depends on PCI
77 help
78 The BBC devices on the UltraSPARC III have two I2C controllers. The
79 first I2C controller connects mainly to configuration PROMs (NVRAM,
80 CPU configuration, DIMM types, etc.). The second I2C controller
81 connects to environmental control devices such as fans and
82 temperature sensors. The second controller also connects to the
83 smartcard reader, if present. Say Y to enable support for these.
84
85config VT
86 bool "Virtual terminal" if EMBEDDED
87 select INPUT
88 default y
89 ---help---
90 If you say Y here, you will get support for terminal devices with
91 display and keyboard devices. These are called "virtual" because you
92 can run several virtual terminals (also called virtual consoles) on
93 one physical terminal. This is rather useful, for example one
94 virtual terminal can collect system messages and warnings, another
95 one can be used for a text-mode user session, and a third could run
96 an X session, all in parallel. Switching between virtual terminals
97 is done with certain key combinations, usually Alt-<function key>.
98
99 The setterm command ("man setterm") can be used to change the
100 properties (such as colors or beeping) of a virtual terminal. The
101 man page console_codes(4) ("man console_codes") contains the special
102 character sequences that can be used to change those properties
103 directly. The fonts used on virtual terminals can be changed with
104 the setfont ("man setfont") command and the key bindings are defined
105 with the loadkeys ("man loadkeys") command.
106
107 You need at least one virtual terminal device in order to make use
108 of your keyboard and monitor. Therefore, only people configuring an
109 embedded system would want to say N here in order to save some
110 memory; the only way to log into such a system is then via a serial
111 or network connection.
112
113 If unsure, say Y, or else you won't be able to do much with your new
114 shiny Linux system :-)
115
116config VT_CONSOLE
117 bool "Support for console on virtual terminal" if EMBEDDED
118 depends on VT
119 default y
120 ---help---
121 The system console is the device which receives all kernel messages
122 and warnings and which allows logins in single user mode. If you
123 answer Y here, a virtual terminal (the device used to interact with
124 a physical terminal) can be used as system console. This is the most
125 common mode of operations, so you should say Y here unless you want
126 the kernel messages be output only to a serial port (in which case
127 you should say Y to "Console on serial port", below).
128
129 If you do say Y here, by default the currently visible virtual
130 terminal (/dev/tty0) will be used as system console. You can change
131 that with a kernel command line option such as "console=tty3" which
132 would use the third virtual terminal as system console. (Try "man
133 bootparam" or see the documentation of your boot loader (lilo or
134 loadlin) about how to pass options to the kernel at boot time.)
135
136 If unsure, say Y.
137
138config HW_CONSOLE
139 bool
140 depends on VT
141 default y
142
143config SMP 88config SMP
144 bool "Symmetric multi-processing support" 89 bool "Symmetric multi-processing support"
145 ---help--- 90 ---help---
@@ -205,17 +150,6 @@ config US2E_FREQ
205 150
206 If in doubt, say N. 151 If in doubt, say N.
207 152
208# Identify this as a Sparc64 build
209config SPARC64
210 bool
211 default y
212 help
213 SPARC is a family of RISC microprocessors designed and marketed by
214 Sun Microsystems, incorporated. This port covers the newer 64-bit
215 UltraSPARC. The UltraLinux project maintains both the SPARC32 and
216 SPARC64 ports; its web page is available at
217 <http://www.ultralinux.org/>.
218
219# Global things across all Sun machines. 153# Global things across all Sun machines.
220config RWSEM_GENERIC_SPINLOCK 154config RWSEM_GENERIC_SPINLOCK
221 bool 155 bool
@@ -246,6 +180,10 @@ config HUGETLB_PAGE_SIZE_64K
246 180
247endchoice 181endchoice
248 182
183endmenu
184
185source "mm/Kconfig"
186
249config GENERIC_ISA_DMA 187config GENERIC_ISA_DMA
250 bool 188 bool
251 default y 189 default y
@@ -344,33 +282,6 @@ config PCI_DOMAINS
344 bool 282 bool
345 default PCI 283 default PCI
346 284
347config RTC
348 tristate
349 depends on PCI
350 default y
351 ---help---
352 If you say Y here and create a character special file /dev/rtc with
353 major number 10 and minor number 135 using mknod ("man mknod"), you
354 will get access to the real time clock (or hardware clock) built
355 into your computer.
356
357 Every PC has such a clock built in. It can be used to generate
358 signals from as low as 1Hz up to 8192Hz, and can also be used
359 as a 24 hour alarm. It reports status information via the file
360 /proc/driver/rtc and its behaviour is set by various ioctls on
361 /dev/rtc.
362
363 If you run Linux on a multiprocessor machine and said Y to
364 "Symmetric Multi Processing" above, you should say Y here to read
365 and set the RTC in an SMP compatible fashion.
366
367 If you think you have a use for such a device (such as periodic data
368 sampling), then say Y here, and read <file:Documentation/rtc.txt>
369 for details.
370
371 To compile this driver as a module, choose M here: the
372 module will be called rtc.
373
374source "drivers/pci/Kconfig" 285source "drivers/pci/Kconfig"
375 286
376config SUN_OPENPROMFS 287config SUN_OPENPROMFS
@@ -414,6 +325,8 @@ config BINFMT_AOUT32
414 If you want to run SunOS binaries (see SunOS binary emulation below) 325 If you want to run SunOS binaries (see SunOS binary emulation below)
415 or other a.out binaries, say Y. If unsure, say N. 326 or other a.out binaries, say Y. If unsure, say N.
416 327
328menu "Executable file formats"
329
417source "fs/Kconfig.binfmt" 330source "fs/Kconfig.binfmt"
418 331
419config SUNOS_EMUL 332config SUNOS_EMUL
@@ -436,74 +349,7 @@ config SOLARIS_EMUL
436 To compile this code as a module, choose M here: the 349 To compile this code as a module, choose M here: the
437 module will be called solaris. 350 module will be called solaris.
438 351
439source "drivers/parport/Kconfig" 352endmenu
440
441config PRINTER
442 tristate "Parallel printer support"
443 depends on PARPORT
444 ---help---
445 If you intend to attach a printer to the parallel port of your Linux
446 box (as opposed to using a serial printer; if the connector at the
447 printer has 9 or 25 holes ["female"], then it's serial), say Y.
448 Also read the Printing-HOWTO, available from
449 <http://www.tldp.org/docs.html#howto>.
450
451 It is possible to share one parallel port among several devices
452 (e.g. printer and ZIP drive) and it is safe to compile the
453 corresponding drivers into the kernel.
454 To compile this driver as a module, choose M here and read
455 <file:Documentation/parport.txt>. The module will be called lp.
456
457 If you have several parallel ports, you can specify which ports to
458 use with the "lp" kernel command line option. (Try "man bootparam"
459 or see the documentation of your boot loader (lilo or loadlin) about
460 how to pass options to the kernel at boot time.) The syntax of the
461 "lp" command line option can be found in <file:drivers/char/lp.c>.
462
463 If you have more than 8 printers, you need to increase the LP_NO
464 macro in lp.c and the PARPORT_MAX macro in parport.h.
465
466config PPDEV
467 tristate "Support for user-space parallel port device drivers"
468 depends on PARPORT
469 ---help---
470 Saying Y to this adds support for /dev/parport device nodes. This
471 is needed for programs that want portable access to the parallel
472 port, for instance deviceid (which displays Plug-and-Play device
473 IDs).
474
475 This is the parallel port equivalent of SCSI generic support (sg).
476 It is safe to say N to this -- it is not needed for normal printing
477 or parallel port CD-ROM/disk support.
478
479 To compile this driver as a module, choose M here: the
480 module will be called ppdev.
481
482 If unsure, say N.
483
484config ENVCTRL
485 tristate "SUNW, envctrl support"
486 depends on PCI
487 help
488 Kernel support for temperature and fan monitoring on Sun SME
489 machines.
490
491 To compile this driver as a module, choose M here: the
492 module will be called envctrl.
493
494config DISPLAY7SEG
495 tristate "7-Segment Display support"
496 depends on PCI
497 ---help---
498 This is the driver for the 7-segment display and LED present on
499 Sun Microsystems CompactPCI models CP1400 and CP1500.
500
501 To compile this driver as a module, choose M here: the
502 module will be called display7seg.
503
504 If you do not have a CompactPCI model CP1400 or CP1500, or
505 another UltraSPARC-IIi-cEngine boardset with a 7-segment display,
506 you should say N to this option.
507 353
508config CMDLINE_BOOL 354config CMDLINE_BOOL
509 bool "Default bootloader kernel arguments" 355 bool "Default bootloader kernel arguments"
@@ -521,148 +367,16 @@ config CMDLINE
521 367
522 NOTE: This option WILL override the PROM bootargs setting! 368 NOTE: This option WILL override the PROM bootargs setting!
523 369
524source "mm/Kconfig"
525
526endmenu
527
528source "net/Kconfig" 370source "net/Kconfig"
529 371
530source "drivers/base/Kconfig" 372source "drivers/Kconfig"
531
532source "drivers/video/Kconfig"
533
534source "drivers/serial/Kconfig"
535 373
536source "drivers/sbus/char/Kconfig" 374source "drivers/sbus/char/Kconfig"
537 375
538source "drivers/mtd/Kconfig"
539
540source "drivers/block/Kconfig"
541
542source "drivers/ide/Kconfig"
543
544source "drivers/scsi/Kconfig"
545
546source "drivers/fc4/Kconfig" 376source "drivers/fc4/Kconfig"
547 377
548source "drivers/md/Kconfig"
549
550if PCI
551source "drivers/message/fusion/Kconfig"
552endif
553
554source "drivers/ieee1394/Kconfig"
555
556source "drivers/net/Kconfig"
557
558source "drivers/isdn/Kconfig"
559
560source "drivers/telephony/Kconfig"
561
562# This one must be before the filesystem configs. -DaveM
563
564menu "Unix98 PTY support"
565
566config UNIX98_PTYS
567 bool "Unix98 PTY support"
568 ---help---
569 A pseudo terminal (PTY) is a software device consisting of two
570 halves: a master and a slave. The slave device behaves identical to
571 a physical terminal; the master device is used by a process to
572 read data from and write data to the slave, thereby emulating a
573 terminal. Typical programs for the master side are telnet servers
574 and xterms.
575
576 Linux has traditionally used the BSD-like names /dev/ptyxx for
577 masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
578 has a number of problems. The GNU C library glibc 2.1 and later,
579 however, supports the Unix98 naming standard: in order to acquire a
580 pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
581 terminal is then made available to the process and the pseudo
582 terminal slave can be accessed as /dev/pts/<number>. What was
583 traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
584
585 The entries in /dev/pts/ are created on the fly by a virtual
586 file system; therefore, if you say Y here you should say Y to
587 "/dev/pts file system for Unix98 PTYs" as well.
588
589 If you want to say Y here, you need to have the C library glibc 2.1
590 or later (equal to libc-6.1, check with "ls -l /lib/libc.so.*").
591 Read the instructions in <file:Documentation/Changes> pertaining to
592 pseudo terminals. It's safe to say N.
593
594config UNIX98_PTY_COUNT
595 int "Maximum number of Unix98 PTYs in use (0-2048)"
596 depends on UNIX98_PTYS
597 default "256"
598 help
599 The maximum number of Unix98 PTYs that can be used at any one time.
600 The default is 256, and should be enough for desktop systems. Server
601 machines which support incoming telnet/rlogin/ssh connections and/or
602 serve several X terminals may want to increase this: every incoming
603 connection and every xterm uses up one PTY.
604
605 When not in use, each additional set of 256 PTYs occupy
606 approximately 8 KB of kernel memory on 32-bit architectures.
607
608endmenu
609
610menu "XFree86 DRI support"
611
612config DRM
613 bool "Direct Rendering Manager (XFree86 DRI support)"
614 help
615 Kernel-level support for the Direct Rendering Infrastructure (DRI)
616 introduced in XFree86 4.0. If you say Y here, you need to select
617 the module that's right for your graphics card from the list below.
618 These modules provide support for synchronization, security, and
619 DMA transfers. Please see <http://dri.sourceforge.net/> for more
620 details. You should also select and configure AGP
621 (/dev/agpgart) support.
622
623config DRM_FFB
624 tristate "Creator/Creator3D"
625 depends on DRM && BROKEN
626 help
627 Choose this option if you have one of Sun's Creator3D-based graphics
628 and frame buffer cards. Product page at
629 <http://www.sun.com/desktop/products/Graphics/creator3d.html>.
630
631config DRM_TDFX
632 tristate "3dfx Banshee/Voodoo3+"
633 depends on DRM
634 help
635 Choose this option if you have a 3dfx Banshee or Voodoo3 (or later),
636 graphics card. If M is selected, the module will be called tdfx.
637
638config DRM_R128
639 tristate "ATI Rage 128"
640 depends on DRM
641 help
642 Choose this option if you have an ATI Rage 128 graphics card. If M
643 is selected, the module will be called r128. AGP support for
644 this card is strongly suggested (unless you have a PCI version).
645
646endmenu
647
648source "drivers/input/Kconfig"
649
650source "drivers/i2c/Kconfig"
651
652source "drivers/hwmon/Kconfig"
653
654source "fs/Kconfig" 378source "fs/Kconfig"
655 379
656source "drivers/media/Kconfig"
657
658source "sound/Kconfig"
659
660source "drivers/usb/Kconfig"
661
662source "drivers/infiniband/Kconfig"
663
664source "drivers/char/watchdog/Kconfig"
665
666source "arch/sparc64/oprofile/Kconfig" 380source "arch/sparc64/oprofile/Kconfig"
667 381
668source "arch/sparc64/Kconfig.debug" 382source "arch/sparc64/Kconfig.debug"
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index cecdc0a7521f..3e0badb820c5 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -927,139 +927,6 @@ __spitfire_insn_access_exception:
927 ba,pt %xcc, rtrap 927 ba,pt %xcc, rtrap
928 clr %l6 928 clr %l6
929 929
930 /* Capture I/D/E-cache state into per-cpu error scoreboard.
931 *
932 * %g1: (TL>=0) ? 1 : 0
933 * %g2: scratch
934 * %g3: scratch
935 * %g4: AFSR
936 * %g5: AFAR
937 * %g6: current thread ptr
938 * %g7: scratch
939 */
940#define CHEETAH_LOG_ERROR \
941 /* Put "TL1" software bit into AFSR. */ \
942 and %g1, 0x1, %g1; \
943 sllx %g1, 63, %g2; \
944 or %g4, %g2, %g4; \
945 /* Get log entry pointer for this cpu at this trap level. */ \
946 BRANCH_IF_JALAPENO(g2,g3,50f) \
947 ldxa [%g0] ASI_SAFARI_CONFIG, %g2; \
948 srlx %g2, 17, %g2; \
949 ba,pt %xcc, 60f; \
950 and %g2, 0x3ff, %g2; \
95150: ldxa [%g0] ASI_JBUS_CONFIG, %g2; \
952 srlx %g2, 17, %g2; \
953 and %g2, 0x1f, %g2; \
95460: sllx %g2, 9, %g2; \
955 sethi %hi(cheetah_error_log), %g3; \
956 ldx [%g3 + %lo(cheetah_error_log)], %g3; \
957 brz,pn %g3, 80f; \
958 nop; \
959 add %g3, %g2, %g3; \
960 sllx %g1, 8, %g1; \
961 add %g3, %g1, %g1; \
962 /* %g1 holds pointer to the top of the logging scoreboard */ \
963 ldx [%g1 + 0x0], %g7; \
964 cmp %g7, -1; \
965 bne,pn %xcc, 80f; \
966 nop; \
967 stx %g4, [%g1 + 0x0]; \
968 stx %g5, [%g1 + 0x8]; \
969 add %g1, 0x10, %g1; \
970 /* %g1 now points to D-cache logging area */ \
971 set 0x3ff8, %g2; /* DC_addr mask */ \
972 and %g5, %g2, %g2; /* DC_addr bits of AFAR */ \
973 srlx %g5, 12, %g3; \
974 or %g3, 1, %g3; /* PHYS tag + valid */ \
97510: ldxa [%g2] ASI_DCACHE_TAG, %g7; \
976 cmp %g3, %g7; /* TAG match? */ \
977 bne,pt %xcc, 13f; \
978 nop; \
979 /* Yep, what we want, capture state. */ \
980 stx %g2, [%g1 + 0x20]; \
981 stx %g7, [%g1 + 0x28]; \
982 /* A membar Sync is required before and after utag access. */ \
983 membar #Sync; \
984 ldxa [%g2] ASI_DCACHE_UTAG, %g7; \
985 membar #Sync; \
986 stx %g7, [%g1 + 0x30]; \
987 ldxa [%g2] ASI_DCACHE_SNOOP_TAG, %g7; \
988 stx %g7, [%g1 + 0x38]; \
989 clr %g3; \
99012: ldxa [%g2 + %g3] ASI_DCACHE_DATA, %g7; \
991 stx %g7, [%g1]; \
992 add %g3, (1 << 5), %g3; \
993 cmp %g3, (4 << 5); \
994 bl,pt %xcc, 12b; \
995 add %g1, 0x8, %g1; \
996 ba,pt %xcc, 20f; \
997 add %g1, 0x20, %g1; \
99813: sethi %hi(1 << 14), %g7; \
999 add %g2, %g7, %g2; \
1000 srlx %g2, 14, %g7; \
1001 cmp %g7, 4; \
1002 bl,pt %xcc, 10b; \
1003 nop; \
1004 add %g1, 0x40, %g1; \
100520: /* %g1 now points to I-cache logging area */ \
1006 set 0x1fe0, %g2; /* IC_addr mask */ \
1007 and %g5, %g2, %g2; /* IC_addr bits of AFAR */ \
1008 sllx %g2, 1, %g2; /* IC_addr[13:6]==VA[12:5] */ \
1009 srlx %g5, (13 - 8), %g3; /* Make PTAG */ \
1010 andn %g3, 0xff, %g3; /* Mask off undefined bits */ \
101121: ldxa [%g2] ASI_IC_TAG, %g7; \
1012 andn %g7, 0xff, %g7; \
1013 cmp %g3, %g7; \
1014 bne,pt %xcc, 23f; \
1015 nop; \
1016 /* Yep, what we want, capture state. */ \
1017 stx %g2, [%g1 + 0x40]; \
1018 stx %g7, [%g1 + 0x48]; \
1019 add %g2, (1 << 3), %g2; \
1020 ldxa [%g2] ASI_IC_TAG, %g7; \
1021 add %g2, (1 << 3), %g2; \
1022 stx %g7, [%g1 + 0x50]; \
1023 ldxa [%g2] ASI_IC_TAG, %g7; \
1024 add %g2, (1 << 3), %g2; \
1025 stx %g7, [%g1 + 0x60]; \
1026 ldxa [%g2] ASI_IC_TAG, %g7; \
1027 stx %g7, [%g1 + 0x68]; \
1028 sub %g2, (3 << 3), %g2; \
1029 ldxa [%g2] ASI_IC_STAG, %g7; \
1030 stx %g7, [%g1 + 0x58]; \
1031 clr %g3; \
1032 srlx %g2, 2, %g2; \
103322: ldxa [%g2 + %g3] ASI_IC_INSTR, %g7; \
1034 stx %g7, [%g1]; \
1035 add %g3, (1 << 3), %g3; \
1036 cmp %g3, (8 << 3); \
1037 bl,pt %xcc, 22b; \
1038 add %g1, 0x8, %g1; \
1039 ba,pt %xcc, 30f; \
1040 add %g1, 0x30, %g1; \
104123: sethi %hi(1 << 14), %g7; \
1042 add %g2, %g7, %g2; \
1043 srlx %g2, 14, %g7; \
1044 cmp %g7, 4; \
1045 bl,pt %xcc, 21b; \
1046 nop; \
1047 add %g1, 0x70, %g1; \
104830: /* %g1 now points to E-cache logging area */ \
1049 andn %g5, (32 - 1), %g2; /* E-cache subblock */ \
1050 stx %g2, [%g1 + 0x20]; \
1051 ldxa [%g2] ASI_EC_TAG_DATA, %g7; \
1052 stx %g7, [%g1 + 0x28]; \
1053 ldxa [%g2] ASI_EC_R, %g0; \
1054 clr %g3; \
105531: ldxa [%g3] ASI_EC_DATA, %g7; \
1056 stx %g7, [%g1 + %g3]; \
1057 add %g3, 0x8, %g3; \
1058 cmp %g3, 0x20; \
1059 bl,pt %xcc, 31b; \
1060 nop; \
106180: /* DONE */
1062
1063 /* These get patched into the trap table at boot time 930 /* These get patched into the trap table at boot time
1064 * once we know we have a cheetah processor. 931 * once we know we have a cheetah processor.
1065 */ 932 */
@@ -1296,6 +1163,170 @@ dcpe_icpe_tl1_common:
1296 membar #Sync 1163 membar #Sync
1297 retry 1164 retry
1298 1165
1166 /* Capture I/D/E-cache state into per-cpu error scoreboard.
1167 *
1168 * %g1: (TL>=0) ? 1 : 0
1169 * %g2: scratch
1170 * %g3: scratch
1171 * %g4: AFSR
1172 * %g5: AFAR
1173 * %g6: current thread ptr
1174 * %g7: scratch
1175 */
1176__cheetah_log_error:
1177 /* Put "TL1" software bit into AFSR. */
1178 and %g1, 0x1, %g1
1179 sllx %g1, 63, %g2
1180 or %g4, %g2, %g4
1181
1182 /* Get log entry pointer for this cpu at this trap level. */
1183 BRANCH_IF_JALAPENO(g2,g3,50f)
1184 ldxa [%g0] ASI_SAFARI_CONFIG, %g2
1185 srlx %g2, 17, %g2
1186 ba,pt %xcc, 60f
1187 and %g2, 0x3ff, %g2
1188
118950: ldxa [%g0] ASI_JBUS_CONFIG, %g2
1190 srlx %g2, 17, %g2
1191 and %g2, 0x1f, %g2
1192
119360: sllx %g2, 9, %g2
1194 sethi %hi(cheetah_error_log), %g3
1195 ldx [%g3 + %lo(cheetah_error_log)], %g3
1196 brz,pn %g3, 80f
1197 nop
1198
1199 add %g3, %g2, %g3
1200 sllx %g1, 8, %g1
1201 add %g3, %g1, %g1
1202
1203 /* %g1 holds pointer to the top of the logging scoreboard */
1204 ldx [%g1 + 0x0], %g7
1205 cmp %g7, -1
1206 bne,pn %xcc, 80f
1207 nop
1208
1209 stx %g4, [%g1 + 0x0]
1210 stx %g5, [%g1 + 0x8]
1211 add %g1, 0x10, %g1
1212
1213 /* %g1 now points to D-cache logging area */
1214 set 0x3ff8, %g2 /* DC_addr mask */
1215 and %g5, %g2, %g2 /* DC_addr bits of AFAR */
1216 srlx %g5, 12, %g3
1217 or %g3, 1, %g3 /* PHYS tag + valid */
1218
121910: ldxa [%g2] ASI_DCACHE_TAG, %g7
1220 cmp %g3, %g7 /* TAG match? */
1221 bne,pt %xcc, 13f
1222 nop
1223
1224 /* Yep, what we want, capture state. */
1225 stx %g2, [%g1 + 0x20]
1226 stx %g7, [%g1 + 0x28]
1227
1228 /* A membar Sync is required before and after utag access. */
1229 membar #Sync
1230 ldxa [%g2] ASI_DCACHE_UTAG, %g7
1231 membar #Sync
1232 stx %g7, [%g1 + 0x30]
1233 ldxa [%g2] ASI_DCACHE_SNOOP_TAG, %g7
1234 stx %g7, [%g1 + 0x38]
1235 clr %g3
1236
123712: ldxa [%g2 + %g3] ASI_DCACHE_DATA, %g7
1238 stx %g7, [%g1]
1239 add %g3, (1 << 5), %g3
1240 cmp %g3, (4 << 5)
1241 bl,pt %xcc, 12b
1242 add %g1, 0x8, %g1
1243
1244 ba,pt %xcc, 20f
1245 add %g1, 0x20, %g1
1246
124713: sethi %hi(1 << 14), %g7
1248 add %g2, %g7, %g2
1249 srlx %g2, 14, %g7
1250 cmp %g7, 4
1251 bl,pt %xcc, 10b
1252 nop
1253
1254 add %g1, 0x40, %g1
1255
1256 /* %g1 now points to I-cache logging area */
125720: set 0x1fe0, %g2 /* IC_addr mask */
1258 and %g5, %g2, %g2 /* IC_addr bits of AFAR */
1259 sllx %g2, 1, %g2 /* IC_addr[13:6]==VA[12:5] */
1260 srlx %g5, (13 - 8), %g3 /* Make PTAG */
1261 andn %g3, 0xff, %g3 /* Mask off undefined bits */
1262
126321: ldxa [%g2] ASI_IC_TAG, %g7
1264 andn %g7, 0xff, %g7
1265 cmp %g3, %g7
1266 bne,pt %xcc, 23f
1267 nop
1268
1269 /* Yep, what we want, capture state. */
1270 stx %g2, [%g1 + 0x40]
1271 stx %g7, [%g1 + 0x48]
1272 add %g2, (1 << 3), %g2
1273 ldxa [%g2] ASI_IC_TAG, %g7
1274 add %g2, (1 << 3), %g2
1275 stx %g7, [%g1 + 0x50]
1276 ldxa [%g2] ASI_IC_TAG, %g7
1277 add %g2, (1 << 3), %g2
1278 stx %g7, [%g1 + 0x60]
1279 ldxa [%g2] ASI_IC_TAG, %g7
1280 stx %g7, [%g1 + 0x68]
1281 sub %g2, (3 << 3), %g2
1282 ldxa [%g2] ASI_IC_STAG, %g7
1283 stx %g7, [%g1 + 0x58]
1284 clr %g3
1285 srlx %g2, 2, %g2
1286
128722: ldxa [%g2 + %g3] ASI_IC_INSTR, %g7
1288 stx %g7, [%g1]
1289 add %g3, (1 << 3), %g3
1290 cmp %g3, (8 << 3)
1291 bl,pt %xcc, 22b
1292 add %g1, 0x8, %g1
1293
1294 ba,pt %xcc, 30f
1295 add %g1, 0x30, %g1
1296
129723: sethi %hi(1 << 14), %g7
1298 add %g2, %g7, %g2
1299 srlx %g2, 14, %g7
1300 cmp %g7, 4
1301 bl,pt %xcc, 21b
1302 nop
1303
1304 add %g1, 0x70, %g1
1305
1306 /* %g1 now points to E-cache logging area */
130730: andn %g5, (32 - 1), %g2
1308 stx %g2, [%g1 + 0x20]
1309 ldxa [%g2] ASI_EC_TAG_DATA, %g7
1310 stx %g7, [%g1 + 0x28]
1311 ldxa [%g2] ASI_EC_R, %g0
1312 clr %g3
1313
131431: ldxa [%g3] ASI_EC_DATA, %g7
1315 stx %g7, [%g1 + %g3]
1316 add %g3, 0x8, %g3
1317 cmp %g3, 0x20
1318
1319 bl,pt %xcc, 31b
1320 nop
132180:
1322 rdpr %tt, %g2
1323 cmp %g2, 0x70
1324 be c_fast_ecc
1325 cmp %g2, 0x63
1326 be c_cee
1327 nop
1328 ba,pt %xcc, c_deferred
1329
1299 /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc 1330 /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc
1300 * in the trap table. That code has done a memory barrier 1331 * in the trap table. That code has done a memory barrier
1301 * and has disabled both the I-cache and D-cache in the DCU 1332 * and has disabled both the I-cache and D-cache in the DCU
@@ -1321,8 +1352,10 @@ cheetah_fast_ecc:
1321 stxa %g4, [%g0] ASI_AFSR 1352 stxa %g4, [%g0] ASI_AFSR
1322 membar #Sync 1353 membar #Sync
1323 1354
1324 CHEETAH_LOG_ERROR 1355 ba,pt %xcc, __cheetah_log_error
1356 nop
1325 1357
1358c_fast_ecc:
1326 rdpr %pil, %g2 1359 rdpr %pil, %g2
1327 wrpr %g0, 15, %pil 1360 wrpr %g0, 15, %pil
1328 ba,pt %xcc, etrap_irq 1361 ba,pt %xcc, etrap_irq
@@ -1347,8 +1380,10 @@ cheetah_cee:
1347 stxa %g4, [%g0] ASI_AFSR 1380 stxa %g4, [%g0] ASI_AFSR
1348 membar #Sync 1381 membar #Sync
1349 1382
1350 CHEETAH_LOG_ERROR 1383 ba,pt %xcc, __cheetah_log_error
1384 nop
1351 1385
1386c_cee:
1352 rdpr %pil, %g2 1387 rdpr %pil, %g2
1353 wrpr %g0, 15, %pil 1388 wrpr %g0, 15, %pil
1354 ba,pt %xcc, etrap_irq 1389 ba,pt %xcc, etrap_irq
@@ -1373,8 +1408,10 @@ cheetah_deferred_trap:
1373 stxa %g4, [%g0] ASI_AFSR 1408 stxa %g4, [%g0] ASI_AFSR
1374 membar #Sync 1409 membar #Sync
1375 1410
1376 CHEETAH_LOG_ERROR 1411 ba,pt %xcc, __cheetah_log_error
1412 nop
1377 1413
1414c_deferred:
1378 rdpr %pil, %g2 1415 rdpr %pil, %g2
1379 wrpr %g0, 15, %pil 1416 wrpr %g0, 15, %pil
1380 ba,pt %xcc, etrap_irq 1417 ba,pt %xcc, etrap_irq
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index 8104a56ca2d8..1fa06c4e3bdb 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -538,11 +538,12 @@ cheetah_tlb_fixup:
538 nop 538 nop
539 call cheetah_plus_patch_winfixup 539 call cheetah_plus_patch_winfixup
540 nop 540 nop
541
542 541
5432: /* Patch copy/page operations to cheetah optimized versions. */ 5422: /* Patch copy/page operations to cheetah optimized versions. */
544 call cheetah_patch_copyops 543 call cheetah_patch_copyops
545 nop 544 nop
545 call cheetah_patch_copy_page
546 nop
546 call cheetah_patch_cachetlbops 547 call cheetah_patch_cachetlbops
547 nop 548 nop
548 549
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index bbf11f85dab1..0d66d07c8c6e 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -8,6 +8,7 @@
8#include <linux/kprobes.h> 8#include <linux/kprobes.h>
9#include <asm/kdebug.h> 9#include <asm/kdebug.h>
10#include <asm/signal.h> 10#include <asm/signal.h>
11#include <asm/cacheflush.h>
11 12
12/* We do not have hardware single-stepping on sparc64. 13/* We do not have hardware single-stepping on sparc64.
13 * So we implement software single-stepping with breakpoint 14 * So we implement software single-stepping with breakpoint
@@ -37,31 +38,31 @@
37 * - Mark that we are no longer actively in a kprobe. 38 * - Mark that we are no longer actively in a kprobe.
38 */ 39 */
39 40
40int arch_prepare_kprobe(struct kprobe *p) 41int __kprobes arch_prepare_kprobe(struct kprobe *p)
41{ 42{
42 return 0; 43 return 0;
43} 44}
44 45
45void arch_copy_kprobe(struct kprobe *p) 46void __kprobes arch_copy_kprobe(struct kprobe *p)
46{ 47{
47 p->ainsn.insn[0] = *p->addr; 48 p->ainsn.insn[0] = *p->addr;
48 p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2; 49 p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2;
49 p->opcode = *p->addr; 50 p->opcode = *p->addr;
50} 51}
51 52
52void arch_arm_kprobe(struct kprobe *p) 53void __kprobes arch_arm_kprobe(struct kprobe *p)
53{ 54{
54 *p->addr = BREAKPOINT_INSTRUCTION; 55 *p->addr = BREAKPOINT_INSTRUCTION;
55 flushi(p->addr); 56 flushi(p->addr);
56} 57}
57 58
58void arch_disarm_kprobe(struct kprobe *p) 59void __kprobes arch_disarm_kprobe(struct kprobe *p)
59{ 60{
60 *p->addr = p->opcode; 61 *p->addr = p->opcode;
61 flushi(p->addr); 62 flushi(p->addr);
62} 63}
63 64
64void arch_remove_kprobe(struct kprobe *p) 65void __kprobes arch_remove_kprobe(struct kprobe *p)
65{ 66{
66} 67}
67 68
@@ -111,7 +112,7 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
111 } 112 }
112} 113}
113 114
114static int kprobe_handler(struct pt_regs *regs) 115static int __kprobes kprobe_handler(struct pt_regs *regs)
115{ 116{
116 struct kprobe *p; 117 struct kprobe *p;
117 void *addr = (void *) regs->tpc; 118 void *addr = (void *) regs->tpc;
@@ -191,8 +192,9 @@ no_kprobe:
191 * The original INSN location was REAL_PC, it actually 192 * The original INSN location was REAL_PC, it actually
192 * executed at PC and produced destination address NPC. 193 * executed at PC and produced destination address NPC.
193 */ 194 */
194static unsigned long relbranch_fixup(u32 insn, unsigned long real_pc, 195static unsigned long __kprobes relbranch_fixup(u32 insn, unsigned long real_pc,
195 unsigned long pc, unsigned long npc) 196 unsigned long pc,
197 unsigned long npc)
196{ 198{
197 /* Branch not taken, no mods necessary. */ 199 /* Branch not taken, no mods necessary. */
198 if (npc == pc + 0x4UL) 200 if (npc == pc + 0x4UL)
@@ -217,7 +219,8 @@ static unsigned long relbranch_fixup(u32 insn, unsigned long real_pc,
217/* If INSN is an instruction which writes it's PC location 219/* If INSN is an instruction which writes it's PC location
218 * into a destination register, fix that up. 220 * into a destination register, fix that up.
219 */ 221 */
220static void retpc_fixup(struct pt_regs *regs, u32 insn, unsigned long real_pc) 222static void __kprobes retpc_fixup(struct pt_regs *regs, u32 insn,
223 unsigned long real_pc)
221{ 224{
222 unsigned long *slot = NULL; 225 unsigned long *slot = NULL;
223 226
@@ -257,7 +260,7 @@ static void retpc_fixup(struct pt_regs *regs, u32 insn, unsigned long real_pc)
257 * This function prepares to return from the post-single-step 260 * This function prepares to return from the post-single-step
258 * breakpoint trap. 261 * breakpoint trap.
259 */ 262 */
260static void resume_execution(struct kprobe *p, struct pt_regs *regs) 263static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
261{ 264{
262 u32 insn = p->ainsn.insn[0]; 265 u32 insn = p->ainsn.insn[0];
263 266
@@ -315,8 +318,8 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
315/* 318/*
316 * Wrapper routine to for handling exceptions. 319 * Wrapper routine to for handling exceptions.
317 */ 320 */
318int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, 321int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
319 void *data) 322 unsigned long val, void *data)
320{ 323{
321 struct die_args *args = (struct die_args *)data; 324 struct die_args *args = (struct die_args *)data;
322 switch (val) { 325 switch (val) {
@@ -344,7 +347,8 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
344 return NOTIFY_DONE; 347 return NOTIFY_DONE;
345} 348}
346 349
347asmlinkage void kprobe_trap(unsigned long trap_level, struct pt_regs *regs) 350asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
351 struct pt_regs *regs)
348{ 352{
349 BUG_ON(trap_level != 0x170 && trap_level != 0x171); 353 BUG_ON(trap_level != 0x170 && trap_level != 0x171);
350 354
@@ -368,7 +372,7 @@ static struct pt_regs jprobe_saved_regs;
368static struct pt_regs *jprobe_saved_regs_location; 372static struct pt_regs *jprobe_saved_regs_location;
369static struct sparc_stackf jprobe_saved_stack; 373static struct sparc_stackf jprobe_saved_stack;
370 374
371int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 375int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
372{ 376{
373 struct jprobe *jp = container_of(p, struct jprobe, kp); 377 struct jprobe *jp = container_of(p, struct jprobe, kp);
374 378
@@ -390,7 +394,7 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
390 return 1; 394 return 1;
391} 395}
392 396
393void jprobe_return(void) 397void __kprobes jprobe_return(void)
394{ 398{
395 preempt_enable_no_resched(); 399 preempt_enable_no_resched();
396 __asm__ __volatile__( 400 __asm__ __volatile__(
@@ -403,7 +407,7 @@ extern void jprobe_return_trap_instruction(void);
403 407
404extern void __show_regs(struct pt_regs * regs); 408extern void __show_regs(struct pt_regs * regs);
405 409
406int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 410int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
407{ 411{
408 u32 *addr = (u32 *) regs->tpc; 412 u32 *addr = (u32 *) regs->tpc;
409 413
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index f21c993f8856..ec8bf4012c0c 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -736,8 +736,7 @@ static void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma
736static void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma, 736static void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
737 enum pci_mmap_state mmap_state) 737 enum pci_mmap_state mmap_state)
738{ 738{
739 /* Our io_remap_page_range/io_remap_pfn_range takes care of this, 739 /* Our io_remap_pfn_range takes care of this, do nothing. */
740 do nothing. */
741} 740}
742 741
743/* Perform the actual remap of the pages for a PCI device mapping, as appropriate 742/* Perform the actual remap of the pages for a PCI device mapping, as appropriate
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
index 0696ed4b9d64..fafd227735fa 100644
--- a/arch/sparc64/kernel/rtrap.S
+++ b/arch/sparc64/kernel/rtrap.S
@@ -153,11 +153,14 @@ __handle_signal:
153rtrap_irq: 153rtrap_irq:
154rtrap_clr_l6: clr %l6 154rtrap_clr_l6: clr %l6
155rtrap: 155rtrap:
156 ldub [%g6 + TI_CPU], %l0 156#ifndef CONFIG_SMP
157 sethi %hi(irq_stat), %l2 ! &softirq_active 157 sethi %hi(per_cpu____cpu_data), %l0
158 or %l2, %lo(irq_stat), %l2 ! &softirq_active 158 lduw [%l0 + %lo(per_cpu____cpu_data)], %l1
159irqsz_patchme: sllx %l0, 0, %l0 159#else
160 lduw [%l2 + %l0], %l1 ! softirq_pending 160 sethi %hi(per_cpu____cpu_data), %l0
161 or %l0, %lo(per_cpu____cpu_data), %l0
162 lduw [%l0 + %g5], %l1
163#endif
161 cmp %l1, 0 164 cmp %l1, 0
162 165
163 /* mm/ultra.S:xcall_report_regs KNOWS about this load. */ 166 /* mm/ultra.S:xcall_report_regs KNOWS about this load. */
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index fbdfed3798d8..ddbed3341a23 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -511,18 +511,6 @@ void __init setup_arch(char **cmdline_p)
511 conswitchp = &prom_con; 511 conswitchp = &prom_con;
512#endif 512#endif
513 513
514#ifdef CONFIG_SMP
515 i = (unsigned long)&irq_stat[1] - (unsigned long)&irq_stat[0];
516 if ((i == SMP_CACHE_BYTES) || (i == (2 * SMP_CACHE_BYTES))) {
517 extern unsigned int irqsz_patchme[1];
518 irqsz_patchme[0] |= ((i == SMP_CACHE_BYTES) ? SMP_CACHE_BYTES_SHIFT : \
519 SMP_CACHE_BYTES_SHIFT + 1);
520 flushi((long)&irqsz_patchme[0]);
521 } else {
522 prom_printf("Unexpected size of irq_stat[] elements\n");
523 prom_halt();
524 }
525#endif
526 /* Work out if we are starfire early on */ 514 /* Work out if we are starfire early on */
527 check_if_starfire(); 515 check_if_starfire();
528 516
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index a3ea697f1adb..d89fc24808d3 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -88,8 +88,6 @@ extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
88extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg); 88extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
89extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *); 89extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
90extern long sparc32_open(const char __user * filename, int flags, int mode); 90extern long sparc32_open(const char __user * filename, int flags, int mode);
91extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
92 unsigned long offset, unsigned long size, pgprot_t prot, int space);
93extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 91extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
94 unsigned long pfn, unsigned long size, pgprot_t prot); 92 unsigned long pfn, unsigned long size, pgprot_t prot);
95extern void (*prom_palette)(int); 93extern void (*prom_palette)(int);
@@ -245,7 +243,6 @@ EXPORT_SYMBOL(pci_dma_supported);
245#endif 243#endif
246 244
247/* I/O device mmaping on Sparc64. */ 245/* I/O device mmaping on Sparc64. */
248EXPORT_SYMBOL(io_remap_page_range);
249EXPORT_SYMBOL(io_remap_pfn_range); 246EXPORT_SYMBOL(io_remap_pfn_range);
250 247
251/* Solaris/SunOS binary compatibility */ 248/* Solaris/SunOS binary compatibility */
diff --git a/arch/sparc64/kernel/sunos_ioctl32.c b/arch/sparc64/kernel/sunos_ioctl32.c
index 87c1aeb02220..7654b8a7f03a 100644
--- a/arch/sparc64/kernel/sunos_ioctl32.c
+++ b/arch/sparc64/kernel/sunos_ioctl32.c
@@ -152,11 +152,12 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
152 ret = compat_sys_ioctl(fd, SIOCGIFCONF, arg); 152 ret = compat_sys_ioctl(fd, SIOCGIFCONF, arg);
153 goto out; 153 goto out;
154 154
155 case _IOW('i', 21, struct ifreq): /* SIOCSIFMTU */ 155 case _IOW('i', 21, struct ifreq32):
156 ret = sys_ioctl(fd, SIOCSIFMTU, arg); 156 ret = compat_sys_ioctl(fd, SIOCSIFMTU, arg);
157 goto out; 157 goto out;
158 case _IOWR('i', 22, struct ifreq): /* SIOCGIFMTU */ 158
159 ret = sys_ioctl(fd, SIOCGIFMTU, arg); 159 case _IOWR('i', 22, struct ifreq32):
160 ret = compat_sys_ioctl(fd, SIOCGIFMTU, arg);
160 goto out; 161 goto out;
161 162
162 case _IOWR('i', 23, struct ifreq32): 163 case _IOWR('i', 23, struct ifreq32):
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 1d3aa588df8a..7f6239ed2521 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -1002,29 +1002,7 @@ asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
1002asmlinkage long sparc32_open(const char __user *filename, 1002asmlinkage long sparc32_open(const char __user *filename,
1003 int flags, int mode) 1003 int flags, int mode)
1004{ 1004{
1005 char * tmp; 1005 return do_sys_open(filename, flags, mode);
1006 int fd, error;
1007
1008 tmp = getname(filename);
1009 fd = PTR_ERR(tmp);
1010 if (!IS_ERR(tmp)) {
1011 fd = get_unused_fd();
1012 if (fd >= 0) {
1013 struct file * f = filp_open(tmp, flags, mode);
1014 error = PTR_ERR(f);
1015 if (IS_ERR(f))
1016 goto out_error;
1017 fd_install(fd, f);
1018 }
1019out:
1020 putname(tmp);
1021 }
1022 return fd;
1023
1024out_error:
1025 put_unused_fd(fd);
1026 fd = error;
1027 goto out;
1028} 1006}
1029 1007
1030extern unsigned long do_mremap(unsigned long addr, 1008extern unsigned long do_mremap(unsigned long addr,
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 362b9c26871b..3f08a32f51a1 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -449,7 +449,7 @@ static inline void timer_check_rtc(void)
449 static long last_rtc_update; 449 static long last_rtc_update;
450 450
451 /* Determine when to update the Mostek clock. */ 451 /* Determine when to update the Mostek clock. */
452 if ((time_status & STA_UNSYNC) == 0 && 452 if (ntp_synced() &&
453 xtime.tv_sec > last_rtc_update + 660 && 453 xtime.tv_sec > last_rtc_update + 660 &&
454 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && 454 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
455 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { 455 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index 950423da8a6a..f47d0be39378 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -17,6 +17,7 @@ SECTIONS
17 *(.text) 17 *(.text)
18 SCHED_TEXT 18 SCHED_TEXT
19 LOCK_TEXT 19 LOCK_TEXT
20 KPROBES_TEXT
20 *(.gnu.warning) 21 *(.gnu.warning)
21 } =0 22 } =0
22 _etext = .; 23 _etext = .;
diff --git a/arch/sparc64/lib/PeeCeeI.c b/arch/sparc64/lib/PeeCeeI.c
index 3008d536e8c2..3c6cfbb20360 100644
--- a/arch/sparc64/lib/PeeCeeI.c
+++ b/arch/sparc64/lib/PeeCeeI.c
@@ -7,28 +7,31 @@
7#include <asm/io.h> 7#include <asm/io.h>
8#include <asm/byteorder.h> 8#include <asm/byteorder.h>
9 9
10void outsb(void __iomem *addr, const void *src, unsigned long count) 10void outsb(unsigned long __addr, const void *src, unsigned long count)
11{ 11{
12 void __iomem *addr = (void __iomem *) __addr;
12 const u8 *p = src; 13 const u8 *p = src;
13 14
14 while(count--) 15 while (count--)
15 outb(*p++, addr); 16 outb(*p++, addr);
16} 17}
17 18
18void outsw(void __iomem *addr, const void *src, unsigned long count) 19void outsw(unsigned long __addr, const void *src, unsigned long count)
19{ 20{
20 if(count) { 21 void __iomem *addr = (void __iomem *) __addr;
22
23 if (count) {
21 u16 *ps = (u16 *)src; 24 u16 *ps = (u16 *)src;
22 u32 *pi; 25 u32 *pi;
23 26
24 if(((u64)src) & 0x2) { 27 if (((u64)src) & 0x2) {
25 u16 val = le16_to_cpup(ps); 28 u16 val = le16_to_cpup(ps);
26 outw(val, addr); 29 outw(val, addr);
27 ps++; 30 ps++;
28 count--; 31 count--;
29 } 32 }
30 pi = (u32 *)ps; 33 pi = (u32 *)ps;
31 while(count >= 2) { 34 while (count >= 2) {
32 u32 w = le32_to_cpup(pi); 35 u32 w = le32_to_cpup(pi);
33 36
34 pi++; 37 pi++;
@@ -37,19 +40,21 @@ void outsw(void __iomem *addr, const void *src, unsigned long count)
37 count -= 2; 40 count -= 2;
38 } 41 }
39 ps = (u16 *)pi; 42 ps = (u16 *)pi;
40 if(count) { 43 if (count) {
41 u16 val = le16_to_cpup(ps); 44 u16 val = le16_to_cpup(ps);
42 outw(val, addr); 45 outw(val, addr);
43 } 46 }
44 } 47 }
45} 48}
46 49
47void outsl(void __iomem *addr, const void *src, unsigned long count) 50void outsl(unsigned long __addr, const void *src, unsigned long count)
48{ 51{
49 if(count) { 52 void __iomem *addr = (void __iomem *) __addr;
50 if((((u64)src) & 0x3) == 0) { 53
54 if (count) {
55 if ((((u64)src) & 0x3) == 0) {
51 u32 *p = (u32 *)src; 56 u32 *p = (u32 *)src;
52 while(count--) { 57 while (count--) {
53 u32 val = cpu_to_le32p(p); 58 u32 val = cpu_to_le32p(p);
54 outl(val, addr); 59 outl(val, addr);
55 p++; 60 p++;
@@ -60,13 +65,13 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
60 u32 l = 0, l2; 65 u32 l = 0, l2;
61 u32 *pi; 66 u32 *pi;
62 67
63 switch(((u64)src) & 0x3) { 68 switch (((u64)src) & 0x3) {
64 case 0x2: 69 case 0x2:
65 count -= 1; 70 count -= 1;
66 l = cpu_to_le16p(ps) << 16; 71 l = cpu_to_le16p(ps) << 16;
67 ps++; 72 ps++;
68 pi = (u32 *)ps; 73 pi = (u32 *)ps;
69 while(count--) { 74 while (count--) {
70 l2 = cpu_to_le32p(pi); 75 l2 = cpu_to_le32p(pi);
71 pi++; 76 pi++;
72 outl(((l >> 16) | (l2 << 16)), addr); 77 outl(((l >> 16) | (l2 << 16)), addr);
@@ -86,7 +91,7 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
86 ps++; 91 ps++;
87 l |= (l2 << 16); 92 l |= (l2 << 16);
88 pi = (u32 *)ps; 93 pi = (u32 *)ps;
89 while(count--) { 94 while (count--) {
90 l2 = cpu_to_le32p(pi); 95 l2 = cpu_to_le32p(pi);
91 pi++; 96 pi++;
92 outl(((l >> 8) | (l2 << 24)), addr); 97 outl(((l >> 8) | (l2 << 24)), addr);
@@ -101,7 +106,7 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
101 pb = (u8 *)src; 106 pb = (u8 *)src;
102 l = (*pb++ << 24); 107 l = (*pb++ << 24);
103 pi = (u32 *)pb; 108 pi = (u32 *)pb;
104 while(count--) { 109 while (count--) {
105 l2 = cpu_to_le32p(pi); 110 l2 = cpu_to_le32p(pi);
106 pi++; 111 pi++;
107 outl(((l >> 24) | (l2 << 8)), addr); 112 outl(((l >> 24) | (l2 << 8)), addr);
@@ -119,16 +124,18 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
119 } 124 }
120} 125}
121 126
122void insb(void __iomem *addr, void *dst, unsigned long count) 127void insb(unsigned long __addr, void *dst, unsigned long count)
123{ 128{
124 if(count) { 129 void __iomem *addr = (void __iomem *) __addr;
130
131 if (count) {
125 u32 *pi; 132 u32 *pi;
126 u8 *pb = dst; 133 u8 *pb = dst;
127 134
128 while((((unsigned long)pb) & 0x3) && count--) 135 while ((((unsigned long)pb) & 0x3) && count--)
129 *pb++ = inb(addr); 136 *pb++ = inb(addr);
130 pi = (u32 *)pb; 137 pi = (u32 *)pb;
131 while(count >= 4) { 138 while (count >= 4) {
132 u32 w; 139 u32 w;
133 140
134 w = (inb(addr) << 24); 141 w = (inb(addr) << 24);
@@ -139,23 +146,25 @@ void insb(void __iomem *addr, void *dst, unsigned long count)
139 count -= 4; 146 count -= 4;
140 } 147 }
141 pb = (u8 *)pi; 148 pb = (u8 *)pi;
142 while(count--) 149 while (count--)
143 *pb++ = inb(addr); 150 *pb++ = inb(addr);
144 } 151 }
145} 152}
146 153
147void insw(void __iomem *addr, void *dst, unsigned long count) 154void insw(unsigned long __addr, void *dst, unsigned long count)
148{ 155{
149 if(count) { 156 void __iomem *addr = (void __iomem *) __addr;
157
158 if (count) {
150 u16 *ps = dst; 159 u16 *ps = dst;
151 u32 *pi; 160 u32 *pi;
152 161
153 if(((unsigned long)ps) & 0x2) { 162 if (((unsigned long)ps) & 0x2) {
154 *ps++ = le16_to_cpu(inw(addr)); 163 *ps++ = le16_to_cpu(inw(addr));
155 count--; 164 count--;
156 } 165 }
157 pi = (u32 *)ps; 166 pi = (u32 *)ps;
158 while(count >= 2) { 167 while (count >= 2) {
159 u32 w; 168 u32 w;
160 169
161 w = (le16_to_cpu(inw(addr)) << 16); 170 w = (le16_to_cpu(inw(addr)) << 16);
@@ -164,31 +173,33 @@ void insw(void __iomem *addr, void *dst, unsigned long count)
164 count -= 2; 173 count -= 2;
165 } 174 }
166 ps = (u16 *)pi; 175 ps = (u16 *)pi;
167 if(count) 176 if (count)
168 *ps = le16_to_cpu(inw(addr)); 177 *ps = le16_to_cpu(inw(addr));
169 } 178 }
170} 179}
171 180
172void insl(void __iomem *addr, void *dst, unsigned long count) 181void insl(unsigned long __addr, void *dst, unsigned long count)
173{ 182{
174 if(count) { 183 void __iomem *addr = (void __iomem *) __addr;
175 if((((unsigned long)dst) & 0x3) == 0) { 184
185 if (count) {
186 if ((((unsigned long)dst) & 0x3) == 0) {
176 u32 *pi = dst; 187 u32 *pi = dst;
177 while(count--) 188 while (count--)
178 *pi++ = le32_to_cpu(inl(addr)); 189 *pi++ = le32_to_cpu(inl(addr));
179 } else { 190 } else {
180 u32 l = 0, l2, *pi; 191 u32 l = 0, l2, *pi;
181 u16 *ps; 192 u16 *ps;
182 u8 *pb; 193 u8 *pb;
183 194
184 switch(((unsigned long)dst) & 3) { 195 switch (((unsigned long)dst) & 3) {
185 case 0x2: 196 case 0x2:
186 ps = dst; 197 ps = dst;
187 count -= 1; 198 count -= 1;
188 l = le32_to_cpu(inl(addr)); 199 l = le32_to_cpu(inl(addr));
189 *ps++ = l; 200 *ps++ = l;
190 pi = (u32 *)ps; 201 pi = (u32 *)ps;
191 while(count--) { 202 while (count--) {
192 l2 = le32_to_cpu(inl(addr)); 203 l2 = le32_to_cpu(inl(addr));
193 *pi++ = (l << 16) | (l2 >> 16); 204 *pi++ = (l << 16) | (l2 >> 16);
194 l = l2; 205 l = l2;
@@ -205,7 +216,7 @@ void insl(void __iomem *addr, void *dst, unsigned long count)
205 ps = (u16 *)pb; 216 ps = (u16 *)pb;
206 *ps++ = ((l >> 8) & 0xffff); 217 *ps++ = ((l >> 8) & 0xffff);
207 pi = (u32 *)ps; 218 pi = (u32 *)ps;
208 while(count--) { 219 while (count--) {
209 l2 = le32_to_cpu(inl(addr)); 220 l2 = le32_to_cpu(inl(addr));
210 *pi++ = (l << 24) | (l2 >> 8); 221 *pi++ = (l << 24) | (l2 >> 8);
211 l = l2; 222 l = l2;
@@ -220,7 +231,7 @@ void insl(void __iomem *addr, void *dst, unsigned long count)
220 l = le32_to_cpu(inl(addr)); 231 l = le32_to_cpu(inl(addr));
221 *pb++ = l >> 24; 232 *pb++ = l >> 24;
222 pi = (u32 *)pb; 233 pi = (u32 *)pb;
223 while(count--) { 234 while (count--) {
224 l2 = le32_to_cpu(inl(addr)); 235 l2 = le32_to_cpu(inl(addr));
225 *pi++ = (l << 8) | (l2 >> 24); 236 *pi++ = (l << 8) | (l2 >> 24);
226 l = l2; 237 l = l2;
diff --git a/arch/sparc64/lib/copy_page.S b/arch/sparc64/lib/copy_page.S
index 23ebf2c970b7..feebb14fd27a 100644
--- a/arch/sparc64/lib/copy_page.S
+++ b/arch/sparc64/lib/copy_page.S
@@ -87,7 +87,7 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
87 membar #Sync 87 membar #Sync
88 wrpr %o2, 0x0, %pstate 88 wrpr %o2, 0x0, %pstate
89 89
90 BRANCH_IF_ANY_CHEETAH(g3,o2,1f) 90cheetah_copy_page_insn:
91 ba,pt %xcc, 9f 91 ba,pt %xcc, 9f
92 nop 92 nop
93 93
@@ -240,3 +240,14 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
240 stw %o4, [%g6 + TI_PRE_COUNT] 240 stw %o4, [%g6 + TI_PRE_COUNT]
241 241
242 .size copy_user_page, .-copy_user_page 242 .size copy_user_page, .-copy_user_page
243
244 .globl cheetah_patch_copy_page
245cheetah_patch_copy_page:
246 sethi %hi(0x01000000), %o1 ! NOP
247 sethi %hi(cheetah_copy_page_insn), %o0
248 or %o0, %lo(cheetah_copy_page_insn), %o0
249 stw %o1, [%o0]
250 membar #StoreStore
251 flush %o0
252 retl
253 nop
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 52e9375288a9..db1e3310e907 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -18,6 +18,7 @@
18#include <linux/smp_lock.h> 18#include <linux/smp_lock.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/kprobes.h>
21 22
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/pgtable.h> 24#include <asm/pgtable.h>
@@ -117,8 +118,9 @@ unsigned long __init prom_probe_memory (void)
117 return tally; 118 return tally;
118} 119}
119 120
120static void unhandled_fault(unsigned long address, struct task_struct *tsk, 121static void __kprobes unhandled_fault(unsigned long address,
121 struct pt_regs *regs) 122 struct task_struct *tsk,
123 struct pt_regs *regs)
122{ 124{
123 if ((unsigned long) address < PAGE_SIZE) { 125 if ((unsigned long) address < PAGE_SIZE) {
124 printk(KERN_ALERT "Unable to handle kernel NULL " 126 printk(KERN_ALERT "Unable to handle kernel NULL "
@@ -304,7 +306,7 @@ cannot_handle:
304 unhandled_fault (address, current, regs); 306 unhandled_fault (address, current, regs);
305} 307}
306 308
307asmlinkage void do_sparc64_fault(struct pt_regs *regs) 309asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
308{ 310{
309 struct mm_struct *mm = current->mm; 311 struct mm_struct *mm = current->mm;
310 struct vm_area_struct *vma; 312 struct vm_area_struct *vma;
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c
index 6b31f6117a95..c954d91f01d0 100644
--- a/arch/sparc64/mm/generic.c
+++ b/arch/sparc64/mm/generic.c
@@ -116,37 +116,6 @@ static inline int io_remap_pud_range(struct mm_struct *mm, pud_t * pud, unsigned
116 return 0; 116 return 0;
117} 117}
118 118
119int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space)
120{
121 int error = 0;
122 pgd_t * dir;
123 unsigned long beg = from;
124 unsigned long end = from + size;
125 struct mm_struct *mm = vma->vm_mm;
126
127 prot = __pgprot(pg_iobits);
128 offset -= from;
129 dir = pgd_offset(mm, from);
130 flush_cache_range(vma, beg, end);
131
132 spin_lock(&mm->page_table_lock);
133 while (from < end) {
134 pud_t *pud = pud_alloc(mm, dir, from);
135 error = -ENOMEM;
136 if (!pud)
137 break;
138 error = io_remap_pud_range(mm, pud, from, end - from, offset + from, prot, space);
139 if (error)
140 break;
141 from = (from + PGDIR_SIZE) & PGDIR_MASK;
142 dir++;
143 }
144 flush_tlb_range(vma, beg, end);
145 spin_unlock(&mm->page_table_lock);
146
147 return error;
148}
149
150int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 119int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
151 unsigned long pfn, unsigned long size, pgprot_t prot) 120 unsigned long pfn, unsigned long size, pgprot_t prot)
152{ 121{
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 3fbaf342a452..fdb1ebb308c9 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -19,6 +19,7 @@
19#include <linux/pagemap.h> 19#include <linux/pagemap.h>
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/kprobes.h>
22 23
23#include <asm/head.h> 24#include <asm/head.h>
24#include <asm/system.h> 25#include <asm/system.h>
@@ -250,7 +251,7 @@ out:
250 put_cpu(); 251 put_cpu();
251} 252}
252 253
253void flush_icache_range(unsigned long start, unsigned long end) 254void __kprobes flush_icache_range(unsigned long start, unsigned long end)
254{ 255{
255 /* Cheetah has coherent I-cache. */ 256 /* Cheetah has coherent I-cache. */
256 if (tlb_type == spitfire) { 257 if (tlb_type == spitfire) {
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S
index 363770893797..b2ee9b53227f 100644
--- a/arch/sparc64/mm/ultra.S
+++ b/arch/sparc64/mm/ultra.S
@@ -10,6 +10,7 @@
10#include <asm/page.h> 10#include <asm/page.h>
11#include <asm/spitfire.h> 11#include <asm/spitfire.h>
12#include <asm/mmu_context.h> 12#include <asm/mmu_context.h>
13#include <asm/mmu.h>
13#include <asm/pil.h> 14#include <asm/pil.h>
14#include <asm/head.h> 15#include <asm/head.h>
15#include <asm/thread_info.h> 16#include <asm/thread_info.h>
@@ -45,6 +46,8 @@ __flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */
45 nop 46 nop
46 nop 47 nop
47 nop 48 nop
49 nop
50 nop
48 51
49 .align 32 52 .align 32
50 .globl __flush_tlb_pending 53 .globl __flush_tlb_pending
@@ -73,6 +76,9 @@ __flush_tlb_pending:
73 retl 76 retl
74 wrpr %g7, 0x0, %pstate 77 wrpr %g7, 0x0, %pstate
75 nop 78 nop
79 nop
80 nop
81 nop
76 82
77 .align 32 83 .align 32
78 .globl __flush_tlb_kernel_range 84 .globl __flush_tlb_kernel_range
@@ -113,6 +119,7 @@ __spitfire_flush_tlb_mm_slow:
113#else 119#else
114#error unsupported PAGE_SIZE 120#error unsupported PAGE_SIZE
115#endif 121#endif
122 .section .kprobes.text, "ax"
116 .align 32 123 .align 32
117 .globl __flush_icache_page 124 .globl __flush_icache_page
118__flush_icache_page: /* %o0 = phys_page */ 125__flush_icache_page: /* %o0 = phys_page */
@@ -195,6 +202,7 @@ dflush4:stxa %g0, [%o4] ASI_DCACHE_TAG
195 nop 202 nop
196#endif /* DCACHE_ALIASING_POSSIBLE */ 203#endif /* DCACHE_ALIASING_POSSIBLE */
197 204
205 .previous .text
198 .align 32 206 .align 32
199__prefill_dtlb: 207__prefill_dtlb:
200 rdpr %pstate, %g7 208 rdpr %pstate, %g7
@@ -224,16 +232,8 @@ __update_mmu_cache: /* %o0=hw_context, %o1=address, %o2=pte, %o3=fault_code */
224 or %o5, %o0, %o5 232 or %o5, %o0, %o5
225 ba,a,pt %xcc, __prefill_itlb 233 ba,a,pt %xcc, __prefill_itlb
226 234
227 /* Cheetah specific versions, patched at boot time. 235 /* Cheetah specific versions, patched at boot time. */
228 * 236__cheetah_flush_tlb_mm: /* 18 insns */
229 * This writes of the PRIMARY_CONTEXT register in this file are
230 * safe even on Cheetah+ and later wrt. the page size fields.
231 * The nucleus page size fields do not matter because we make
232 * no data references, and these instructions execute out of a
233 * locked I-TLB entry sitting in the fully assosciative I-TLB.
234 * This sequence should also never trap.
235 */
236__cheetah_flush_tlb_mm: /* 15 insns */
237 rdpr %pstate, %g7 237 rdpr %pstate, %g7
238 andn %g7, PSTATE_IE, %g2 238 andn %g7, PSTATE_IE, %g2
239 wrpr %g2, 0x0, %pstate 239 wrpr %g2, 0x0, %pstate
@@ -241,6 +241,9 @@ __cheetah_flush_tlb_mm: /* 15 insns */
241 mov PRIMARY_CONTEXT, %o2 241 mov PRIMARY_CONTEXT, %o2
242 mov 0x40, %g3 242 mov 0x40, %g3
243 ldxa [%o2] ASI_DMMU, %g2 243 ldxa [%o2] ASI_DMMU, %g2
244 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o1
245 sllx %o1, CTX_PGSZ1_NUC_SHIFT, %o1
246 or %o0, %o1, %o0 /* Preserve nucleus page size fields */
244 stxa %o0, [%o2] ASI_DMMU 247 stxa %o0, [%o2] ASI_DMMU
245 stxa %g0, [%g3] ASI_DMMU_DEMAP 248 stxa %g0, [%g3] ASI_DMMU_DEMAP
246 stxa %g0, [%g3] ASI_IMMU_DEMAP 249 stxa %g0, [%g3] ASI_IMMU_DEMAP
@@ -250,7 +253,7 @@ __cheetah_flush_tlb_mm: /* 15 insns */
250 retl 253 retl
251 wrpr %g7, 0x0, %pstate 254 wrpr %g7, 0x0, %pstate
252 255
253__cheetah_flush_tlb_pending: /* 23 insns */ 256__cheetah_flush_tlb_pending: /* 26 insns */
254 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */ 257 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
255 rdpr %pstate, %g7 258 rdpr %pstate, %g7
256 sllx %o1, 3, %o1 259 sllx %o1, 3, %o1
@@ -259,6 +262,9 @@ __cheetah_flush_tlb_pending: /* 23 insns */
259 wrpr %g0, 1, %tl 262 wrpr %g0, 1, %tl
260 mov PRIMARY_CONTEXT, %o4 263 mov PRIMARY_CONTEXT, %o4
261 ldxa [%o4] ASI_DMMU, %g2 264 ldxa [%o4] ASI_DMMU, %g2
265 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o3
266 sllx %o3, CTX_PGSZ1_NUC_SHIFT, %o3
267 or %o0, %o3, %o0 /* Preserve nucleus page size fields */
262 stxa %o0, [%o4] ASI_DMMU 268 stxa %o0, [%o4] ASI_DMMU
2631: sub %o1, (1 << 3), %o1 2691: sub %o1, (1 << 3), %o1
264 ldx [%o2 + %o1], %o3 270 ldx [%o2 + %o1], %o3
@@ -311,14 +317,14 @@ cheetah_patch_cachetlbops:
311 sethi %hi(__cheetah_flush_tlb_mm), %o1 317 sethi %hi(__cheetah_flush_tlb_mm), %o1
312 or %o1, %lo(__cheetah_flush_tlb_mm), %o1 318 or %o1, %lo(__cheetah_flush_tlb_mm), %o1
313 call cheetah_patch_one 319 call cheetah_patch_one
314 mov 15, %o2 320 mov 18, %o2
315 321
316 sethi %hi(__flush_tlb_pending), %o0 322 sethi %hi(__flush_tlb_pending), %o0
317 or %o0, %lo(__flush_tlb_pending), %o0 323 or %o0, %lo(__flush_tlb_pending), %o0
318 sethi %hi(__cheetah_flush_tlb_pending), %o1 324 sethi %hi(__cheetah_flush_tlb_pending), %o1
319 or %o1, %lo(__cheetah_flush_tlb_pending), %o1 325 or %o1, %lo(__cheetah_flush_tlb_pending), %o1
320 call cheetah_patch_one 326 call cheetah_patch_one
321 mov 23, %o2 327 mov 26, %o2
322 328
323#ifdef DCACHE_ALIASING_POSSIBLE 329#ifdef DCACHE_ALIASING_POSSIBLE
324 sethi %hi(__flush_dcache_page), %o0 330 sethi %hi(__flush_dcache_page), %o0
@@ -352,9 +358,12 @@ cheetah_patch_cachetlbops:
352 .globl xcall_flush_tlb_mm 358 .globl xcall_flush_tlb_mm
353xcall_flush_tlb_mm: 359xcall_flush_tlb_mm:
354 mov PRIMARY_CONTEXT, %g2 360 mov PRIMARY_CONTEXT, %g2
355 mov 0x40, %g4
356 ldxa [%g2] ASI_DMMU, %g3 361 ldxa [%g2] ASI_DMMU, %g3
362 srlx %g3, CTX_PGSZ1_NUC_SHIFT, %g4
363 sllx %g4, CTX_PGSZ1_NUC_SHIFT, %g4
364 or %g5, %g4, %g5 /* Preserve nucleus page size fields */
357 stxa %g5, [%g2] ASI_DMMU 365 stxa %g5, [%g2] ASI_DMMU
366 mov 0x40, %g4
358 stxa %g0, [%g4] ASI_DMMU_DEMAP 367 stxa %g0, [%g4] ASI_DMMU_DEMAP
359 stxa %g0, [%g4] ASI_IMMU_DEMAP 368 stxa %g0, [%g4] ASI_IMMU_DEMAP
360 stxa %g3, [%g2] ASI_DMMU 369 stxa %g3, [%g2] ASI_DMMU
@@ -366,6 +375,10 @@ xcall_flush_tlb_pending:
366 sllx %g1, 3, %g1 375 sllx %g1, 3, %g1
367 mov PRIMARY_CONTEXT, %g4 376 mov PRIMARY_CONTEXT, %g4
368 ldxa [%g4] ASI_DMMU, %g2 377 ldxa [%g4] ASI_DMMU, %g2
378 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %g4
379 sllx %g4, CTX_PGSZ1_NUC_SHIFT, %g4
380 or %g5, %g4, %g5
381 mov PRIMARY_CONTEXT, %g4
369 stxa %g5, [%g4] ASI_DMMU 382 stxa %g5, [%g4] ASI_DMMU
3701: sub %g1, (1 << 3), %g1 3831: sub %g1, (1 << 3), %g1
371 ldx [%g7 + %g1], %g5 384 ldx [%g7 + %g1], %g5