mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next
Pull sparc updates from David Miller:
1) Kill off support for sun4c and Cypress sun4m chips.
And as a result we were able to also kill off that ugly btfixup thing
that required multi-stage links of the final vmlinux image in the
Kbuild system. This should make the kbuild maintainers really happy.
Thanks a lot to Sam Ravnborg for his tireless efforts to get this
going.
2) Convert sparc64 to nobootmem. I suspect now with sparc32 being a lot
cleaner, it should be able to fall in line and modernize in this area
too.
3) Make sparc32 use generic clockevents, from Tkhai Kirill.
[ I fixed up the BPF rules, and tried to clean up the build rules too.
But I don't have - or want - a sparc cross-build environment, so the
BPF rule bug and the related build cleanup was all done with just a
bare "make -n" pseudo-test. - Linus ]
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: (110 commits)
sparc32: use flushi when run-time patching in per_cpu_patch
sparc32: fix cpuid_patch run-time patching
sparc32: drop unused inline functions in srmmu.c
sparc32: drop unused functions in pgtsrmmu.h
sparc32,leon: move leon mmu functions to leon_mm.c
sparc32,leon: remove duplicate definitions in leon.h
sparc32,leon: remove duplicate UART register definitions
sparc32,leon: move leon ASI definitions to asi.h
sparc32: move trap table to a separate file
sparc64: renamed ttable.S to ttable_64.S
sparc32: Remove asm/sysen.h header.
sparc32: Delete asm/smpprim.h
sparc32: Remove unused empty_bad_page{,_table} declarations.
sparc32: Kill boot_cpu_id4
sparc32: Move GET_PROCESSOR*_ID() out of asm/asmmacro.h
sparc32: Remove completely unused code from asm/cache.h
sparc32: Add ucmpdi2.o to obj-y instead of lib-y.
sparc32: add ucmpdi2
sparc: introduce arch/sparc/Kbuild
sparc: remove obsolete documentation
...
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
BTFIXUP
|
||||
-------
|
||||
|
||||
To build new kernels you have to issue "make image". The ready kernel
|
||||
in ELF format is placed in arch/sparc/boot/image. Explanation is below.
|
||||
|
||||
BTFIXUP is a unique feature of Linux/sparc among other architectures,
|
||||
developed by Jakub Jelinek (I think... Obviously David S. Miller took
|
||||
part, too). It allows to boot the same kernel at different
|
||||
sub-architectures, such as sun4c, sun4m, sun4d, where SunOS uses
|
||||
different kernels. This feature is convinient for people who you move
|
||||
disks between boxes and for distrution builders.
|
||||
|
||||
To function, BTFIXUP must link the kernel "in the draft" first,
|
||||
analyze the result, write a special stub code based on that, and
|
||||
build the final kernel with the stub (btfix.o).
|
||||
|
||||
Kai Germaschewski improved the build system of the kernel in the 2.5 series
|
||||
significantly. Unfortunately, the traditional way of running the draft
|
||||
linking from architecture specific Makefile before the actual linking
|
||||
by generic Makefile is nearly impossible to support properly in the
|
||||
new build system. Therefore, the way we integrate BTFIXUP with the
|
||||
build system was changed in 2.5.40. Now, generic Makefile performs
|
||||
the draft linking and stores the result in file vmlinux. Architecture
|
||||
specific post-processing invokes BTFIXUP machinery and final linking
|
||||
in the same way as other architectures do bootstraps.
|
||||
|
||||
Implications of that change are as follows.
|
||||
|
||||
1. Hackers must type "make image" now, instead of just "make", in the same
|
||||
way as s390 people do now. It is analogous to "make bzImage" on i386.
|
||||
This does NOT affect sparc64, you continue to use "make" to build sparc64
|
||||
kernels.
|
||||
|
||||
2. vmlinux is not the final kernel, so RPM builders have to adjust
|
||||
their spec files (if they delivered vmlinux for debugging).
|
||||
System.map generated for vmlinux is still valid.
|
||||
|
||||
3. Scripts that produce a.out images have to be changed. First, if they
|
||||
invoke make, they have to use "make image". Second, they have to pick up
|
||||
the new kernel in arch/sparc/boot/image instead of vmlinux.
|
||||
|
||||
4. Since we are compliant with Kai's build system now, make -j is permitted.
|
||||
|
||||
-- Pete Zaitcev
|
||||
zaitcev@yahoo.com
|
||||
8
arch/sparc/Kbuild
Normal file
8
arch/sparc/Kbuild
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# core part of the sparc kernel
|
||||
#
|
||||
|
||||
obj-y += kernel/
|
||||
obj-y += mm/
|
||||
obj-y += math-emu/
|
||||
obj-y += net/
|
||||
@@ -30,7 +30,7 @@ config SPARC
|
||||
select USE_GENERIC_SMP_HELPERS if SMP
|
||||
select GENERIC_PCI_IOMAP
|
||||
select HAVE_NMI_WATCHDOG if SPARC64
|
||||
select HAVE_BPF_JIT
|
||||
select HAVE_BPF_JIT if NET
|
||||
|
||||
config SPARC32
|
||||
def_bool !64BIT
|
||||
@@ -62,6 +62,7 @@ config SPARC64
|
||||
select IRQ_PREFLOW_FASTEOI
|
||||
select ARCH_HAVE_NMI_SAFE_CMPXCHG
|
||||
select HAVE_C_RECORDMCOUNT
|
||||
select NO_BOOTMEM
|
||||
|
||||
config ARCH_DEFCONFIG
|
||||
string
|
||||
@@ -74,17 +75,12 @@ config BITS
|
||||
default 32 if SPARC32
|
||||
default 64 if SPARC64
|
||||
|
||||
config ARCH_USES_GETTIMEOFFSET
|
||||
bool
|
||||
default y if SPARC32
|
||||
|
||||
config GENERIC_CMOS_UPDATE
|
||||
bool
|
||||
default y
|
||||
|
||||
config GENERIC_CLOCKEVENTS
|
||||
bool
|
||||
default y if SPARC64
|
||||
def_bool y
|
||||
|
||||
config IOMMU_HELPER
|
||||
bool
|
||||
@@ -155,7 +151,7 @@ source "kernel/Kconfig.freezer"
|
||||
menu "Processor type and features"
|
||||
|
||||
config SMP
|
||||
bool "Symmetric multi-processing support (does not work on sun4/sun4c)"
|
||||
bool "Symmetric multi-processing support"
|
||||
---help---
|
||||
This enables support for systems with more than one CPU. If you have
|
||||
a system with only one CPU, say N. If you have a system with more
|
||||
|
||||
@@ -19,39 +19,27 @@ ifeq ($(CONFIG_SPARC32),y)
|
||||
# sparc32
|
||||
#
|
||||
|
||||
#
|
||||
# Uncomment the first KBUILD_CFLAGS if you are doing kgdb source level
|
||||
# debugging of the kernel to get the proper debugging information.
|
||||
|
||||
AS := $(AS) -32
|
||||
LDFLAGS := -m elf32_sparc
|
||||
CHECKFLAGS += -D__sparc__
|
||||
LDFLAGS := -m elf32_sparc
|
||||
export BITS := 32
|
||||
UTS_MACHINE := sparc
|
||||
|
||||
#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
|
||||
KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
|
||||
KBUILD_AFLAGS += -m32 -Wa,-Av8
|
||||
|
||||
#LDFLAGS_vmlinux = -N -Ttext 0xf0004000
|
||||
# Since 2.5.40, the first stage is left not btfix-ed.
|
||||
# Actual linking is done with "make image".
|
||||
LDFLAGS_vmlinux = -r
|
||||
KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
|
||||
KBUILD_AFLAGS += -m32 -Wa,-Av8
|
||||
|
||||
else
|
||||
#####
|
||||
# sparc64
|
||||
#
|
||||
|
||||
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
|
||||
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
|
||||
LDFLAGS := -m elf64_sparc
|
||||
export BITS := 64
|
||||
UTS_MACHINE := sparc64
|
||||
|
||||
LDFLAGS := -m elf64_sparc
|
||||
export BITS := 64
|
||||
UTS_MACHINE := sparc64
|
||||
|
||||
KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
|
||||
-ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
|
||||
-Wa,--undeclared-regs
|
||||
KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
|
||||
KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
|
||||
KBUILD_CFLAGS += -Wa,--undeclared-regs
|
||||
KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
|
||||
KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
|
||||
|
||||
@@ -64,26 +52,14 @@ endif
|
||||
head-y := arch/sparc/kernel/head_$(BITS).o
|
||||
head-y += arch/sparc/kernel/init_task.o
|
||||
|
||||
core-y += arch/sparc/kernel/
|
||||
core-y += arch/sparc/mm/ arch/sparc/math-emu/
|
||||
core-y += arch/sparc/net/
|
||||
# See arch/sparc/Kbuild for the core part of the kernel
|
||||
core-y += arch/sparc/
|
||||
|
||||
libs-y += arch/sparc/prom/
|
||||
libs-y += arch/sparc/lib/
|
||||
|
||||
drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
|
||||
|
||||
# Export what is needed by arch/sparc/boot/Makefile
|
||||
export VMLINUX_INIT VMLINUX_MAIN
|
||||
VMLINUX_INIT := $(head-y) $(init-y)
|
||||
VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
|
||||
VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
|
||||
VMLINUX_MAIN += $(drivers-y) $(net-y)
|
||||
|
||||
ifdef CONFIG_KALLSYMS
|
||||
export kallsyms.o := .tmp_kallsyms2.o
|
||||
endif
|
||||
|
||||
boot := arch/sparc/boot
|
||||
|
||||
# Default target
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
ROOT_IMG := /usr/src/root.img
|
||||
ELFTOAOUT := elftoaout
|
||||
|
||||
hostprogs-y := piggyback btfixupprep
|
||||
targets := tftpboot.img btfix.o btfix.S image zImage vmlinux.aout
|
||||
hostprogs-y := piggyback
|
||||
targets := tftpboot.img image zImage vmlinux.aout
|
||||
clean-files := System.map
|
||||
|
||||
quiet_cmd_elftoaout = ELFTOAOUT $@
|
||||
@@ -17,58 +17,9 @@ quiet_cmd_piggy = PIGGY $@
|
||||
quiet_cmd_strip = STRIP $@
|
||||
cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@
|
||||
|
||||
ifeq ($(CONFIG_SPARC32),y)
|
||||
quiet_cmd_btfix = BTFIX $@
|
||||
cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
|
||||
quiet_cmd_sysmap = SYSMAP $(obj)/System.map
|
||||
cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
|
||||
quiet_cmd_image = LD $@
|
||||
cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@
|
||||
|
||||
define rule_image
|
||||
$(if $($(quiet)cmd_image), \
|
||||
echo ' $($(quiet)cmd_image)' &&) \
|
||||
$(cmd_image); \
|
||||
$(if $($(quiet)cmd_sysmap), \
|
||||
echo ' $($(quiet)cmd_sysmap)' &&) \
|
||||
$(cmd_sysmap) $@ $(obj)/System.map; \
|
||||
if [ $$? -ne 0 ]; then \
|
||||
rm -f $@; \
|
||||
/bin/false; \
|
||||
fi; \
|
||||
echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd
|
||||
endef
|
||||
|
||||
BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT))
|
||||
BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN))
|
||||
LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
|
||||
--start-group $(BTLIBS) --end-group \
|
||||
$(kallsyms.o) $(obj)/btfix.o
|
||||
|
||||
# Link the final image including btfixup'ed symbols.
|
||||
# This is a replacement for the link done in the top-level Makefile.
|
||||
# Note: No dependency on the prerequisite files since that would require
|
||||
# make to try check if they are updated - and due to changes
|
||||
# in gcc options (path for example) this would result in
|
||||
# these files being recompiled for each build.
|
||||
$(obj)/image: $(obj)/btfix.o FORCE
|
||||
$(call if_changed_rule,image)
|
||||
|
||||
$(obj)/zImage: $(obj)/image
|
||||
$(call if_changed,strip)
|
||||
@echo ' kernel: $@ is ready'
|
||||
|
||||
$(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE
|
||||
$(call if_changed,btfix)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SPARC64),y)
|
||||
|
||||
# Actual linking
|
||||
$(obj)/image: vmlinux FORCE
|
||||
$(call if_changed,strip)
|
||||
@echo ' kernel: $@ is ready'
|
||||
|
||||
$(obj)/zImage: $(obj)/image
|
||||
$(call if_changed,gzip)
|
||||
@@ -79,6 +30,10 @@ $(obj)/vmlinux.aout: vmlinux FORCE
|
||||
@echo ' kernel: $@ is ready'
|
||||
else
|
||||
|
||||
$(obj)/zImage: $(obj)/image
|
||||
$(call if_changed,strip)
|
||||
@echo ' kernel: $@ is ready'
|
||||
|
||||
# The following lines make a readable image for U-Boot.
|
||||
# uImage - Binary file read by U-boot
|
||||
# uImage.o - object file of uImage for loading with a
|
||||
@@ -107,6 +62,10 @@ $(obj)/uImage: $(obj)/image.gz
|
||||
|
||||
endif
|
||||
|
||||
$(obj)/image: vmlinux FORCE
|
||||
$(call if_changed,strip)
|
||||
@echo ' kernel: $@ is ready'
|
||||
|
||||
$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE
|
||||
$(call if_changed,elftoaout)
|
||||
$(call if_changed,piggy)
|
||||
|
||||
@@ -1,386 +0,0 @@
|
||||
/*
|
||||
Simple utility to prepare vmlinux image for sparc.
|
||||
Resolves all BTFIXUP uses and settings and creates
|
||||
a special .s object to link to the image.
|
||||
|
||||
Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define MAXSYMS 1024
|
||||
|
||||
static char *symtab = "SYMBOL TABLE:";
|
||||
static char *relrec = "RELOCATION RECORDS FOR [";
|
||||
static int rellen;
|
||||
static int symlen;
|
||||
int mode;
|
||||
|
||||
struct _btfixup;
|
||||
|
||||
typedef struct _btfixuprel {
|
||||
char *sect;
|
||||
unsigned long offset;
|
||||
struct _btfixup *f;
|
||||
int frel;
|
||||
struct _btfixuprel *next;
|
||||
} btfixuprel;
|
||||
|
||||
typedef struct _btfixup {
|
||||
int type;
|
||||
int setinitval;
|
||||
unsigned int initval;
|
||||
char *initvalstr;
|
||||
char *name;
|
||||
btfixuprel *rel;
|
||||
} btfixup;
|
||||
|
||||
btfixup array[MAXSYMS];
|
||||
int last = 0;
|
||||
char buffer[1024];
|
||||
unsigned long lastfoffset = -1;
|
||||
unsigned long lastfrelno;
|
||||
btfixup *lastf;
|
||||
|
||||
static void fatal(void) __attribute__((noreturn));
|
||||
static void fatal(void)
|
||||
{
|
||||
fprintf(stderr, "Malformed output from objdump\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static btfixup *find(int type, char *name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < last; i++) {
|
||||
if (array[i].type == type && !strcmp(array[i].name, name))
|
||||
return array + i;
|
||||
}
|
||||
array[last].type = type;
|
||||
array[last].name = strdup(name);
|
||||
array[last].setinitval = 0;
|
||||
if (!array[last].name) fatal();
|
||||
array[last].rel = NULL;
|
||||
last++;
|
||||
if (last >= MAXSYMS) {
|
||||
fprintf(stderr, "Ugh. Something strange. More than %d different BTFIXUP symbols\n", MAXSYMS);
|
||||
exit(1);
|
||||
}
|
||||
return array + last - 1;
|
||||
}
|
||||
|
||||
static void set_mode (char *buffer)
|
||||
{
|
||||
for (mode = 0;; mode++)
|
||||
if (buffer[mode] < '0' || buffer[mode] > '9')
|
||||
break;
|
||||
if (mode != 8 && mode != 16)
|
||||
fatal();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
char *p, *q;
|
||||
char *sect;
|
||||
int i, j, k;
|
||||
unsigned int initval;
|
||||
int shift;
|
||||
btfixup *f;
|
||||
btfixuprel *r, **rr;
|
||||
unsigned long offset;
|
||||
char *initvalstr;
|
||||
|
||||
symlen = strlen(symtab);
|
||||
while (fgets (buffer, 1024, stdin) != NULL)
|
||||
if (!strncmp (buffer, symtab, symlen))
|
||||
goto main0;
|
||||
fatal();
|
||||
main0:
|
||||
rellen = strlen(relrec);
|
||||
while (fgets (buffer, 1024, stdin) != NULL)
|
||||
if (!strncmp (buffer, relrec, rellen))
|
||||
goto main1;
|
||||
fatal();
|
||||
main1:
|
||||
sect = malloc(strlen (buffer + rellen) + 1);
|
||||
if (!sect) fatal();
|
||||
strcpy (sect, buffer + rellen);
|
||||
p = strchr (sect, ']');
|
||||
if (!p) fatal();
|
||||
*p = 0;
|
||||
if (fgets (buffer, 1024, stdin) == NULL)
|
||||
fatal();
|
||||
while (fgets (buffer, 1024, stdin) != NULL) {
|
||||
int nbase;
|
||||
if (!strncmp (buffer, relrec, rellen))
|
||||
goto main1;
|
||||
if (mode == 0)
|
||||
set_mode (buffer);
|
||||
p = strchr (buffer, '\n');
|
||||
if (p) *p = 0;
|
||||
if (strlen (buffer) < 22+mode)
|
||||
continue;
|
||||
if (strncmp (buffer + mode, " R_SPARC_", 9))
|
||||
continue;
|
||||
nbase = 27 - 8 + mode;
|
||||
if (buffer[nbase] != '_' || buffer[nbase+1] != '_' || buffer[nbase+2] != '_')
|
||||
continue;
|
||||
switch (buffer[nbase+3]) {
|
||||
case 'f': /* CALL */
|
||||
case 'b': /* BLACKBOX */
|
||||
case 's': /* SIMM13 */
|
||||
case 'a': /* HALF */
|
||||
case 'h': /* SETHI */
|
||||
case 'i': /* INT */
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
p = strchr (buffer + nbase+5, '+');
|
||||
if (p) *p = 0;
|
||||
shift = nbase + 5;
|
||||
if (buffer[nbase+4] == 's' && buffer[nbase+5] == '_') {
|
||||
shift = nbase + 6;
|
||||
if (strcmp (sect, ".init.text")) {
|
||||
fprintf(stderr,
|
||||
"Wrong use of '%s' BTFIXUPSET in '%s' section.\n"
|
||||
"BTFIXUPSET_CALL can be used only in"
|
||||
" __init sections\n",
|
||||
buffer + shift, sect);
|
||||
exit(1);
|
||||
}
|
||||
} else if (buffer[nbase+4] != '_')
|
||||
continue;
|
||||
if (!strcmp (sect, ".text.exit"))
|
||||
continue;
|
||||
if (strcmp (sect, ".text") &&
|
||||
strcmp (sect, ".init.text") &&
|
||||
strcmp (sect, ".fixup") &&
|
||||
(strcmp (sect, "__ksymtab") || buffer[nbase+3] != 'f')) {
|
||||
if (buffer[nbase+3] == 'f')
|
||||
fprintf(stderr,
|
||||
"Wrong use of '%s' in '%s' section.\n"
|
||||
" It can be used only in .text, .init.text,"
|
||||
" .fixup and __ksymtab\n",
|
||||
buffer + shift, sect);
|
||||
else
|
||||
fprintf(stderr,
|
||||
"Wrong use of '%s' in '%s' section.\n"
|
||||
" It can be only used in .text, .init.text,"
|
||||
" and .fixup\n", buffer + shift, sect);
|
||||
exit(1);
|
||||
}
|
||||
p = strstr (buffer + shift, "__btset_");
|
||||
if (p && buffer[nbase+4] == 's') {
|
||||
fprintf(stderr, "__btset_ in BTFIXUP name can only be used when defining the variable, not for setting\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
initval = 0;
|
||||
initvalstr = NULL;
|
||||
if (p) {
|
||||
if (p[8] != '0' || p[9] != 'x') {
|
||||
fprintf(stderr, "Pre-initialized values can be only initialized with hexadecimal constants starting 0x\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
initval = strtoul(p + 10, &q, 16);
|
||||
if (*q || !initval) {
|
||||
fprintf(stderr, "Pre-initialized values can be only in the form name__btset_0xXXXXXXXX where X are hex digits.\nThey cannot be name__btset_0x00000000 though. Use BTFIXUPDEF_XX instead of BTFIXUPDEF_XX_INIT then.\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
initvalstr = p + 10;
|
||||
*p = 0;
|
||||
}
|
||||
f = find(buffer[nbase+3], buffer + shift);
|
||||
if (buffer[nbase+4] == 's')
|
||||
continue;
|
||||
switch (buffer[nbase+3]) {
|
||||
case 'f':
|
||||
if (initval) {
|
||||
fprintf(stderr, "Cannot use pre-initialized fixups for calls\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (!strcmp (sect, "__ksymtab")) {
|
||||
if (strncmp (buffer + mode+9, "32 ", 10)) {
|
||||
fprintf(stderr, "BTFIXUP_CALL in EXPORT_SYMBOL results in relocation other than R_SPARC_32\n\%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
} else if (strncmp (buffer + mode+9, "WDISP30 ", 10) &&
|
||||
strncmp (buffer + mode+9, "HI22 ", 10) &&
|
||||
strncmp (buffer + mode+9, "LO10 ", 10)) {
|
||||
fprintf(stderr, "BTFIXUP_CALL results in relocation other than R_SPARC_WDISP30, R_SPARC_HI22 or R_SPARC_LO10\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'b':
|
||||
if (initval) {
|
||||
fprintf(stderr, "Cannot use pre-initialized fixups for blackboxes\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (strncmp (buffer + mode+9, "HI22 ", 10)) {
|
||||
fprintf(stderr, "BTFIXUP_BLACKBOX results in relocation other than R_SPARC_HI22\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
if (initval + 0x1000 >= 0x2000) {
|
||||
fprintf(stderr, "Wrong initializer for SIMM13. Has to be from $fffff000 to $00000fff\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (strncmp (buffer + mode+9, "13 ", 10)) {
|
||||
fprintf(stderr, "BTFIXUP_SIMM13 results in relocation other than R_SPARC_13\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'a':
|
||||
if (initval + 0x1000 >= 0x2000 && (initval & 0x3ff)) {
|
||||
fprintf(stderr, "Wrong initializer for HALF.\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (strncmp (buffer + mode+9, "13 ", 10)) {
|
||||
fprintf(stderr, "BTFIXUP_HALF results in relocation other than R_SPARC_13\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'h':
|
||||
if (initval & 0x3ff) {
|
||||
fprintf(stderr, "Wrong initializer for SETHI. Cannot have set low 10 bits\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (strncmp (buffer + mode+9, "HI22 ", 10)) {
|
||||
fprintf(stderr, "BTFIXUP_SETHI results in relocation other than R_SPARC_HI22\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
if (initval) {
|
||||
fprintf(stderr, "Cannot use pre-initialized fixups for INT\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (strncmp (buffer + mode+9, "HI22 ", 10) && strncmp (buffer + mode+9, "LO10 ", 10)) {
|
||||
fprintf(stderr, "BTFIXUP_INT results in relocation other than R_SPARC_HI22 and R_SPARC_LO10\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!f->setinitval) {
|
||||
f->initval = initval;
|
||||
if (initvalstr) {
|
||||
f->initvalstr = strdup(initvalstr);
|
||||
if (!f->initvalstr) fatal();
|
||||
}
|
||||
f->setinitval = 1;
|
||||
} else if (f->initval != initval) {
|
||||
fprintf(stderr, "Btfixup %s previously used with initializer %s which doesn't match with current initializer\n%s\n",
|
||||
f->name, f->initvalstr ? : "0x00000000", buffer);
|
||||
exit(1);
|
||||
} else if (initval && strcmp(f->initvalstr, initvalstr)) {
|
||||
fprintf(stderr, "Btfixup %s previously used with initializer %s which doesn't match with current initializer.\n"
|
||||
"Initializers have to match literally as well.\n%s\n",
|
||||
f->name, f->initvalstr, buffer);
|
||||
exit(1);
|
||||
}
|
||||
offset = strtoul(buffer, &q, 16);
|
||||
if (q != buffer + mode || (!offset && (mode == 8 ? strncmp (buffer, "00000000 ", 9) : strncmp (buffer, "0000000000000000 ", 17)))) {
|
||||
fprintf(stderr, "Malformed relocation address in\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
for (k = 0, r = f->rel, rr = &f->rel; r; rr = &r->next, r = r->next, k++)
|
||||
if (r->offset == offset && !strcmp(r->sect, sect)) {
|
||||
fprintf(stderr, "Ugh. One address has two relocation records\n");
|
||||
exit(1);
|
||||
}
|
||||
*rr = malloc(sizeof(btfixuprel));
|
||||
if (!*rr) fatal();
|
||||
(*rr)->offset = offset;
|
||||
(*rr)->f = NULL;
|
||||
if (buffer[nbase+3] == 'f') {
|
||||
lastf = f;
|
||||
lastfoffset = offset;
|
||||
lastfrelno = k;
|
||||
} else if (lastfoffset + 4 == offset) {
|
||||
(*rr)->f = lastf;
|
||||
(*rr)->frel = lastfrelno;
|
||||
}
|
||||
(*rr)->sect = sect;
|
||||
(*rr)->next = NULL;
|
||||
}
|
||||
printf("! Generated by btfixupprep. Do not edit.\n\n");
|
||||
printf("\t.section\t\".data..init\",#alloc,#write\n\t.align\t4\n\n");
|
||||
printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n");
|
||||
for (i = 0; i < last; i++) {
|
||||
f = array + i;
|
||||
printf("\t.global\t___%cs_%s\n", f->type, f->name);
|
||||
if (f->type == 'f')
|
||||
printf("___%cs_%s:\n\t.word 0x%08x,0,0,", f->type, f->name, f->type << 24);
|
||||
else
|
||||
printf("___%cs_%s:\n\t.word 0x%08x,0,", f->type, f->name, f->type << 24);
|
||||
for (j = 0, r = f->rel; r != NULL; j++, r = r->next);
|
||||
if (j)
|
||||
printf("%d\n\t.word\t", j * 2);
|
||||
else
|
||||
printf("0\n");
|
||||
for (r = f->rel, j--; r != NULL; j--, r = r->next) {
|
||||
if (!strcmp (r->sect, ".text"))
|
||||
printf ("_stext+0x%08lx", r->offset);
|
||||
else if (!strcmp (r->sect, ".init.text"))
|
||||
printf ("__init_begin+0x%08lx", r->offset);
|
||||
else if (!strcmp (r->sect, "__ksymtab"))
|
||||
printf ("__start___ksymtab+0x%08lx", r->offset);
|
||||
else if (!strcmp (r->sect, ".fixup"))
|
||||
printf ("__start___fixup+0x%08lx", r->offset);
|
||||
else
|
||||
fatal();
|
||||
if (f->type == 'f' || !r->f)
|
||||
printf (",0");
|
||||
else
|
||||
printf (",___fs_%s+0x%08x", r->f->name, (4 + r->frel*2)*4 + 4);
|
||||
if (j) printf (",");
|
||||
else printf ("\n");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n\t.global\t___btfixup_end\n___btfixup_end:\n");
|
||||
printf("\n\n! Define undefined references\n\n");
|
||||
for (i = 0; i < last; i++) {
|
||||
f = array + i;
|
||||
if (f->type == 'f') {
|
||||
printf("\t.global\t___f_%s\n", f->name);
|
||||
printf("___f_%s:\n", f->name);
|
||||
}
|
||||
}
|
||||
printf("\tretl\n\t nop\n\n");
|
||||
for (i = 0; i < last; i++) {
|
||||
f = array + i;
|
||||
if (f->type != 'f') {
|
||||
if (!f->initval) {
|
||||
printf("\t.global\t___%c_%s\n", f->type, f->name);
|
||||
printf("___%c_%s = 0\n", f->type, f->name);
|
||||
} else {
|
||||
printf("\t.global\t___%c_%s__btset_0x%s\n", f->type, f->name, f->initvalstr);
|
||||
printf("___%c_%s__btset_0x%s = 0x%08x\n", f->type, f->name, f->initvalstr, f->initval);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("\n\n");
|
||||
exit(0);
|
||||
}
|
||||
@@ -112,6 +112,20 @@
|
||||
|
||||
#define ASI_M_ACTION 0x4c /* Breakpoint Action Register (GNU/Viking) */
|
||||
|
||||
/* LEON ASI */
|
||||
#define ASI_LEON_NOCACHE 0x01
|
||||
|
||||
#define ASI_LEON_DCACHE_MISS 0x01
|
||||
|
||||
#define ASI_LEON_CACHEREGS 0x02
|
||||
#define ASI_LEON_IFLUSH 0x10
|
||||
#define ASI_LEON_DFLUSH 0x11
|
||||
|
||||
#define ASI_LEON_MMUFLUSH 0x18
|
||||
#define ASI_LEON_MMUREGS 0x19
|
||||
#define ASI_LEON_BYPASS 0x1c
|
||||
#define ASI_LEON_FLUSH_PAGE 0x10
|
||||
|
||||
/* V9 Architecture mandary ASIs. */
|
||||
#define ASI_N 0x04 /* Nucleus */
|
||||
#define ASI_NL 0x0c /* Nucleus, little endian */
|
||||
|
||||
@@ -6,17 +6,6 @@
|
||||
#ifndef _SPARC_ASMMACRO_H
|
||||
#define _SPARC_ASMMACRO_H
|
||||
|
||||
#include <asm/btfixup.h>
|
||||
#include <asm/asi.h>
|
||||
|
||||
#define GET_PROCESSOR4M_ID(reg) \
|
||||
rd %tbr, %reg; \
|
||||
srl %reg, 12, %reg; \
|
||||
and %reg, 3, %reg;
|
||||
|
||||
#define GET_PROCESSOR4D_ID(reg) \
|
||||
lda [%g0] ASI_M_VIKING_TMP1, %reg;
|
||||
|
||||
/* All trap entry points _must_ begin with this macro or else you
|
||||
* lose. It makes sure the kernel has a proper window so that
|
||||
* c-code can be called.
|
||||
@@ -31,10 +20,4 @@
|
||||
/* All traps low-level code here must end with this macro. */
|
||||
#define RESTORE_ALL b ret_trap_entry; clr %l6;
|
||||
|
||||
/* sun4 probably wants half word accesses to ASI_SEGMAP, while sun4c+
|
||||
likes byte accesses. These are to avoid ifdef mania. */
|
||||
|
||||
#define lduXa lduba
|
||||
#define stXa stba
|
||||
|
||||
#endif /* !(_SPARC_ASMMACRO_H) */
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
/*
|
||||
* asm/btfixup.h: Macros for boot time linking.
|
||||
*
|
||||
* Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
|
||||
*/
|
||||
|
||||
#ifndef _SPARC_BTFIXUP_H
|
||||
#define _SPARC_BTFIXUP_H
|
||||
|
||||
#include <linux/init.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#ifdef MODULE
|
||||
extern unsigned int ___illegal_use_of_BTFIXUP_SIMM13_in_module(void);
|
||||
extern unsigned int ___illegal_use_of_BTFIXUP_SETHI_in_module(void);
|
||||
extern unsigned int ___illegal_use_of_BTFIXUP_HALF_in_module(void);
|
||||
extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void);
|
||||
|
||||
#define BTFIXUP_SIMM13(__name) ___illegal_use_of_BTFIXUP_SIMM13_in_module()
|
||||
#define BTFIXUP_HALF(__name) ___illegal_use_of_BTFIXUP_HALF_in_module()
|
||||
#define BTFIXUP_SETHI(__name) ___illegal_use_of_BTFIXUP_SETHI_in_module()
|
||||
#define BTFIXUP_INT(__name) ___illegal_use_of_BTFIXUP_INT_in_module()
|
||||
#define BTFIXUP_BLACKBOX(__name) ___illegal_use_of_BTFIXUP_BLACKBOX_in_module
|
||||
|
||||
#else
|
||||
|
||||
#define BTFIXUP_SIMM13(__name) ___sf_##__name()
|
||||
#define BTFIXUP_HALF(__name) ___af_##__name()
|
||||
#define BTFIXUP_SETHI(__name) ___hf_##__name()
|
||||
#define BTFIXUP_INT(__name) ((unsigned int)&___i_##__name)
|
||||
/* This must be written in assembly and present in a sethi */
|
||||
#define BTFIXUP_BLACKBOX(__name) ___b_##__name
|
||||
#endif /* MODULE */
|
||||
|
||||
/* Fixup call xx */
|
||||
|
||||
#define BTFIXUPDEF_CALL(__type, __name, __args...) \
|
||||
extern __type ___f_##__name(__args); \
|
||||
extern unsigned ___fs_##__name[3];
|
||||
#define BTFIXUPDEF_CALL_CONST(__type, __name, __args...) \
|
||||
extern __type ___f_##__name(__args) __attribute_const__; \
|
||||
extern unsigned ___fs_##__name[3];
|
||||
#define BTFIXUP_CALL(__name) ___f_##__name
|
||||
|
||||
#define BTFIXUPDEF_BLACKBOX(__name) \
|
||||
extern unsigned ___bs_##__name[2];
|
||||
|
||||
/* Put bottom 13bits into some register variable */
|
||||
|
||||
#define BTFIXUPDEF_SIMM13(__name) \
|
||||
static inline unsigned int ___sf_##__name(void) __attribute_const__; \
|
||||
extern unsigned ___ss_##__name[2]; \
|
||||
static inline unsigned int ___sf_##__name(void) { \
|
||||
unsigned int ret; \
|
||||
__asm__ ("or %%g0, ___s_" #__name ", %0" : "=r"(ret)); \
|
||||
return ret; \
|
||||
}
|
||||
#define BTFIXUPDEF_SIMM13_INIT(__name,__val) \
|
||||
static inline unsigned int ___sf_##__name(void) __attribute_const__; \
|
||||
extern unsigned ___ss_##__name[2]; \
|
||||
static inline unsigned int ___sf_##__name(void) { \
|
||||
unsigned int ret; \
|
||||
__asm__ ("or %%g0, ___s_" #__name "__btset_" #__val ", %0" : "=r"(ret));\
|
||||
return ret; \
|
||||
}
|
||||
|
||||
/* Put either bottom 13 bits, or upper 22 bits into some register variable
|
||||
* (depending on the value, this will lead into sethi FIX, reg; or
|
||||
* mov FIX, reg; )
|
||||
*/
|
||||
|
||||
#define BTFIXUPDEF_HALF(__name) \
|
||||
static inline unsigned int ___af_##__name(void) __attribute_const__; \
|
||||
extern unsigned ___as_##__name[2]; \
|
||||
static inline unsigned int ___af_##__name(void) { \
|
||||
unsigned int ret; \
|
||||
__asm__ ("or %%g0, ___a_" #__name ", %0" : "=r"(ret)); \
|
||||
return ret; \
|
||||
}
|
||||
#define BTFIXUPDEF_HALF_INIT(__name,__val) \
|
||||
static inline unsigned int ___af_##__name(void) __attribute_const__; \
|
||||
extern unsigned ___as_##__name[2]; \
|
||||
static inline unsigned int ___af_##__name(void) { \
|
||||
unsigned int ret; \
|
||||
__asm__ ("or %%g0, ___a_" #__name "__btset_" #__val ", %0" : "=r"(ret));\
|
||||
return ret; \
|
||||
}
|
||||
|
||||
/* Put upper 22 bits into some register variable */
|
||||
|
||||
#define BTFIXUPDEF_SETHI(__name) \
|
||||
static inline unsigned int ___hf_##__name(void) __attribute_const__; \
|
||||
extern unsigned ___hs_##__name[2]; \
|
||||
static inline unsigned int ___hf_##__name(void) { \
|
||||
unsigned int ret; \
|
||||
__asm__ ("sethi %%hi(___h_" #__name "), %0" : "=r"(ret)); \
|
||||
return ret; \
|
||||
}
|
||||
#define BTFIXUPDEF_SETHI_INIT(__name,__val) \
|
||||
static inline unsigned int ___hf_##__name(void) __attribute_const__; \
|
||||
extern unsigned ___hs_##__name[2]; \
|
||||
static inline unsigned int ___hf_##__name(void) { \
|
||||
unsigned int ret; \
|
||||
__asm__ ("sethi %%hi(___h_" #__name "__btset_" #__val "), %0" : \
|
||||
"=r"(ret)); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
/* Put a full 32bit integer into some register variable */
|
||||
|
||||
#define BTFIXUPDEF_INT(__name) \
|
||||
extern unsigned char ___i_##__name; \
|
||||
extern unsigned ___is_##__name[2];
|
||||
|
||||
#define BTFIXUPCALL_NORM 0x00000000 /* Always call */
|
||||
#define BTFIXUPCALL_NOP 0x01000000 /* Possibly optimize to nop */
|
||||
#define BTFIXUPCALL_RETINT(i) (0x90102000|((i) & 0x1fff)) /* Possibly optimize to mov i, %o0 */
|
||||
#define BTFIXUPCALL_ORINT(i) (0x90122000|((i) & 0x1fff)) /* Possibly optimize to or %o0, i, %o0 */
|
||||
#define BTFIXUPCALL_RETO0 0x01000000 /* Return first parameter, actually a nop */
|
||||
#define BTFIXUPCALL_ANDNINT(i) (0x902a2000|((i) & 0x1fff)) /* Possibly optimize to andn %o0, i, %o0 */
|
||||
#define BTFIXUPCALL_SWAPO0O1 0xd27a0000 /* Possibly optimize to swap [%o0],%o1 */
|
||||
#define BTFIXUPCALL_SWAPO0G0 0xc07a0000 /* Possibly optimize to swap [%o0],%g0 */
|
||||
#define BTFIXUPCALL_SWAPG1G2 0xc4784000 /* Possibly optimize to swap [%g1],%g2 */
|
||||
#define BTFIXUPCALL_STG0O0 0xc0220000 /* Possibly optimize to st %g0,[%o0] */
|
||||
#define BTFIXUPCALL_STO1O0 0xd2220000 /* Possibly optimize to st %o1,[%o0] */
|
||||
|
||||
#define BTFIXUPSET_CALL(__name, __addr, __insn) \
|
||||
do { \
|
||||
___fs_##__name[0] |= 1; \
|
||||
___fs_##__name[1] = (unsigned long)__addr; \
|
||||
___fs_##__name[2] = __insn; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPSET_BLACKBOX(__name, __func) \
|
||||
do { \
|
||||
___bs_##__name[0] |= 1; \
|
||||
___bs_##__name[1] = (unsigned long)__func; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPCOPY_CALL(__name, __from) \
|
||||
do { \
|
||||
___fs_##__name[0] |= 1; \
|
||||
___fs_##__name[1] = ___fs_##__from[1]; \
|
||||
___fs_##__name[2] = ___fs_##__from[2]; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPSET_SIMM13(__name, __val) \
|
||||
do { \
|
||||
___ss_##__name[0] |= 1; \
|
||||
___ss_##__name[1] = (unsigned)__val; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPCOPY_SIMM13(__name, __from) \
|
||||
do { \
|
||||
___ss_##__name[0] |= 1; \
|
||||
___ss_##__name[1] = ___ss_##__from[1]; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPSET_HALF(__name, __val) \
|
||||
do { \
|
||||
___as_##__name[0] |= 1; \
|
||||
___as_##__name[1] = (unsigned)__val; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPCOPY_HALF(__name, __from) \
|
||||
do { \
|
||||
___as_##__name[0] |= 1; \
|
||||
___as_##__name[1] = ___as_##__from[1]; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPSET_SETHI(__name, __val) \
|
||||
do { \
|
||||
___hs_##__name[0] |= 1; \
|
||||
___hs_##__name[1] = (unsigned)__val; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPCOPY_SETHI(__name, __from) \
|
||||
do { \
|
||||
___hs_##__name[0] |= 1; \
|
||||
___hs_##__name[1] = ___hs_##__from[1]; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPSET_INT(__name, __val) \
|
||||
do { \
|
||||
___is_##__name[0] |= 1; \
|
||||
___is_##__name[1] = (unsigned)__val; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPCOPY_INT(__name, __from) \
|
||||
do { \
|
||||
___is_##__name[0] |= 1; \
|
||||
___is_##__name[1] = ___is_##__from[1]; \
|
||||
} while (0)
|
||||
|
||||
#define BTFIXUPVAL_CALL(__name) \
|
||||
((unsigned long)___fs_##__name[1])
|
||||
|
||||
extern void btfixup(void);
|
||||
|
||||
#else /* __ASSEMBLY__ */
|
||||
|
||||
#define BTFIXUP_SETHI(__name) %hi(___h_ ## __name)
|
||||
#define BTFIXUP_SETHI_INIT(__name,__val) %hi(___h_ ## __name ## __btset_ ## __val)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* !(_SPARC_BTFIXUP_H) */
|
||||
@@ -22,118 +22,4 @@
|
||||
|
||||
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
|
||||
|
||||
#ifdef CONFIG_SPARC32
|
||||
#include <asm/asi.h>
|
||||
|
||||
/* Direct access to the instruction cache is provided through and
|
||||
* alternate address space. The IDC bit must be off in the ICCR on
|
||||
* HyperSparcs for these accesses to work. The code below does not do
|
||||
* any checking, the caller must do so. These routines are for
|
||||
* diagnostics only, but could end up being useful. Use with care.
|
||||
* Also, you are asking for trouble if you execute these in one of the
|
||||
* three instructions following a %asr/%psr access or modification.
|
||||
*/
|
||||
|
||||
/* First, cache-tag access. */
|
||||
static inline unsigned int get_icache_tag(int setnum, int tagnum)
|
||||
{
|
||||
unsigned int vaddr, retval;
|
||||
|
||||
vaddr = ((setnum&1) << 12) | ((tagnum&0x7f) << 5);
|
||||
__asm__ __volatile__("lda [%1] %2, %0\n\t" :
|
||||
"=r" (retval) :
|
||||
"r" (vaddr), "i" (ASI_M_TXTC_TAG));
|
||||
return retval;
|
||||
}
|
||||
|
||||
static inline void put_icache_tag(int setnum, int tagnum, unsigned int entry)
|
||||
{
|
||||
unsigned int vaddr;
|
||||
|
||||
vaddr = ((setnum&1) << 12) | ((tagnum&0x7f) << 5);
|
||||
__asm__ __volatile__("sta %0, [%1] %2\n\t" : :
|
||||
"r" (entry), "r" (vaddr), "i" (ASI_M_TXTC_TAG) :
|
||||
"memory");
|
||||
}
|
||||
|
||||
/* Second cache-data access. The data is returned two-32bit quantities
|
||||
* at a time.
|
||||
*/
|
||||
static inline void get_icache_data(int setnum, int tagnum, int subblock,
|
||||
unsigned int *data)
|
||||
{
|
||||
unsigned int value1, value2, vaddr;
|
||||
|
||||
vaddr = ((setnum&0x1) << 12) | ((tagnum&0x7f) << 5) |
|
||||
((subblock&0x3) << 3);
|
||||
__asm__ __volatile__("ldda [%2] %3, %%g2\n\t"
|
||||
"or %%g0, %%g2, %0\n\t"
|
||||
"or %%g0, %%g3, %1\n\t" :
|
||||
"=r" (value1), "=r" (value2) :
|
||||
"r" (vaddr), "i" (ASI_M_TXTC_DATA) :
|
||||
"g2", "g3");
|
||||
data[0] = value1; data[1] = value2;
|
||||
}
|
||||
|
||||
static inline void put_icache_data(int setnum, int tagnum, int subblock,
|
||||
unsigned int *data)
|
||||
{
|
||||
unsigned int value1, value2, vaddr;
|
||||
|
||||
vaddr = ((setnum&0x1) << 12) | ((tagnum&0x7f) << 5) |
|
||||
((subblock&0x3) << 3);
|
||||
value1 = data[0]; value2 = data[1];
|
||||
__asm__ __volatile__("or %%g0, %0, %%g2\n\t"
|
||||
"or %%g0, %1, %%g3\n\t"
|
||||
"stda %%g2, [%2] %3\n\t" : :
|
||||
"r" (value1), "r" (value2),
|
||||
"r" (vaddr), "i" (ASI_M_TXTC_DATA) :
|
||||
"g2", "g3", "memory" /* no joke */);
|
||||
}
|
||||
|
||||
/* Different types of flushes with the ICACHE. Some of the flushes
|
||||
* affect both the ICACHE and the external cache. Others only clear
|
||||
* the ICACHE entries on the cpu itself. V8's (most) allow
|
||||
* granularity of flushes on the packet (element in line), whole line,
|
||||
* and entire cache (ie. all lines) level. The ICACHE only flushes are
|
||||
* ROSS HyperSparc specific and are in ross.h
|
||||
*/
|
||||
|
||||
/* Flushes which clear out both the on-chip and external caches */
|
||||
static inline void flush_ei_page(unsigned int addr)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (addr), "i" (ASI_M_FLUSH_PAGE) :
|
||||
"memory");
|
||||
}
|
||||
|
||||
static inline void flush_ei_seg(unsigned int addr)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (addr), "i" (ASI_M_FLUSH_SEG) :
|
||||
"memory");
|
||||
}
|
||||
|
||||
static inline void flush_ei_region(unsigned int addr)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (addr), "i" (ASI_M_FLUSH_REGION) :
|
||||
"memory");
|
||||
}
|
||||
|
||||
static inline void flush_ei_ctx(unsigned int addr)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (addr), "i" (ASI_M_FLUSH_CTX) :
|
||||
"memory");
|
||||
}
|
||||
|
||||
static inline void flush_ei_user(unsigned int addr)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (addr), "i" (ASI_M_FLUSH_USER) :
|
||||
"memory");
|
||||
}
|
||||
#endif /* CONFIG_SPARC32 */
|
||||
|
||||
#endif /* !(_SPARC_CACHE_H) */
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#ifndef ___ASM_SPARC_CACHEFLUSH_H
|
||||
#define ___ASM_SPARC_CACHEFLUSH_H
|
||||
|
||||
/* flush addr - to allow use of self-modifying code */
|
||||
#define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
|
||||
|
||||
#if defined(__sparc__) && defined(__arch64__)
|
||||
#include <asm/cacheflush_64.h>
|
||||
#else
|
||||
|
||||
@@ -1,56 +1,18 @@
|
||||
#ifndef _SPARC_CACHEFLUSH_H
|
||||
#define _SPARC_CACHEFLUSH_H
|
||||
|
||||
#include <linux/mm.h> /* Common for other includes */
|
||||
// #include <linux/kernel.h> from pgalloc.h
|
||||
// #include <linux/sched.h> from pgalloc.h
|
||||
#include <asm/cachetlb_32.h>
|
||||
|
||||
// #include <asm/page.h>
|
||||
#include <asm/btfixup.h>
|
||||
|
||||
/*
|
||||
* Fine grained cache flushing.
|
||||
*/
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
BTFIXUPDEF_CALL(void, local_flush_cache_all, void)
|
||||
BTFIXUPDEF_CALL(void, local_flush_cache_mm, struct mm_struct *)
|
||||
BTFIXUPDEF_CALL(void, local_flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long)
|
||||
BTFIXUPDEF_CALL(void, local_flush_cache_page, struct vm_area_struct *, unsigned long)
|
||||
|
||||
#define local_flush_cache_all() BTFIXUP_CALL(local_flush_cache_all)()
|
||||
#define local_flush_cache_mm(mm) BTFIXUP_CALL(local_flush_cache_mm)(mm)
|
||||
#define local_flush_cache_range(vma,start,end) BTFIXUP_CALL(local_flush_cache_range)(vma,start,end)
|
||||
#define local_flush_cache_page(vma,addr) BTFIXUP_CALL(local_flush_cache_page)(vma,addr)
|
||||
|
||||
BTFIXUPDEF_CALL(void, local_flush_page_to_ram, unsigned long)
|
||||
BTFIXUPDEF_CALL(void, local_flush_sig_insns, struct mm_struct *, unsigned long)
|
||||
|
||||
#define local_flush_page_to_ram(addr) BTFIXUP_CALL(local_flush_page_to_ram)(addr)
|
||||
#define local_flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(local_flush_sig_insns)(mm,insn_addr)
|
||||
|
||||
extern void smp_flush_cache_all(void);
|
||||
extern void smp_flush_cache_mm(struct mm_struct *mm);
|
||||
extern void smp_flush_cache_range(struct vm_area_struct *vma,
|
||||
unsigned long start,
|
||||
unsigned long end);
|
||||
extern void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page);
|
||||
|
||||
extern void smp_flush_page_to_ram(unsigned long page);
|
||||
extern void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr);
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
BTFIXUPDEF_CALL(void, flush_cache_all, void)
|
||||
BTFIXUPDEF_CALL(void, flush_cache_mm, struct mm_struct *)
|
||||
BTFIXUPDEF_CALL(void, flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long)
|
||||
BTFIXUPDEF_CALL(void, flush_cache_page, struct vm_area_struct *, unsigned long)
|
||||
|
||||
#define flush_cache_all() BTFIXUP_CALL(flush_cache_all)()
|
||||
#define flush_cache_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm)
|
||||
#define flush_cache_dup_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm)
|
||||
#define flush_cache_range(vma,start,end) BTFIXUP_CALL(flush_cache_range)(vma,start,end)
|
||||
#define flush_cache_page(vma,addr,pfn) BTFIXUP_CALL(flush_cache_page)(vma,addr)
|
||||
#define flush_cache_all() \
|
||||
sparc32_cachetlb_ops->cache_all()
|
||||
#define flush_cache_mm(mm) \
|
||||
sparc32_cachetlb_ops->cache_mm(mm)
|
||||
#define flush_cache_dup_mm(mm) \
|
||||
sparc32_cachetlb_ops->cache_mm(mm)
|
||||
#define flush_cache_range(vma,start,end) \
|
||||
sparc32_cachetlb_ops->cache_range(vma, start, end)
|
||||
#define flush_cache_page(vma,addr,pfn) \
|
||||
sparc32_cachetlb_ops->cache_page(vma, addr)
|
||||
#define flush_icache_range(start, end) do { } while (0)
|
||||
#define flush_icache_page(vma, pg) do { } while (0)
|
||||
|
||||
@@ -67,11 +29,12 @@ BTFIXUPDEF_CALL(void, flush_cache_page, struct vm_area_struct *, unsigned long)
|
||||
memcpy(dst, src, len); \
|
||||
} while (0)
|
||||
|
||||
BTFIXUPDEF_CALL(void, __flush_page_to_ram, unsigned long)
|
||||
BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long)
|
||||
|
||||
#define __flush_page_to_ram(addr) BTFIXUP_CALL(__flush_page_to_ram)(addr)
|
||||
#define flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(flush_sig_insns)(mm,insn_addr)
|
||||
#define __flush_page_to_ram(addr) \
|
||||
sparc32_cachetlb_ops->page_to_ram(addr)
|
||||
#define flush_sig_insns(mm,insn_addr) \
|
||||
sparc32_cachetlb_ops->sig_insns(mm, insn_addr)
|
||||
#define flush_page_for_dma(addr) \
|
||||
sparc32_cachetlb_ops->page_for_dma(addr)
|
||||
|
||||
extern void sparc_flush_page_to_ram(struct page *page);
|
||||
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
#include <linux/mm.h>
|
||||
|
||||
/* Cache flush operations. */
|
||||
|
||||
|
||||
#define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
|
||||
#define flushw_all() __asm__ __volatile__("flushw")
|
||||
|
||||
extern void __flushw_user(void);
|
||||
|
||||
29
arch/sparc/include/asm/cachetlb_32.h
Normal file
29
arch/sparc/include/asm/cachetlb_32.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef _SPARC_CACHETLB_H
|
||||
#define _SPARC_CACHETLB_H
|
||||
|
||||
struct mm_struct;
|
||||
struct vm_area_struct;
|
||||
|
||||
struct sparc32_cachetlb_ops {
|
||||
void (*cache_all)(void);
|
||||
void (*cache_mm)(struct mm_struct *);
|
||||
void (*cache_range)(struct vm_area_struct *, unsigned long,
|
||||
unsigned long);
|
||||
void (*cache_page)(struct vm_area_struct *, unsigned long);
|
||||
|
||||
void (*tlb_all)(void);
|
||||
void (*tlb_mm)(struct mm_struct *);
|
||||
void (*tlb_range)(struct vm_area_struct *, unsigned long,
|
||||
unsigned long);
|
||||
void (*tlb_page)(struct vm_area_struct *, unsigned long);
|
||||
|
||||
void (*page_to_ram)(unsigned long);
|
||||
void (*sig_insns)(struct mm_struct *, unsigned long);
|
||||
void (*page_for_dma)(unsigned long);
|
||||
};
|
||||
extern const struct sparc32_cachetlb_ops *sparc32_cachetlb_ops;
|
||||
#ifdef CONFIG_SMP
|
||||
extern const struct sparc32_cachetlb_ops *local_ops;
|
||||
#endif
|
||||
|
||||
#endif /* SPARC_CACHETLB_H */
|
||||
@@ -11,40 +11,13 @@
|
||||
#ifndef __ARCH_SPARC_CMPXCHG__
|
||||
#define __ARCH_SPARC_CMPXCHG__
|
||||
|
||||
#include <asm/btfixup.h>
|
||||
|
||||
/* This has special calling conventions */
|
||||
#ifndef CONFIG_SMP
|
||||
BTFIXUPDEF_CALL(void, ___xchg32, void)
|
||||
#endif
|
||||
|
||||
static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
__asm__ __volatile__("swap [%2], %0"
|
||||
: "=&r" (val)
|
||||
: "0" (val), "r" (m)
|
||||
: "memory");
|
||||
return val;
|
||||
#else
|
||||
register unsigned long *ptr asm("g1");
|
||||
register unsigned long ret asm("g2");
|
||||
|
||||
ptr = (unsigned long *) m;
|
||||
ret = val;
|
||||
|
||||
/* Note: this is magic and the nop there is
|
||||
really needed. */
|
||||
__asm__ __volatile__(
|
||||
"mov %%o7, %%g4\n\t"
|
||||
"call ___f____xchg32\n\t"
|
||||
" nop\n\t"
|
||||
: "=&r" (ret)
|
||||
: "0" (ret), "r" (ptr)
|
||||
: "g3", "g4", "g7", "memory", "cc");
|
||||
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
extern void __xchg_called_with_bad_pointer(void);
|
||||
|
||||
@@ -7,28 +7,6 @@
|
||||
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
|
||||
*/
|
||||
|
||||
/* 3=sun3
|
||||
4=sun4 (as in sun4 sysmaint student book)
|
||||
c=sun4c (according to davem) */
|
||||
|
||||
#define AC_IDPROM 0x00000000 /* 34 ID PROM, R/O, byte, 32 bytes */
|
||||
#define AC_PAGEMAP 0x10000000 /* 3 Pagemap R/W, long */
|
||||
#define AC_SEGMAP 0x20000000 /* 3 Segment map, byte */
|
||||
#define AC_CONTEXT 0x30000000 /* 34c current mmu-context */
|
||||
#define AC_SENABLE 0x40000000 /* 34c system dvma/cache/reset enable reg*/
|
||||
#define AC_UDVMA_ENB 0x50000000 /* 34 Not used on Sun boards, byte */
|
||||
#define AC_BUS_ERROR 0x60000000 /* 34 Not cleared on read, byte. */
|
||||
#define AC_SYNC_ERR 0x60000000 /* c fault type */
|
||||
#define AC_SYNC_VA 0x60000004 /* c fault virtual address */
|
||||
#define AC_ASYNC_ERR 0x60000008 /* c asynchronous fault type */
|
||||
#define AC_ASYNC_VA 0x6000000c /* c async fault virtual address */
|
||||
#define AC_LEDS 0x70000000 /* 34 Zero turns on LEDs, byte */
|
||||
#define AC_CACHETAGS 0x80000000 /* 34c direct access to the VAC tags */
|
||||
#define AC_CACHEDDATA 0x90000000 /* 3 c direct access to the VAC data */
|
||||
#define AC_UDVMA_MAP 0xD0000000 /* 4 Not used on Sun boards, byte */
|
||||
#define AC_VME_VECTOR 0xE0000000 /* 4 For non-Autovector VME, byte */
|
||||
#define AC_BOOT_SCC 0xF0000000 /* 34 bypass to access Zilog 8530. byte.*/
|
||||
|
||||
/* s=Swift, h=Ross_HyperSPARC, v=TI_Viking, t=Tsunami, r=Ross_Cypress */
|
||||
#define AC_M_PCR 0x0000 /* shv Processor Control Reg */
|
||||
#define AC_M_CTPR 0x0100 /* shv Context Table Pointer Reg */
|
||||
|
||||
@@ -5,30 +5,24 @@
|
||||
* Sparc (general) CPU types
|
||||
*/
|
||||
enum sparc_cpu {
|
||||
sun4 = 0x00,
|
||||
sun4c = 0x01,
|
||||
sun4m = 0x02,
|
||||
sun4d = 0x03,
|
||||
sun4e = 0x04,
|
||||
sun4u = 0x05, /* V8 ploos ploos */
|
||||
sun_unknown = 0x06,
|
||||
ap1000 = 0x07, /* almost a sun4m */
|
||||
sparc_leon = 0x08, /* Leon SoC */
|
||||
sun4m = 0x00,
|
||||
sun4d = 0x01,
|
||||
sun4e = 0x02,
|
||||
sun4u = 0x03, /* V8 ploos ploos */
|
||||
sun_unknown = 0x04,
|
||||
ap1000 = 0x05, /* almost a sun4m */
|
||||
sparc_leon = 0x06, /* Leon SoC */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SPARC32
|
||||
extern enum sparc_cpu sparc_cpu_model;
|
||||
|
||||
#define ARCH_SUN4C (sparc_cpu_model==sun4c)
|
||||
|
||||
#define SUN4M_NCPUS 4 /* Architectural limit of sun4m. */
|
||||
|
||||
#else
|
||||
|
||||
#define sparc_cpu_model sun4u
|
||||
|
||||
/* This cannot ever be a sun4c :) That's just history. */
|
||||
#define ARCH_SUN4C 0
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_CPU_TYPE_H */
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
typedef struct {
|
||||
unsigned long udelay_val;
|
||||
unsigned long clock_tick;
|
||||
unsigned int multiplier;
|
||||
unsigned int counter;
|
||||
#ifdef CONFIG_SMP
|
||||
unsigned int irq_resched_count;
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* cypress.h: Cypress module specific definitions and defines.
|
||||
*
|
||||
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
|
||||
*/
|
||||
|
||||
#ifndef _SPARC_CYPRESS_H
|
||||
#define _SPARC_CYPRESS_H
|
||||
|
||||
/* Cypress chips have %psr 'impl' of '0001' and 'vers' of '0001'. */
|
||||
|
||||
/* The MMU control register fields on the Sparc Cypress 604/605 MMU's.
|
||||
*
|
||||
* ---------------------------------------------------------------
|
||||
* |implvers| MCA | MCM |MV| MID |BM| C|RSV|MR|CM|CL|CE|RSV|NF|ME|
|
||||
* ---------------------------------------------------------------
|
||||
* 31 24 23-22 21-20 19 18-15 14 13 12 11 10 9 8 7-2 1 0
|
||||
*
|
||||
* MCA: MultiChip Access -- Used for configuration of multiple
|
||||
* CY7C604/605 cache units.
|
||||
* MCM: MultiChip Mask -- Again, for multiple cache unit config.
|
||||
* MV: MultiChip Valid -- Indicates MCM and MCA have valid settings.
|
||||
* MID: ModuleID -- Unique processor ID for MBus transactions. (605 only)
|
||||
* BM: Boot Mode -- 0 = not in boot mode, 1 = in boot mode
|
||||
* C: Cacheable -- Indicates whether accesses are cacheable while
|
||||
* the MMU is off. 0=no 1=yes
|
||||
* MR: MemoryReflection -- Indicates whether the bus attached to the
|
||||
* MBus supports memory reflection. 0=no 1=yes (605 only)
|
||||
* CM: CacheMode -- Indicates whether the cache is operating in write
|
||||
* through or copy-back mode. 0=write-through 1=copy-back
|
||||
* CL: CacheLock -- Indicates if the entire cache is locked or not.
|
||||
* 0=not-locked 1=locked (604 only)
|
||||
* CE: CacheEnable -- Is the virtual cache on? 0=no 1=yes
|
||||
* NF: NoFault -- Do faults generate traps? 0=yes 1=no
|
||||
* ME: MmuEnable -- Is the MMU doing translations? 0=no 1=yes
|
||||
*/
|
||||
|
||||
#define CYPRESS_MCA 0x00c00000
|
||||
#define CYPRESS_MCM 0x00300000
|
||||
#define CYPRESS_MVALID 0x00080000
|
||||
#define CYPRESS_MIDMASK 0x00078000 /* Only on 605 */
|
||||
#define CYPRESS_BMODE 0x00004000
|
||||
#define CYPRESS_ACENABLE 0x00002000
|
||||
#define CYPRESS_MRFLCT 0x00000800 /* Only on 605 */
|
||||
#define CYPRESS_CMODE 0x00000400
|
||||
#define CYPRESS_CLOCK 0x00000200 /* Only on 604 */
|
||||
#define CYPRESS_CENABLE 0x00000100
|
||||
#define CYPRESS_NFAULT 0x00000002
|
||||
#define CYPRESS_MENABLE 0x00000001
|
||||
|
||||
static inline void cypress_flush_page(unsigned long page)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (page), "i" (ASI_M_FLUSH_PAGE));
|
||||
}
|
||||
|
||||
static inline void cypress_flush_segment(unsigned long addr)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (addr), "i" (ASI_M_FLUSH_SEG));
|
||||
}
|
||||
|
||||
static inline void cypress_flush_region(unsigned long addr)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
|
||||
"r" (addr), "i" (ASI_M_FLUSH_REGION));
|
||||
}
|
||||
|
||||
static inline void cypress_flush_context(void)
|
||||
{
|
||||
__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
|
||||
"i" (ASI_M_FLUSH_CTX));
|
||||
}
|
||||
|
||||
/* XXX Displacement flushes for buggy chips and initial testing
|
||||
* XXX go here.
|
||||
*/
|
||||
|
||||
#endif /* !(_SPARC_CYPRESS_H) */
|
||||
@@ -92,27 +92,31 @@ extern int isa_dma_bridge_buggy;
|
||||
#ifdef CONFIG_SPARC32
|
||||
|
||||
/* Routines for data transfer buffers. */
|
||||
BTFIXUPDEF_CALL(char *, mmu_lockarea, char *, unsigned long)
|
||||
BTFIXUPDEF_CALL(void, mmu_unlockarea, char *, unsigned long)
|
||||
|
||||
#define mmu_lockarea(vaddr,len) BTFIXUP_CALL(mmu_lockarea)(vaddr,len)
|
||||
#define mmu_unlockarea(vaddr,len) BTFIXUP_CALL(mmu_unlockarea)(vaddr,len)
|
||||
|
||||
struct page;
|
||||
struct device;
|
||||
struct scatterlist;
|
||||
|
||||
/* These are implementations for sbus_map_sg/sbus_unmap_sg... collapse later */
|
||||
BTFIXUPDEF_CALL(__u32, mmu_get_scsi_one, struct device *, char *, unsigned long)
|
||||
BTFIXUPDEF_CALL(void, mmu_get_scsi_sgl, struct device *, struct scatterlist *, int)
|
||||
BTFIXUPDEF_CALL(void, mmu_release_scsi_one, struct device *, __u32, unsigned long)
|
||||
BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct device *, struct scatterlist *, int)
|
||||
struct sparc32_dma_ops {
|
||||
__u32 (*get_scsi_one)(struct device *, char *, unsigned long);
|
||||
void (*get_scsi_sgl)(struct device *, struct scatterlist *, int);
|
||||
void (*release_scsi_one)(struct device *, __u32, unsigned long);
|
||||
void (*release_scsi_sgl)(struct device *, struct scatterlist *,int);
|
||||
#ifdef CONFIG_SBUS
|
||||
int (*map_dma_area)(struct device *, dma_addr_t *, unsigned long, unsigned long, int);
|
||||
void (*unmap_dma_area)(struct device *, unsigned long, int);
|
||||
#endif
|
||||
};
|
||||
extern const struct sparc32_dma_ops *sparc32_dma_ops;
|
||||
|
||||
#define mmu_get_scsi_one(dev,vaddr,len) BTFIXUP_CALL(mmu_get_scsi_one)(dev,vaddr,len)
|
||||
#define mmu_get_scsi_sgl(dev,sg,sz) BTFIXUP_CALL(mmu_get_scsi_sgl)(dev,sg,sz)
|
||||
#define mmu_release_scsi_one(dev,vaddr,len) BTFIXUP_CALL(mmu_release_scsi_one)(dev,vaddr,len)
|
||||
#define mmu_release_scsi_sgl(dev,sg,sz) BTFIXUP_CALL(mmu_release_scsi_sgl)(dev,sg,sz)
|
||||
#define mmu_get_scsi_one(dev,vaddr,len) \
|
||||
sparc32_dma_ops->get_scsi_one(dev, vaddr, len)
|
||||
#define mmu_get_scsi_sgl(dev,sg,sz) \
|
||||
sparc32_dma_ops->get_scsi_sgl(dev, sg, sz)
|
||||
#define mmu_release_scsi_one(dev,vaddr,len) \
|
||||
sparc32_dma_ops->release_scsi_one(dev, vaddr,len)
|
||||
#define mmu_release_scsi_sgl(dev,sg,sz) \
|
||||
sparc32_dma_ops->release_scsi_sgl(dev, sg, sz)
|
||||
|
||||
#ifdef CONFIG_SBUS
|
||||
/*
|
||||
* mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep.
|
||||
*
|
||||
@@ -123,17 +127,17 @@ BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct device *, struct scatterlist
|
||||
* Second mapping is for device visible address, or "bus" address.
|
||||
* The bus address is returned at '*pba'.
|
||||
*
|
||||
* These functions seem distinct, but are hard to split. On sun4c,
|
||||
* at least for now, 'a' is equal to bus address, and retured in *pba.
|
||||
* These functions seem distinct, but are hard to split.
|
||||
* On sun4m, page attributes depend on the CPU type, so we have to
|
||||
* know if we are mapping RAM or I/O, so it has to be an additional argument
|
||||
* to a separate mapping function for CPU visible mappings.
|
||||
*/
|
||||
BTFIXUPDEF_CALL(int, mmu_map_dma_area, struct device *, dma_addr_t *, unsigned long, unsigned long, int len)
|
||||
BTFIXUPDEF_CALL(void, mmu_unmap_dma_area, struct device *, unsigned long busa, int len)
|
||||
#define sbus_map_dma_area(dev,pba,va,a,len) \
|
||||
sparc32_dma_ops->map_dma_area(dev, pba, va, a, len)
|
||||
#define sbus_unmap_dma_area(dev,ba,len) \
|
||||
sparc32_dma_ops->unmap_dma_area(dev, ba, len)
|
||||
#endif /* CONFIG_SBUS */
|
||||
|
||||
#define mmu_map_dma_area(dev,pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(dev,pba,va,a,len)
|
||||
#define mmu_unmap_dma_area(dev,ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(dev,ba,len)
|
||||
#endif
|
||||
|
||||
#endif /* !(_ASM_SPARC_DMA_H) */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user