MFH
Sponsored by: The FreeBSD Foundation
This commit is contained in:
commit
8bfb527a82
@ -25,7 +25,18 @@ test: ${PROG} gen
|
||||
LC_ALL=en_US.US-ASCII hexdump -C | \
|
||||
diff -I FreeBSD - ${.CURDIR}/ref.${conv}
|
||||
.endfor
|
||||
@rm -f gen
|
||||
@${ECHO} "testing sparse file (obs zeroes)"
|
||||
@./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null
|
||||
@hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes
|
||||
|
||||
@${ECHO} "testing spase file (all zeroes)"
|
||||
@./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null
|
||||
@./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null
|
||||
@./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null
|
||||
@diff 1M_zeroes 1M_zeroes.1
|
||||
@diff 1M_zeroes 1M_zeroes.2
|
||||
|
||||
@rm -f gen 1M_zeroes* obs_zeroes
|
||||
|
||||
.if ${MK_TESTS} != "no"
|
||||
SUBDIR+= tests
|
||||
|
@ -422,11 +422,10 @@ get_num(const char *val)
|
||||
|
||||
errno = 0;
|
||||
num = strtoumax(val, &expr, 0);
|
||||
if (errno != 0) /* Overflow or underflow. */
|
||||
err(1, "%s", oper);
|
||||
|
||||
if (expr == val) /* No valid digits. */
|
||||
errx(1, "%s: illegal numeric value", oper);
|
||||
errx(1, "%s: invalid numeric value", oper);
|
||||
if (errno != 0)
|
||||
err(1, "%s", oper);
|
||||
|
||||
mult = postfix_to_mult(*expr);
|
||||
|
||||
@ -472,11 +471,10 @@ get_off_t(const char *val)
|
||||
|
||||
errno = 0;
|
||||
num = strtoimax(val, &expr, 0);
|
||||
if (errno != 0) /* Overflow or underflow. */
|
||||
err(1, "%s", oper);
|
||||
|
||||
if (expr == val) /* No valid digits. */
|
||||
errx(1, "%s: illegal numeric value", oper);
|
||||
errx(1, "%s: invalid numeric value", oper);
|
||||
if (errno != 0)
|
||||
err(1, "%s", oper);
|
||||
|
||||
mult = postfix_to_mult(*expr);
|
||||
|
||||
|
36
bin/dd/dd.c
36
bin/dd/dd.c
@ -77,7 +77,6 @@ STAT st; /* statistics */
|
||||
void (*cfunc)(void); /* conversion function */
|
||||
uintmax_t cpy_cnt; /* # of blocks to copy */
|
||||
static off_t pending = 0; /* pending seek if sparse */
|
||||
static off_t last_sp = 0; /* size of last added sparse block */
|
||||
u_int ddflags = 0; /* conversion options */
|
||||
size_t cbsz; /* conversion block size */
|
||||
uintmax_t files_cnt = 1; /* # of files to copy */
|
||||
@ -409,6 +408,15 @@ dd_close(void)
|
||||
}
|
||||
if (out.dbcnt || pending)
|
||||
dd_out(1);
|
||||
|
||||
/*
|
||||
* If the file ends with a hole, ftruncate it to extend its size
|
||||
* up to the end of the hole (without having to write any data).
|
||||
*/
|
||||
if (out.seek_offset > 0 && (out.flags & ISTRUNC)) {
|
||||
if (ftruncate(out.fd, out.seek_offset) == -1)
|
||||
err(1, "truncating %s", out.name);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -457,29 +465,27 @@ dd_out(int force)
|
||||
}
|
||||
if (sparse && !force) {
|
||||
pending += cnt;
|
||||
last_sp = cnt;
|
||||
nw = cnt;
|
||||
} else {
|
||||
if (pending != 0) {
|
||||
/* If forced to write, and we have no
|
||||
* data left, we need to write the last
|
||||
* sparse block explicitly.
|
||||
/*
|
||||
* Seek past hole. Note that we need to record the
|
||||
* reached offset, because we might have no more data
|
||||
* to write, in which case we'll need to call
|
||||
* ftruncate to extend the file size.
|
||||
*/
|
||||
if (force && cnt == 0) {
|
||||
pending -= last_sp;
|
||||
assert(outp == out.db);
|
||||
memset(outp, 0, cnt);
|
||||
}
|
||||
if (lseek(out.fd, pending, SEEK_CUR) ==
|
||||
-1)
|
||||
out.seek_offset = lseek(out.fd, pending, SEEK_CUR);
|
||||
if (out.seek_offset == -1)
|
||||
err(2, "%s: seek error creating sparse file",
|
||||
out.name);
|
||||
pending = last_sp = 0;
|
||||
pending = 0;
|
||||
}
|
||||
if (cnt)
|
||||
if (cnt) {
|
||||
nw = write(out.fd, outp, cnt);
|
||||
else
|
||||
out.seek_offset = 0;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (nw <= 0) {
|
||||
|
@ -54,6 +54,7 @@ typedef struct {
|
||||
const char *name; /* name */
|
||||
int fd; /* file descriptor */
|
||||
off_t offset; /* # of blocks to skip */
|
||||
off_t seek_offset; /* offset of last seek past output hole */
|
||||
} IO;
|
||||
|
||||
typedef struct {
|
||||
|
13
bin/dd/gen.c
13
bin/dd/gen.c
@ -5,13 +5,20 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main(int argc __unused, char **argv __unused)
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
putchar(i);
|
||||
if (argc > 1 && !strcmp(argv[1], "189284")) {
|
||||
fputs("ABCDEFGH", stdout);
|
||||
for (i = 0; i < 8; i++)
|
||||
putchar(0);
|
||||
} else {
|
||||
for (i = 0; i < 256; i++)
|
||||
putchar(i);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
3
bin/dd/ref.obs_zeroes
Normal file
3
bin/dd/ref.obs_zeroes
Normal file
@ -0,0 +1,3 @@
|
||||
$FreeBSD$
|
||||
00000000 41 42 43 44 45 46 47 48 00 00 00 00 00 00 00 00 |ABCDEFGH........|
|
||||
00000010
|
@ -144,9 +144,11 @@ rmaliases(void)
|
||||
struct alias *
|
||||
lookupalias(const char *name, int check)
|
||||
{
|
||||
struct alias *ap = *hashalias(name);
|
||||
struct alias *ap;
|
||||
|
||||
for (; ap; ap = ap->next) {
|
||||
if (aliases == 0)
|
||||
return (NULL);
|
||||
for (ap = *hashalias(name); ap; ap = ap->next) {
|
||||
if (equal(name, ap->name)) {
|
||||
if (check && (ap->flag & ALIASINUSE))
|
||||
return (NULL);
|
||||
|
@ -195,8 +195,7 @@ preadfd(void)
|
||||
int
|
||||
preadbuffer(void)
|
||||
{
|
||||
char *p, *q;
|
||||
int more;
|
||||
char *p, *q, *r, *end;
|
||||
char savec;
|
||||
|
||||
while (parsefile->strpush) {
|
||||
@ -213,8 +212,6 @@ preadbuffer(void)
|
||||
}
|
||||
if (parsenleft == EOF_NLEFT || parsefile->buf == NULL)
|
||||
return PEOF;
|
||||
flushout(&output);
|
||||
flushout(&errout);
|
||||
|
||||
again:
|
||||
if (parselleft <= 0) {
|
||||
@ -224,34 +221,31 @@ preadbuffer(void)
|
||||
}
|
||||
}
|
||||
|
||||
q = p = parsefile->buf + (parsenextc - parsefile->buf);
|
||||
|
||||
/* delete nul characters */
|
||||
for (more = 1; more;) {
|
||||
switch (*p) {
|
||||
case '\0':
|
||||
p++; /* Skip nul */
|
||||
goto check;
|
||||
|
||||
case '\n':
|
||||
parsenleft = q - parsenextc;
|
||||
more = 0; /* Stop processing here */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
*q++ = *p++;
|
||||
check:
|
||||
if (--parselleft <= 0) {
|
||||
parsenleft = q - parsenextc - 1;
|
||||
if (parsenleft < 0)
|
||||
goto again;
|
||||
*q = '\0';
|
||||
more = 0;
|
||||
p = parsefile->buf + (parsenextc - parsefile->buf);
|
||||
end = p + parselleft;
|
||||
*end = '\0';
|
||||
q = strchrnul(p, '\n');
|
||||
if (q != end && *q == '\0') {
|
||||
/* delete nul characters */
|
||||
for (r = q; q != end; q++) {
|
||||
if (*q != '\0')
|
||||
*r++ = *q;
|
||||
}
|
||||
parselleft -= end - r;
|
||||
if (parselleft == 0)
|
||||
goto again;
|
||||
end = p + parselleft;
|
||||
*end = '\0';
|
||||
q = strchrnul(p, '\n');
|
||||
}
|
||||
if (q == end) {
|
||||
parsenleft = parselleft;
|
||||
parselleft = 0;
|
||||
} else /* *q == '\n' */ {
|
||||
parsenleft = q - parsenextc + 1;
|
||||
parselleft -= parsenleft;
|
||||
}
|
||||
parsenleft--;
|
||||
|
||||
savec = *q;
|
||||
*q = '\0';
|
||||
|
@ -1930,6 +1930,8 @@ static void
|
||||
setprompt(int which)
|
||||
{
|
||||
whichprompt = which;
|
||||
if (which == 0)
|
||||
return;
|
||||
|
||||
#ifndef NO_HISTORY
|
||||
if (!el)
|
||||
|
@ -28,6 +28,8 @@ FILES+= alias15.0 alias15.0.stdout
|
||||
FILES+= and-pipe-not.0
|
||||
FILES+= case1.0
|
||||
FILES+= case2.0
|
||||
FILES+= comment1.0
|
||||
FILES+= comment2.42
|
||||
FILES+= dollar-quote1.0
|
||||
FILES+= dollar-quote2.0
|
||||
FILES+= dollar-quote3.0
|
||||
@ -74,6 +76,7 @@ FILES+= line-cont10.0
|
||||
FILES+= line-cont11.0
|
||||
FILES+= no-space1.0
|
||||
FILES+= no-space2.0
|
||||
FILES+= nul1.0
|
||||
FILES+= only-redir1.0
|
||||
FILES+= only-redir2.0
|
||||
FILES+= only-redir3.0
|
||||
|
3
bin/sh/tests/parser/comment1.0
Normal file
3
bin/sh/tests/parser/comment1.0
Normal file
@ -0,0 +1,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
${SH} -c '#'
|
4
bin/sh/tests/parser/comment2.42
Normal file
4
bin/sh/tests/parser/comment2.42
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
${SH} -c '#
|
||||
exit 42'
|
12
bin/sh/tests/parser/nul1.0
Normal file
12
bin/sh/tests/parser/nul1.0
Normal file
@ -0,0 +1,12 @@
|
||||
# $FreeBSD$
|
||||
# Although POSIX does not specify the effect of NUL bytes in scripts,
|
||||
# we ignore them.
|
||||
|
||||
{
|
||||
printf 'v=%03000d\0%02000d' 7 2
|
||||
dd if=/dev/zero bs=1000 count=1 status=none
|
||||
printf '1 w=%03000d%02000d1\0\n' 7 2
|
||||
printf '\0l\0v\0=\0$\0{\0#\0v\0}\n'
|
||||
printf '\0l\0w\0=\0\0$\0{\0#\0w}\0\0\0\n'
|
||||
printf '[ "$lv.$lw.$v" = "5001.5001.$w" ]\n'
|
||||
} | ${SH}
|
@ -1713,7 +1713,7 @@ zfs_do_get(int argc, char **argv)
|
||||
default:
|
||||
(void) fprintf(stderr,
|
||||
gettext("invalid column name "
|
||||
"'%s'\n"), value);
|
||||
"'%s'\n"), suboptarg);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
}
|
||||
@ -1750,7 +1750,7 @@ zfs_do_get(int argc, char **argv)
|
||||
default:
|
||||
(void) fprintf(stderr,
|
||||
gettext("invalid source "
|
||||
"'%s'\n"), value);
|
||||
"'%s'\n"), suboptarg);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
}
|
||||
@ -1786,7 +1786,7 @@ zfs_do_get(int argc, char **argv)
|
||||
default:
|
||||
(void) fprintf(stderr,
|
||||
gettext("invalid type '%s'\n"),
|
||||
value);
|
||||
suboptarg);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
}
|
||||
@ -3156,7 +3156,7 @@ zfs_do_list(int argc, char **argv)
|
||||
default:
|
||||
(void) fprintf(stderr,
|
||||
gettext("invalid type '%s'\n"),
|
||||
value);
|
||||
suboptarg);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
}
|
||||
|
@ -5431,7 +5431,7 @@ zpool_do_get(int argc, char **argv)
|
||||
default:
|
||||
(void) fprintf(stderr,
|
||||
gettext("invalid column name "
|
||||
"'%s'\n"), value);
|
||||
"'%s'\n"), suboptarg);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
}
|
||||
|
@ -59,13 +59,6 @@
|
||||
#define elf_info_to_howto 0
|
||||
#define elf_info_to_howto_rel elf32_arm_info_to_howto
|
||||
|
||||
#define ARM_ELF_ABI_VERSION 0
|
||||
#ifdef __FreeBSD__
|
||||
#define ARM_ELF_OS_ABI_VERSION ELFOSABI_FREEBSD
|
||||
#else
|
||||
#define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM
|
||||
#endif
|
||||
|
||||
static struct elf_backend_data elf32_arm_vxworks_bed;
|
||||
|
||||
/* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
|
||||
@ -9377,11 +9370,8 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
|
||||
|
||||
i_ehdrp = elf_elfheader (abfd);
|
||||
|
||||
if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_UNKNOWN)
|
||||
i_ehdrp->e_ident[EI_OSABI] = ARM_ELF_OS_ABI_VERSION;
|
||||
else
|
||||
i_ehdrp->e_ident[EI_OSABI] = 0;
|
||||
i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
|
||||
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
|
||||
i_ehdrp->e_ident[EI_ABIVERSION] = 0;
|
||||
|
||||
if (link_info)
|
||||
{
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)directory.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 6, 2015
|
||||
.Dd February 19, 2016
|
||||
.Dt DIRECTORY 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -46,7 +46,6 @@
|
||||
.Sh LIBRARY
|
||||
.Lb libc
|
||||
.Sh SYNOPSIS
|
||||
.In sys/types.h
|
||||
.In dirent.h
|
||||
.Ft DIR *
|
||||
.Fn opendir "const char *filename"
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)lseek.2 8.3 (Berkeley) 4/19/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 26, 2012
|
||||
.Dd February 18, 2016
|
||||
.Dt LSEEK 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -131,8 +131,14 @@ Applications can use
|
||||
.Dv SEEK_HOLE
|
||||
to optimise their behavior for ranges of zeros, but must not depend on it to
|
||||
find all such ranges in a file.
|
||||
Each file is presented as having a zero-size virtual hole at the very
|
||||
end of the file.
|
||||
The existence of a hole at the end of every data region allows for easy
|
||||
programming and implies that a virtual hole exists at the end of the file.
|
||||
programming and also provides compatibility to the original implementation
|
||||
in Solaris.
|
||||
It also causes the current file size (i.e., end-of-file offset) to be returned
|
||||
to indicate that there are no more holes past the supplied
|
||||
.Fa offset .
|
||||
Applications should use
|
||||
.Fn fpathconf _PC_MIN_HOLE_SIZE
|
||||
or
|
||||
@ -176,9 +182,11 @@ be negative for a non-character special file.
|
||||
For
|
||||
.Dv SEEK_DATA ,
|
||||
there are no more data regions past the supplied offset.
|
||||
For
|
||||
.Dv SEEK_HOLE ,
|
||||
there are no more holes past the supplied offset.
|
||||
Due to existence of the hole at the end of the file, for
|
||||
.Dv SEEK_HOLE
|
||||
this error is only returned when the
|
||||
.Fa offset
|
||||
already points to the end-of-file position.
|
||||
.It Bq Er EOVERFLOW
|
||||
The resulting file offset would be a value which cannot be represented
|
||||
correctly in an object of type
|
||||
|
@ -24,7 +24,7 @@ CLEANFILES+= h_nonexec
|
||||
.include "../../Makefile.netbsd-tests"
|
||||
|
||||
h_zero:
|
||||
dd if=/dev/zero of=h_zero bs=1k count=2
|
||||
dd if=/dev/zero of=h_zero bs=1k count=2 status=none
|
||||
chmod a+x h_zero
|
||||
|
||||
CLEANFILES+= h_zero
|
||||
|
@ -84,6 +84,6 @@ FILESPACKAGE= ${PACKAGE}
|
||||
|
||||
CLEANFILES= truncate_test.root_owned
|
||||
truncate_test.root_owned:
|
||||
dd if=/dev/null bs=1 count=1 of=${.TARGET}
|
||||
dd if=/dev/null bs=1 count=1 of=${.TARGET} status=none
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
@ -183,7 +183,7 @@ _arm_initvtop(kvm_t *kd)
|
||||
#define l1pte_section_p(pde) (((pde) & ARM_L1_TYPE_MASK) == ARM_L1_TYPE_S)
|
||||
#define l1pte_valid(pde) ((pde) != 0)
|
||||
#define l2pte_valid(pte) ((pte) != 0)
|
||||
#define l2pte_index(v) (((v) & ARM_L2_ADDR_BITS) >> ARM_L2_S_SHIFT)
|
||||
#define l2pte_index(v) (((v) & ARM_L1_S_OFFSET) >> ARM_L2_S_SHIFT)
|
||||
|
||||
|
||||
static int
|
||||
|
@ -29,10 +29,6 @@
|
||||
#ifndef __KVM_ARM_H__
|
||||
#define __KVM_ARM_H__
|
||||
|
||||
#ifdef __arm__
|
||||
#include <machine/pte.h>
|
||||
#endif
|
||||
|
||||
typedef uint32_t arm_physaddr_t;
|
||||
typedef uint32_t arm_pd_entry_t;
|
||||
typedef uint32_t arm_pt_entry_t;
|
||||
@ -72,11 +68,15 @@ typedef uint32_t arm_pt_entry_t;
|
||||
#define ARM_L2_TYPE_T 0x03 /* Tiny Page - 1k - not used */
|
||||
#define ARM_L2_TYPE_MASK 0x03
|
||||
|
||||
#define ARM_L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */
|
||||
|
||||
#ifdef __arm__
|
||||
#include <machine/acle-compat.h>
|
||||
|
||||
#if __ARM_ARCH >= 6
|
||||
#include <machine/pte-v6.h>
|
||||
#else
|
||||
#include <machine/pte-v4.h>
|
||||
#endif
|
||||
|
||||
_Static_assert(PAGE_SHIFT == ARM_PAGE_SHIFT, "PAGE_SHIFT mismatch");
|
||||
_Static_assert(PAGE_SIZE == ARM_PAGE_SIZE, "PAGE_SIZE mismatch");
|
||||
_Static_assert(PAGE_MASK == ARM_PAGE_MASK, "PAGE_MASK mismatch");
|
||||
@ -106,7 +106,6 @@ _Static_assert(L2_TYPE_S == ARM_L2_TYPE_S, "L2_TYPE_S mismatch");
|
||||
_Static_assert(L2_TYPE_T == ARM_L2_TYPE_T, "L2_TYPE_T mismatch");
|
||||
#endif
|
||||
_Static_assert(L2_TYPE_MASK == ARM_L2_TYPE_MASK, "L2_TYPE_MASK mismatch");
|
||||
_Static_assert(L2_ADDR_BITS == ARM_L2_ADDR_BITS, "L2_ADDR_BITS mismatch");
|
||||
#endif
|
||||
|
||||
int _arm_native(kvm_t *);
|
||||
|
@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <x86/segments.h>
|
||||
#include <machine/specialreg.h>
|
||||
#include <machine/param.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
@ -144,11 +144,12 @@ ifclonecreate(int s, void *arg)
|
||||
}
|
||||
|
||||
/*
|
||||
* If we get a different name back than we put in, print it.
|
||||
* If we get a different name back than we put in, update record and
|
||||
* indicate it should be printed later.
|
||||
*/
|
||||
if (strncmp(name, ifr.ifr_name, sizeof(name)) != 0) {
|
||||
strlcpy(name, ifr.ifr_name, sizeof(name));
|
||||
printf("%s\n", name);
|
||||
printifname = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,7 @@ int clearaddr;
|
||||
int newaddr = 1;
|
||||
int verbose;
|
||||
int noload;
|
||||
int printifname = 0;
|
||||
|
||||
int supmedia = 0;
|
||||
int printkeys = 0; /* Print keying material for interfaces. */
|
||||
@ -108,6 +109,8 @@ static struct afswtch *af_getbyname(const char *name);
|
||||
static struct afswtch *af_getbyfamily(int af);
|
||||
static void af_other_status(int);
|
||||
|
||||
void printifnamemaybe(void);
|
||||
|
||||
static struct option *opts = NULL;
|
||||
|
||||
struct ifa_order_elt {
|
||||
@ -297,6 +300,12 @@ sortifaddrs(struct ifaddrs *list,
|
||||
return (result);
|
||||
}
|
||||
|
||||
void printifnamemaybe()
|
||||
{
|
||||
if (printifname)
|
||||
printf("%s\n", name);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@ -314,6 +323,12 @@ main(int argc, char *argv[])
|
||||
size_t iflen;
|
||||
|
||||
all = downonly = uponly = namesonly = noload = verbose = 0;
|
||||
|
||||
/*
|
||||
* Ensure we print interface name when expected to,
|
||||
* even if we terminate early due to error.
|
||||
*/
|
||||
atexit(printifnamemaybe);
|
||||
|
||||
/* Parse leading line options */
|
||||
strlcpy(options, "adklmnuv", sizeof(options));
|
||||
@ -1011,6 +1026,8 @@ setifname(const char *val, int dummy __unused, int s,
|
||||
const struct afswtch *afp)
|
||||
{
|
||||
char *newname;
|
||||
|
||||
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
|
||||
|
||||
newname = strdup(val);
|
||||
if (newname == NULL)
|
||||
@ -1020,6 +1037,7 @@ setifname(const char *val, int dummy __unused, int s,
|
||||
free(newname);
|
||||
err(1, "ioctl SIOCSIFNAME (set name)");
|
||||
}
|
||||
printifname = 1;
|
||||
strlcpy(name, newname, sizeof(name));
|
||||
free(newname);
|
||||
}
|
||||
@ -1031,6 +1049,8 @@ setifdescr(const char *val, int dummy __unused, int s,
|
||||
{
|
||||
char *newdescr;
|
||||
|
||||
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
|
||||
|
||||
ifr.ifr_buffer.length = strlen(val) + 1;
|
||||
if (ifr.ifr_buffer.length == 1) {
|
||||
ifr.ifr_buffer.buffer = newdescr = NULL;
|
||||
|
@ -133,6 +133,7 @@ extern int supmedia;
|
||||
extern int printkeys;
|
||||
extern int newaddr;
|
||||
extern int verbose;
|
||||
extern int printifname;
|
||||
|
||||
void setifcap(const char *, int value, int s, const struct afswtch *);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" Copyright (c) 2006, Ceri Davies <ceri@FreeBSD.org>
|
||||
.\" Copyright (c) 2014, Luiz Otavio O Souza <loos@FreeBSD.org>
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
@ -100,8 +101,18 @@ Consumers:
|
||||
The
|
||||
.Nm
|
||||
driver was written by
|
||||
.An Maxim Sobolev Aq Mt sobomax@FreeBSD.org
|
||||
and
|
||||
.An Aleksandr Rybalko Aq Mt ray@FreeBSD.org .
|
||||
.An Max Khon Aq Mt fjoe@FreeBSD.org
|
||||
as
|
||||
.Xr geom_uzip 4 .
|
||||
.An Aleksandr Rybalko Aq Mt ray@FreeBSD.org
|
||||
copied it over as
|
||||
.Nm
|
||||
and added LZMA functionality .
|
||||
This manual page was written by
|
||||
.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org .
|
||||
.An Ceri Davies Aq Mt ceri@FreeBSD.org
|
||||
for the
|
||||
.Xr geom_uzip 4 ,
|
||||
and modified by
|
||||
.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org
|
||||
to match
|
||||
.Nm .
|
||||
|
@ -31,7 +31,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 8, 2010
|
||||
.Dd February 18, 2016
|
||||
.Dt MAILER.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -101,9 +101,10 @@ mailq /usr/libexec/sendmail/sendmail
|
||||
newaliases /usr/libexec/sendmail/sendmail
|
||||
.Ed
|
||||
.Pp
|
||||
This example shows how to invoke a sendmail-workalike like
|
||||
Using
|
||||
.Nm Postfix
|
||||
in place of
|
||||
(from ports)
|
||||
to replace
|
||||
.Xr sendmail 8 :
|
||||
.Bd -literal -offset indent
|
||||
# Emulate sendmail using postfix
|
||||
@ -113,12 +114,10 @@ mailq /usr/local/sbin/sendmail
|
||||
newaliases /usr/local/sbin/sendmail
|
||||
.Ed
|
||||
.Pp
|
||||
This example shows
|
||||
how to invoke
|
||||
a sendmail-workalike with
|
||||
Using
|
||||
.Nm Exim
|
||||
(from ports)
|
||||
in place of
|
||||
to replace
|
||||
.Xr sendmail 8 :
|
||||
.Bd -literal -offset indent
|
||||
# Emulate sendmail using exim
|
||||
@ -129,24 +128,40 @@ newaliases /usr/bin/true
|
||||
rmail /usr/local/sbin/exim -i -oee
|
||||
.Ed
|
||||
.Pp
|
||||
This example shows the use of the
|
||||
Using
|
||||
.Nm mini_sendmail
|
||||
package from ports in place of
|
||||
.Xr sendmail 8 .
|
||||
Note the use of additional arguments.
|
||||
(from ports)
|
||||
to replace
|
||||
.Xr sendmail 8 :
|
||||
.Bd -literal -offset indent
|
||||
# Send outgoing mail to a smart relay using mini_sendmail
|
||||
sendmail /usr/local/bin/mini_sendmail -srelayhost
|
||||
send-mail /usr/local/bin/mini_sendmail -srelayhost
|
||||
.Ed
|
||||
.Pp
|
||||
Using
|
||||
.Xr dma 8
|
||||
to replace
|
||||
.Xr sendmail 8 :
|
||||
.Bd -literal -offset indent
|
||||
# Execute dma instead of sendmail
|
||||
sendmail /usr/libexec/dma
|
||||
send-mail /usr/libexec/dma
|
||||
mailq /usr/libexec/dma
|
||||
newaliases /usr/libexec/dma
|
||||
rmail /usr/libexec/dma
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.Xr mail 1 ,
|
||||
.Xr mailq 1 ,
|
||||
.Xr newaliases 1 ,
|
||||
.Xr dma 8 ,
|
||||
.Xr mailwrapper 8 ,
|
||||
.Xr sendmail 8
|
||||
.Pp
|
||||
.Xr postfix 1 Pq Pa ports/mail/postfix ,
|
||||
.Xr dma 8 Pq Pa ports/mail/dma ,
|
||||
.Xr exim 8 Pq Pa ports/mail/exim ,
|
||||
.Xr mini_sendmail 8 Pq Pa ports/mail/mini_sendmail
|
||||
.Sh HISTORY
|
||||
.Nm
|
||||
|
@ -37,8 +37,6 @@
|
||||
.In sys/param.h
|
||||
.In vm/vm.h
|
||||
.In vm/pmap.h
|
||||
.In machine/param.h
|
||||
.In machine/pmap.h
|
||||
.In machine/pc/bios.h
|
||||
.Ft uint32_t
|
||||
.Fn bios_sigsearch "uint32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs"
|
||||
|
@ -81,6 +81,16 @@ tags: ${SRCS}
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# Skip reading .depend when not needed to speed up tree-walks
|
||||
# and simple lookups.
|
||||
.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
|
||||
make(install*)
|
||||
_SKIP_READ_DEPEND= 1
|
||||
.if ${MK_DIRDEPS_BUILD} == "no"
|
||||
.MAKE.DEPENDFILE= /dev/null
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if defined(SRCS)
|
||||
CLEANFILES?=
|
||||
|
||||
@ -181,7 +191,7 @@ DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
|
||||
DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
|
||||
.endif
|
||||
DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
|
||||
.if ${.MAKEFLAGS:M-V} == ""
|
||||
.if !defined(_SKIP_READ_DEPEND)
|
||||
.for __depend_obj in ${DEPENDFILES_OBJS}
|
||||
.sinclude "${__depend_obj}"
|
||||
.endfor
|
||||
|
@ -204,6 +204,7 @@ CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}}
|
||||
.if !empty(TIME_STAMP)
|
||||
TRACER= ${TIME_STAMP} ${:U}
|
||||
.endif
|
||||
WITH_META_STATS= t
|
||||
|
||||
# toolchains can be a pain - especially bootstrappping them
|
||||
.if ${MACHINE} == "host"
|
||||
|
@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/atomic.h>
|
||||
#include <machine/elf.h>
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/vmparam.h>
|
||||
#include <machine/minidump.h>
|
||||
|
||||
CTASSERT(sizeof(struct kerneldumpheader) == 512);
|
||||
|
@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <machine/frame.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#include <compat/cloudabi/cloudabi_util.h>
|
||||
|
@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_extern.h>
|
||||
|
||||
#include <machine/pmap.h>
|
||||
|
||||
#include "npt.h"
|
||||
|
||||
SYSCTL_DECL(_hw_vmm);
|
||||
|
@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <machine/cpufunc.h>
|
||||
#include <machine/psl.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/specialreg.h>
|
||||
#include <machine/smp.h>
|
||||
|
@ -53,12 +53,10 @@ __FBSDID("$FreeBSD$");
|
||||
#include <vm/vm_param.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/vm.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/smp.h>
|
||||
#include <x86/psl.h>
|
||||
#include <x86/apicreg.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#include <machine/vmm.h>
|
||||
#include <machine/vmm_dev.h>
|
||||
|
@ -8,8 +8,6 @@ makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
makeoptions KERNVIRTADDR=0xc0200000
|
||||
options KERNVIRTADDR=0xc0200000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options IPI_IRQ_START=0
|
||||
options IPI_IRQ_END=15
|
||||
|
||||
|
@ -75,6 +75,23 @@ a20_attach(platform_t plat)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
a31_attach(platform_t plat)
|
||||
{
|
||||
soc_type = ALLWINNERSOC_A31;
|
||||
soc_family = ALLWINNERSOC_SUN6I;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
a31s_attach(platform_t plat)
|
||||
{
|
||||
soc_type = ALLWINNERSOC_A31S;
|
||||
soc_family = ALLWINNERSOC_SUN6I;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static vm_offset_t
|
||||
allwinner_lastaddr(platform_t plat)
|
||||
@ -138,6 +155,22 @@ static platform_method_t a20_methods[] = {
|
||||
PLATFORMMETHOD_END,
|
||||
};
|
||||
|
||||
static platform_method_t a31_methods[] = {
|
||||
PLATFORMMETHOD(platform_attach, a31_attach),
|
||||
PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr),
|
||||
PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init),
|
||||
|
||||
PLATFORMMETHOD_END,
|
||||
};
|
||||
|
||||
static platform_method_t a31s_methods[] = {
|
||||
PLATFORMMETHOD(platform_attach, a31s_attach),
|
||||
PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr),
|
||||
PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init),
|
||||
|
||||
PLATFORMMETHOD_END,
|
||||
};
|
||||
|
||||
u_int
|
||||
allwinner_soc_type(void)
|
||||
{
|
||||
@ -152,3 +185,5 @@ allwinner_soc_family(void)
|
||||
|
||||
FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10");
|
||||
FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20");
|
||||
FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31");
|
||||
FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s");
|
||||
|
@ -34,9 +34,12 @@
|
||||
#define ALLWINNERSOC_A13 0x13000000
|
||||
#define ALLWINNERSOC_A10S 0x10000001
|
||||
#define ALLWINNERSOC_A20 0x20000000
|
||||
#define ALLWINNERSOC_A31 0x31000000
|
||||
#define ALLWINNERSOC_A31S 0x31000001
|
||||
|
||||
#define ALLWINNERSOC_SUN4I 0x40000000
|
||||
#define ALLWINNERSOC_SUN5I 0x50000000
|
||||
#define ALLWINNERSOC_SUN6I 0x60000000
|
||||
#define ALLWINNERSOC_SUN7I 0x70000000
|
||||
|
||||
u_int allwinner_soc_type(void);
|
||||
|
@ -8,7 +8,5 @@ makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
makeoptions KERNVIRTADDR=0xc0200000
|
||||
options KERNVIRTADDR=0xc0200000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
files "../allwinner/files.allwinner"
|
||||
files "../allwinner/files.a10"
|
||||
|
@ -7,8 +7,6 @@ makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
makeoptions KERNVIRTADDR=0xc0f00000
|
||||
options KERNVIRTADDR=0xc0f00000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options IPI_IRQ_START=0
|
||||
options IPI_IRQ_END=15
|
||||
|
||||
|
@ -17,8 +17,6 @@ device fdt_pinctrl
|
||||
|
||||
files "../amlogic/aml8726/files.aml8726"
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
# Set all global interrupts to be edge triggered, active high.
|
||||
options GIC_DEFAULT_ICFGR_INIT=0xffffffff
|
||||
|
||||
|
@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/bus.h>
|
||||
#include <machine/frame.h> /* For trapframe_t, used in <machine/machdep.h> */
|
||||
#include <machine/machdep.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/devmap.h>
|
||||
#include <machine/platform.h>
|
||||
#include <machine/fdt.h>
|
||||
|
@ -10,8 +10,6 @@ options KERNVIRTADDR=0xa0200000
|
||||
makeoptions KERNBASE=0xa0000000
|
||||
options KERNBASE=0xa0000000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options IPI_IRQ_START=0
|
||||
options IPI_IRQ_END=15
|
||||
|
||||
|
@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/debug_monitor.h>
|
||||
#include <machine/kdb.h>
|
||||
#include <machine/param.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/reg.h>
|
||||
|
||||
|
@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/elf32.h>
|
||||
#include <sys/inflate.h>
|
||||
#include <machine/elf.h>
|
||||
#include <machine/pte.h>
|
||||
#include <machine/pte-v4.h>
|
||||
#include <machine/cpufunc.h>
|
||||
#include <machine/armreg.h>
|
||||
|
||||
|
@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <vm/vm_map.h>
|
||||
|
||||
#include <machine/acle-compat.h>
|
||||
#include <machine/vmparam.h>
|
||||
#include <machine/armreg.h>
|
||||
#include <machine/frame.h>
|
||||
#include <machine/pcb.h>
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <machine/asm.h>
|
||||
#include <machine/armreg.h>
|
||||
#include <machine/cpuconf.h>
|
||||
#include <machine/pte.h>
|
||||
#include <machine/pte-v4.h>
|
||||
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <machine/armreg.h>
|
||||
#include <machine/sysreg.h>
|
||||
#include <machine/cpuconf.h>
|
||||
#include <machine/pte.h>
|
||||
#include <machine/pte-v6.h>
|
||||
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
|
@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/debug_monitor.h>
|
||||
#include <machine/smp.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/physmem.h>
|
||||
#include <machine/intr.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
@ -85,6 +85,7 @@ static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
|
||||
rman_res_t, rman_res_t, rman_res_t, u_int);
|
||||
static int nexus_activate_resource(device_t, device_t, int, int,
|
||||
struct resource *);
|
||||
static bus_space_tag_t nexus_get_bus_tag(device_t, device_t);
|
||||
#ifdef ARM_INTRNG
|
||||
#ifdef SMP
|
||||
static int nexus_bind_intr(device_t, device_t, struct resource *, int);
|
||||
@ -124,6 +125,7 @@ static device_method_t nexus_methods[] = {
|
||||
DEVMETHOD(bus_release_resource, nexus_release_resource),
|
||||
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
|
||||
DEVMETHOD(bus_teardown_intr, nexus_teardown_intr),
|
||||
DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag),
|
||||
#ifdef ARM_INTRNG
|
||||
DEVMETHOD(bus_describe_intr, nexus_describe_intr),
|
||||
#ifdef SMP
|
||||
@ -260,6 +262,17 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid,
|
||||
return (rman_release_resource(res));
|
||||
}
|
||||
|
||||
static bus_space_tag_t
|
||||
nexus_get_bus_tag(device_t bus __unused, device_t child __unused)
|
||||
{
|
||||
|
||||
#ifdef FDT
|
||||
return(fdtbus_bs_tag);
|
||||
#else
|
||||
return((void *)1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,
|
||||
enum intr_polarity pol)
|
||||
|
@ -2549,7 +2549,7 @@ pmap_remove_pages(pmap_t pmap)
|
||||
l2b = pmap_get_l2_bucket(pmap, pv->pv_va);
|
||||
KASSERT(l2b != NULL, ("No L2 bucket in pmap_remove_pages"));
|
||||
pt = &l2b->l2b_kva[l2pte_index(pv->pv_va)];
|
||||
m = PHYS_TO_VM_PAGE(*pt & L2_ADDR_MASK);
|
||||
m = PHYS_TO_VM_PAGE(*pt & L2_S_FRAME);
|
||||
KASSERT((vm_offset_t)m >= KERNBASE, ("Trying to access non-existent page va %x pte %x", pv->pv_va, *pt));
|
||||
*pt = 0;
|
||||
PTE_SYNC(pt);
|
@ -121,7 +121,6 @@ __FBSDID("$FreeBSD$");
|
||||
#endif
|
||||
|
||||
#include <machine/physmem.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/uma.h>
|
||||
@ -1267,13 +1266,6 @@ pmap_kenter_prot_attr(vm_offset_t va, vm_paddr_t pa, uint32_t prot,
|
||||
pte2_store(pte2p, PTE2_KERN(pa, prot, attr));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr)
|
||||
{
|
||||
|
||||
pmap_kenter_prot_attr(va, pa, PTE2_AP_KRW, attr);
|
||||
}
|
||||
|
||||
PMAP_INLINE void
|
||||
pmap_kenter(vm_offset_t va, vm_paddr_t pa)
|
||||
{
|
||||
|
@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/frame.h>
|
||||
#include <machine/machdep.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#ifdef KDB
|
||||
#include <sys/kdb.h>
|
||||
|
@ -164,7 +164,7 @@ at91_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
return (NULL);
|
||||
if (rle->res)
|
||||
panic("Resource rid %d type %d already in use", *rid, type);
|
||||
if (start == 0UL && end == ~0UL) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
start = rle->start;
|
||||
count = ulmax(count, rle->count);
|
||||
end = ulmax(rle->end, start + count - 1);
|
||||
|
@ -280,7 +280,7 @@ pinctrl_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
* Request for the default allocation with a given rid: use resource
|
||||
* list stored in the local device info.
|
||||
*/
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
if ((di = device_get_ivars(child)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
@ -5,7 +5,6 @@ cpu CPU_CORTEXA
|
||||
makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
options SOC_BCM2836
|
||||
|
||||
options ARM_L2_PIPT
|
||||
options IPI_IRQ_START=76
|
||||
|
||||
files "../broadcom/bcm2835/files.bcm2836"
|
||||
|
@ -425,7 +425,7 @@ econa_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
}
|
||||
if (rle->res)
|
||||
panic("Resource rid %d type %d already in use", *rid, type);
|
||||
if (start == 0UL && end == ~0UL) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
start = rle->start;
|
||||
count = ulmax(count, rle->count);
|
||||
end = ulmax(rle->end, start + count - 1);
|
||||
|
@ -2,6 +2,8 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
options ARM_L2_PIPT # Only L2 PIPT is supported
|
||||
|
||||
options PREEMPTION # Enable kernel thread preemption
|
||||
options INET # InterNETworking
|
||||
options INET6 # IPv6 communications protocols
|
||||
|
@ -2,7 +2,6 @@
|
||||
machine arm armv6
|
||||
cpu CPU_CORTEXA
|
||||
makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options KERNVIRTADDR=0xc0100000
|
||||
makeoptions KERNVIRTADDR=0xc0100000
|
||||
|
@ -2,7 +2,6 @@
|
||||
machine arm armv6
|
||||
cpu CPU_CORTEXA
|
||||
makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options KERNVIRTADDR=0xc0100000
|
||||
makeoptions KERNVIRTADDR=0xc0100000
|
||||
|
@ -2,7 +2,6 @@
|
||||
machine arm armv6
|
||||
cpu CPU_CORTEXA
|
||||
makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options KERNVIRTADDR = 0xc2000000
|
||||
makeoptions KERNVIRTADDR = 0xc2000000
|
||||
|
@ -7,6 +7,4 @@ makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
makeoptions KERNVIRTADDR=0xc0100000
|
||||
options KERNVIRTADDR=0xc0100000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
files "../freescale/vybrid/files.vybrid"
|
||||
|
516
sys/arm/include/pmap-v4.h
Normal file
516
sys/arm/include/pmap-v4.h
Normal file
@ -0,0 +1,516 @@
|
||||
/*-
|
||||
* Copyright (c) 1991 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department and William Jolitz of UUNET Technologies Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Derived from hp300 version by Mike Hibler, this version by William
|
||||
* Jolitz uses a recursive map [a pde points to the page directory] to
|
||||
* map the page tables using the pagetables themselves. This is done to
|
||||
* reduce the impact on kernel virtual memory for lots of sparse address
|
||||
* space, and to reduce the cost of memory to each process.
|
||||
*
|
||||
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
|
||||
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
|
||||
* from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_PMAP_V4_H_
|
||||
#define _MACHINE_PMAP_V4_H_
|
||||
|
||||
#include <machine/pte-v4.h>
|
||||
#include <machine/cpuconf.h>
|
||||
/*
|
||||
* Pte related macros
|
||||
*/
|
||||
#define PTE_NOCACHE 1
|
||||
#define PTE_CACHE 2
|
||||
#define PTE_DEVICE PTE_NOCACHE
|
||||
#define PTE_PAGETABLE 3
|
||||
|
||||
enum mem_type {
|
||||
STRONG_ORD = 0,
|
||||
DEVICE_NOSHARE,
|
||||
DEVICE_SHARE,
|
||||
NRML_NOCACHE,
|
||||
NRML_IWT_OWT,
|
||||
NRML_IWB_OWB,
|
||||
NRML_IWBA_OWBA
|
||||
};
|
||||
|
||||
#ifndef LOCORE
|
||||
|
||||
#include <sys/queue.h>
|
||||
#include <sys/_cpuset.h>
|
||||
#include <sys/_lock.h>
|
||||
#include <sys/_mutex.h>
|
||||
|
||||
#define PDESIZE sizeof(pd_entry_t) /* for assembly files */
|
||||
#define PTESIZE sizeof(pt_entry_t) /* for assembly files */
|
||||
|
||||
#define pmap_page_get_memattr(m) ((m)->md.pv_memattr)
|
||||
#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list))
|
||||
|
||||
/*
|
||||
* Pmap stuff
|
||||
*/
|
||||
|
||||
/*
|
||||
* This structure is used to hold a virtual<->physical address
|
||||
* association and is used mostly by bootstrap code
|
||||
*/
|
||||
struct pv_addr {
|
||||
SLIST_ENTRY(pv_addr) pv_list;
|
||||
vm_offset_t pv_va;
|
||||
vm_paddr_t pv_pa;
|
||||
};
|
||||
|
||||
struct pv_entry;
|
||||
struct pv_chunk;
|
||||
|
||||
struct md_page {
|
||||
int pvh_attrs;
|
||||
vm_memattr_t pv_memattr;
|
||||
vm_offset_t pv_kva; /* first kernel VA mapping */
|
||||
TAILQ_HEAD(,pv_entry) pv_list;
|
||||
};
|
||||
|
||||
struct l1_ttable;
|
||||
struct l2_dtable;
|
||||
|
||||
|
||||
/*
|
||||
* The number of L2 descriptor tables which can be tracked by an l2_dtable.
|
||||
* A bucket size of 16 provides for 16MB of contiguous virtual address
|
||||
* space per l2_dtable. Most processes will, therefore, require only two or
|
||||
* three of these to map their whole working set.
|
||||
*/
|
||||
#define L2_BUCKET_LOG2 4
|
||||
#define L2_BUCKET_SIZE (1 << L2_BUCKET_LOG2)
|
||||
/*
|
||||
* Given the above "L2-descriptors-per-l2_dtable" constant, the number
|
||||
* of l2_dtable structures required to track all possible page descriptors
|
||||
* mappable by an L1 translation table is given by the following constants:
|
||||
*/
|
||||
#define L2_LOG2 ((32 - L1_S_SHIFT) - L2_BUCKET_LOG2)
|
||||
#define L2_SIZE (1 << L2_LOG2)
|
||||
|
||||
struct pmap {
|
||||
struct mtx pm_mtx;
|
||||
u_int8_t pm_domain;
|
||||
struct l1_ttable *pm_l1;
|
||||
struct l2_dtable *pm_l2[L2_SIZE];
|
||||
cpuset_t pm_active; /* active on cpus */
|
||||
struct pmap_statistics pm_stats; /* pmap statictics */
|
||||
TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */
|
||||
};
|
||||
|
||||
typedef struct pmap *pmap_t;
|
||||
|
||||
#ifdef _KERNEL
|
||||
extern struct pmap kernel_pmap_store;
|
||||
#define kernel_pmap (&kernel_pmap_store)
|
||||
|
||||
#define PMAP_ASSERT_LOCKED(pmap) \
|
||||
mtx_assert(&(pmap)->pm_mtx, MA_OWNED)
|
||||
#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx)
|
||||
#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx)
|
||||
#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \
|
||||
NULL, MTX_DEF | MTX_DUPOK)
|
||||
#define PMAP_OWNED(pmap) mtx_owned(&(pmap)->pm_mtx)
|
||||
#define PMAP_MTX(pmap) (&(pmap)->pm_mtx)
|
||||
#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx)
|
||||
#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For each vm_page_t, there is a list of all currently valid virtual
|
||||
* mappings of that page. An entry is a pv_entry_t, the list is pv_list.
|
||||
*/
|
||||
typedef struct pv_entry {
|
||||
vm_offset_t pv_va; /* virtual address for mapping */
|
||||
TAILQ_ENTRY(pv_entry) pv_list;
|
||||
int pv_flags; /* flags (wired, etc...) */
|
||||
pmap_t pv_pmap; /* pmap where mapping lies */
|
||||
TAILQ_ENTRY(pv_entry) pv_plist;
|
||||
} *pv_entry_t;
|
||||
|
||||
/*
|
||||
* pv_entries are allocated in chunks per-process. This avoids the
|
||||
* need to track per-pmap assignments.
|
||||
*/
|
||||
#define _NPCM 8
|
||||
#define _NPCPV 252
|
||||
|
||||
struct pv_chunk {
|
||||
pmap_t pc_pmap;
|
||||
TAILQ_ENTRY(pv_chunk) pc_list;
|
||||
uint32_t pc_map[_NPCM]; /* bitmap; 1 = free */
|
||||
uint32_t pc_dummy[3]; /* aligns pv_chunk to 4KB */
|
||||
TAILQ_ENTRY(pv_chunk) pc_lru;
|
||||
struct pv_entry pc_pventry[_NPCPV];
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
boolean_t pmap_get_pde_pte(pmap_t, vm_offset_t, pd_entry_t **, pt_entry_t **);
|
||||
|
||||
/*
|
||||
* virtual address to page table entry and
|
||||
* to physical address. Likewise for alternate address space.
|
||||
* Note: these work recursively, thus vtopte of a pte will give
|
||||
* the corresponding pde that in turn maps it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The current top of kernel VM.
|
||||
*/
|
||||
extern vm_offset_t pmap_curmaxkvaddr;
|
||||
|
||||
/* Virtual address to page table entry */
|
||||
static __inline pt_entry_t *
|
||||
vtopte(vm_offset_t va)
|
||||
{
|
||||
pd_entry_t *pdep;
|
||||
pt_entry_t *ptep;
|
||||
|
||||
if (pmap_get_pde_pte(kernel_pmap, va, &pdep, &ptep) == FALSE)
|
||||
return (NULL);
|
||||
return (ptep);
|
||||
}
|
||||
|
||||
void pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt);
|
||||
int pmap_change_attr(vm_offset_t, vm_size_t, int);
|
||||
void pmap_kenter(vm_offset_t va, vm_paddr_t pa);
|
||||
void pmap_kenter_nocache(vm_offset_t va, vm_paddr_t pa);
|
||||
void pmap_kenter_user(vm_offset_t va, vm_paddr_t pa);
|
||||
vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *);
|
||||
void pmap_kremove(vm_offset_t);
|
||||
vm_page_t pmap_use_pt(pmap_t, vm_offset_t);
|
||||
void pmap_debug(int);
|
||||
void pmap_map_section(vm_offset_t, vm_offset_t, vm_offset_t, int, int);
|
||||
void pmap_link_l2pt(vm_offset_t, vm_offset_t, struct pv_addr *);
|
||||
vm_size_t pmap_map_chunk(vm_offset_t, vm_offset_t, vm_offset_t, vm_size_t, int, int);
|
||||
void
|
||||
pmap_map_entry(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa, int prot,
|
||||
int cache);
|
||||
int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t, int);
|
||||
|
||||
/*
|
||||
* Definitions for MMU domains
|
||||
*/
|
||||
#define PMAP_DOMAINS 15 /* 15 'user' domains (1-15) */
|
||||
#define PMAP_DOMAIN_KERNEL 0 /* The kernel uses domain #0 */
|
||||
|
||||
/*
|
||||
* The new pmap ensures that page-tables are always mapping Write-Thru.
|
||||
* Thus, on some platforms we can run fast and loose and avoid syncing PTEs
|
||||
* on every change.
|
||||
*
|
||||
* Unfortunately, not all CPUs have a write-through cache mode. So we
|
||||
* define PMAP_NEEDS_PTE_SYNC for C code to conditionally do PTE syncs,
|
||||
* and if there is the chance for PTE syncs to be needed, we define
|
||||
* PMAP_INCLUDE_PTE_SYNC so e.g. assembly code can include (and run)
|
||||
* the code.
|
||||
*/
|
||||
extern int pmap_needs_pte_sync;
|
||||
|
||||
/*
|
||||
* These macros define the various bit masks in the PTE.
|
||||
*
|
||||
* We use these macros since we use different bits on different processor
|
||||
* models.
|
||||
*/
|
||||
|
||||
#define L1_S_CACHE_MASK_generic (L1_S_B|L1_S_C)
|
||||
#define L1_S_CACHE_MASK_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X)|\
|
||||
L1_S_XSCALE_TEX(TEX_XSCALE_T))
|
||||
|
||||
#define L2_L_CACHE_MASK_generic (L2_B|L2_C)
|
||||
#define L2_L_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X) | \
|
||||
L2_XSCALE_L_TEX(TEX_XSCALE_T))
|
||||
|
||||
#define L2_S_PROT_U_generic (L2_AP(AP_U))
|
||||
#define L2_S_PROT_W_generic (L2_AP(AP_W))
|
||||
#define L2_S_PROT_MASK_generic (L2_S_PROT_U|L2_S_PROT_W)
|
||||
|
||||
#define L2_S_PROT_U_xscale (L2_AP0(AP_U))
|
||||
#define L2_S_PROT_W_xscale (L2_AP0(AP_W))
|
||||
#define L2_S_PROT_MASK_xscale (L2_S_PROT_U|L2_S_PROT_W)
|
||||
|
||||
#define L2_S_CACHE_MASK_generic (L2_B|L2_C)
|
||||
#define L2_S_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X)| \
|
||||
L2_XSCALE_T_TEX(TEX_XSCALE_X))
|
||||
|
||||
#define L1_S_PROTO_generic (L1_TYPE_S | L1_S_IMP)
|
||||
#define L1_S_PROTO_xscale (L1_TYPE_S)
|
||||
|
||||
#define L1_C_PROTO_generic (L1_TYPE_C | L1_C_IMP2)
|
||||
#define L1_C_PROTO_xscale (L1_TYPE_C)
|
||||
|
||||
#define L2_L_PROTO (L2_TYPE_L)
|
||||
|
||||
#define L2_S_PROTO_generic (L2_TYPE_S)
|
||||
#define L2_S_PROTO_xscale (L2_TYPE_XSCALE_XS)
|
||||
|
||||
/*
|
||||
* User-visible names for the ones that vary with MMU class.
|
||||
*/
|
||||
#define L2_AP(x) (L2_AP0(x) | L2_AP1(x) | L2_AP2(x) | L2_AP3(x))
|
||||
|
||||
#if ARM_NMMUS > 1
|
||||
/* More than one MMU class configured; use variables. */
|
||||
#define L2_S_PROT_U pte_l2_s_prot_u
|
||||
#define L2_S_PROT_W pte_l2_s_prot_w
|
||||
#define L2_S_PROT_MASK pte_l2_s_prot_mask
|
||||
|
||||
#define L1_S_CACHE_MASK pte_l1_s_cache_mask
|
||||
#define L2_L_CACHE_MASK pte_l2_l_cache_mask
|
||||
#define L2_S_CACHE_MASK pte_l2_s_cache_mask
|
||||
|
||||
#define L1_S_PROTO pte_l1_s_proto
|
||||
#define L1_C_PROTO pte_l1_c_proto
|
||||
#define L2_S_PROTO pte_l2_s_proto
|
||||
|
||||
#elif ARM_MMU_GENERIC != 0
|
||||
#define L2_S_PROT_U L2_S_PROT_U_generic
|
||||
#define L2_S_PROT_W L2_S_PROT_W_generic
|
||||
#define L2_S_PROT_MASK L2_S_PROT_MASK_generic
|
||||
|
||||
#define L1_S_CACHE_MASK L1_S_CACHE_MASK_generic
|
||||
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic
|
||||
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic
|
||||
|
||||
#define L1_S_PROTO L1_S_PROTO_generic
|
||||
#define L1_C_PROTO L1_C_PROTO_generic
|
||||
#define L2_S_PROTO L2_S_PROTO_generic
|
||||
|
||||
#elif ARM_MMU_XSCALE == 1
|
||||
#define L2_S_PROT_U L2_S_PROT_U_xscale
|
||||
#define L2_S_PROT_W L2_S_PROT_W_xscale
|
||||
#define L2_S_PROT_MASK L2_S_PROT_MASK_xscale
|
||||
|
||||
#define L1_S_CACHE_MASK L1_S_CACHE_MASK_xscale
|
||||
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale
|
||||
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale
|
||||
|
||||
#define L1_S_PROTO L1_S_PROTO_xscale
|
||||
#define L1_C_PROTO L1_C_PROTO_xscale
|
||||
#define L2_S_PROTO L2_S_PROTO_xscale
|
||||
|
||||
#endif /* ARM_NMMUS > 1 */
|
||||
|
||||
#if defined(CPU_XSCALE_81342)
|
||||
#define PMAP_NEEDS_PTE_SYNC 1
|
||||
#define PMAP_INCLUDE_PTE_SYNC
|
||||
#else
|
||||
#define PMAP_NEEDS_PTE_SYNC 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These macros return various bits based on kernel/user and protection.
|
||||
* Note that the compiler will usually fold these at compile time.
|
||||
*/
|
||||
#define L1_S_PROT_U (L1_S_AP(AP_U))
|
||||
#define L1_S_PROT_W (L1_S_AP(AP_W))
|
||||
#define L1_S_PROT_MASK (L1_S_PROT_U|L1_S_PROT_W)
|
||||
#define L1_S_WRITABLE(pd) ((pd) & L1_S_PROT_W)
|
||||
|
||||
#define L1_S_PROT(ku, pr) ((((ku) == PTE_USER) ? L1_S_PROT_U : 0) | \
|
||||
(((pr) & VM_PROT_WRITE) ? L1_S_PROT_W : 0))
|
||||
|
||||
#define L2_L_PROT_U (L2_AP(AP_U))
|
||||
#define L2_L_PROT_W (L2_AP(AP_W))
|
||||
#define L2_L_PROT_MASK (L2_L_PROT_U|L2_L_PROT_W)
|
||||
|
||||
#define L2_L_PROT(ku, pr) ((((ku) == PTE_USER) ? L2_L_PROT_U : 0) | \
|
||||
(((pr) & VM_PROT_WRITE) ? L2_L_PROT_W : 0))
|
||||
|
||||
#define L2_S_PROT(ku, pr) ((((ku) == PTE_USER) ? L2_S_PROT_U : 0) | \
|
||||
(((pr) & VM_PROT_WRITE) ? L2_S_PROT_W : 0))
|
||||
|
||||
/*
|
||||
* Macros to test if a mapping is mappable with an L1 Section mapping
|
||||
* or an L2 Large Page mapping.
|
||||
*/
|
||||
#define L1_S_MAPPABLE_P(va, pa, size) \
|
||||
((((va) | (pa)) & L1_S_OFFSET) == 0 && (size) >= L1_S_SIZE)
|
||||
|
||||
#define L2_L_MAPPABLE_P(va, pa, size) \
|
||||
((((va) | (pa)) & L2_L_OFFSET) == 0 && (size) >= L2_L_SIZE)
|
||||
|
||||
/*
|
||||
* Provide a fallback in case we were not able to determine it at
|
||||
* compile-time.
|
||||
*/
|
||||
#ifndef PMAP_NEEDS_PTE_SYNC
|
||||
#define PMAP_NEEDS_PTE_SYNC pmap_needs_pte_sync
|
||||
#define PMAP_INCLUDE_PTE_SYNC
|
||||
#endif
|
||||
|
||||
#ifdef ARM_L2_PIPT
|
||||
#define _sync_l2(pte, size) cpu_l2cache_wb_range(vtophys(pte), size)
|
||||
#else
|
||||
#define _sync_l2(pte, size) cpu_l2cache_wb_range(pte, size)
|
||||
#endif
|
||||
|
||||
#define PTE_SYNC(pte) \
|
||||
do { \
|
||||
if (PMAP_NEEDS_PTE_SYNC) { \
|
||||
cpu_dcache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\
|
||||
cpu_drain_writebuf(); \
|
||||
_sync_l2((vm_offset_t)(pte), sizeof(pt_entry_t));\
|
||||
} else \
|
||||
cpu_drain_writebuf(); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define PTE_SYNC_RANGE(pte, cnt) \
|
||||
do { \
|
||||
if (PMAP_NEEDS_PTE_SYNC) { \
|
||||
cpu_dcache_wb_range((vm_offset_t)(pte), \
|
||||
(cnt) << 2); /* * sizeof(pt_entry_t) */ \
|
||||
cpu_drain_writebuf(); \
|
||||
_sync_l2((vm_offset_t)(pte), \
|
||||
(cnt) << 2); /* * sizeof(pt_entry_t) */ \
|
||||
} else \
|
||||
cpu_drain_writebuf(); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
extern pt_entry_t pte_l1_s_cache_mode;
|
||||
extern pt_entry_t pte_l1_s_cache_mask;
|
||||
|
||||
extern pt_entry_t pte_l2_l_cache_mode;
|
||||
extern pt_entry_t pte_l2_l_cache_mask;
|
||||
|
||||
extern pt_entry_t pte_l2_s_cache_mode;
|
||||
extern pt_entry_t pte_l2_s_cache_mask;
|
||||
|
||||
extern pt_entry_t pte_l1_s_cache_mode_pt;
|
||||
extern pt_entry_t pte_l2_l_cache_mode_pt;
|
||||
extern pt_entry_t pte_l2_s_cache_mode_pt;
|
||||
|
||||
extern pt_entry_t pte_l2_s_prot_u;
|
||||
extern pt_entry_t pte_l2_s_prot_w;
|
||||
extern pt_entry_t pte_l2_s_prot_mask;
|
||||
|
||||
extern pt_entry_t pte_l1_s_proto;
|
||||
extern pt_entry_t pte_l1_c_proto;
|
||||
extern pt_entry_t pte_l2_s_proto;
|
||||
|
||||
extern void (*pmap_copy_page_func)(vm_paddr_t, vm_paddr_t);
|
||||
extern void (*pmap_copy_page_offs_func)(vm_paddr_t a_phys,
|
||||
vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, int cnt);
|
||||
extern void (*pmap_zero_page_func)(vm_paddr_t, int, int);
|
||||
|
||||
#if ARM_MMU_GENERIC != 0 || defined(CPU_XSCALE_81342)
|
||||
void pmap_copy_page_generic(vm_paddr_t, vm_paddr_t);
|
||||
void pmap_zero_page_generic(vm_paddr_t, int, int);
|
||||
|
||||
void pmap_pte_init_generic(void);
|
||||
#endif /* ARM_MMU_GENERIC != 0 */
|
||||
|
||||
#if ARM_MMU_XSCALE == 1
|
||||
void pmap_copy_page_xscale(vm_paddr_t, vm_paddr_t);
|
||||
void pmap_zero_page_xscale(vm_paddr_t, int, int);
|
||||
|
||||
void pmap_pte_init_xscale(void);
|
||||
|
||||
void xscale_setup_minidata(vm_offset_t, vm_offset_t, vm_offset_t);
|
||||
|
||||
void pmap_use_minicache(vm_offset_t, vm_size_t);
|
||||
#endif /* ARM_MMU_XSCALE == 1 */
|
||||
#if defined(CPU_XSCALE_81342)
|
||||
#define ARM_HAVE_SUPERSECTIONS
|
||||
#endif
|
||||
|
||||
#define PTE_KERNEL 0
|
||||
#define PTE_USER 1
|
||||
#define l1pte_valid(pde) ((pde) != 0)
|
||||
#define l1pte_section_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_S)
|
||||
#define l1pte_page_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_C)
|
||||
#define l1pte_fpage_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_F)
|
||||
|
||||
#define l2pte_index(v) (((v) & L1_S_OFFSET) >> L2_S_SHIFT)
|
||||
#define l2pte_valid(pte) ((pte) != 0)
|
||||
#define l2pte_pa(pte) ((pte) & L2_S_FRAME)
|
||||
#define l2pte_minidata(pte) (((pte) & \
|
||||
(L2_B | L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X)))\
|
||||
== (L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X)))
|
||||
|
||||
/* L1 and L2 page table macros */
|
||||
#define pmap_pde_v(pde) l1pte_valid(*(pde))
|
||||
#define pmap_pde_section(pde) l1pte_section_p(*(pde))
|
||||
#define pmap_pde_page(pde) l1pte_page_p(*(pde))
|
||||
#define pmap_pde_fpage(pde) l1pte_fpage_p(*(pde))
|
||||
|
||||
#define pmap_pte_v(pte) l2pte_valid(*(pte))
|
||||
#define pmap_pte_pa(pte) l2pte_pa(*(pte))
|
||||
|
||||
/*
|
||||
* Flags that indicate attributes of pages or mappings of pages.
|
||||
*
|
||||
* The PVF_MOD and PVF_REF flags are stored in the mdpage for each
|
||||
* page. PVF_WIRED, PVF_WRITE, and PVF_NC are kept in individual
|
||||
* pv_entry's for each page. They live in the same "namespace" so
|
||||
* that we can clear multiple attributes at a time.
|
||||
*
|
||||
* Note the "non-cacheable" flag generally means the page has
|
||||
* multiple mappings in a given address space.
|
||||
*/
|
||||
#define PVF_MOD 0x01 /* page is modified */
|
||||
#define PVF_REF 0x02 /* page is referenced */
|
||||
#define PVF_WIRED 0x04 /* mapping is wired */
|
||||
#define PVF_WRITE 0x08 /* mapping is writable */
|
||||
#define PVF_EXEC 0x10 /* mapping is executable */
|
||||
#define PVF_NC 0x20 /* mapping is non-cacheable */
|
||||
#define PVF_MWC 0x40 /* mapping is used multiple times in userland */
|
||||
#define PVF_UNMAN 0x80 /* mapping is unmanaged */
|
||||
|
||||
void vector_page_setprot(int);
|
||||
|
||||
#define SECTION_CACHE 0x1
|
||||
#define SECTION_PT 0x2
|
||||
void pmap_kenter_section(vm_offset_t, vm_paddr_t, int flags);
|
||||
#ifdef ARM_HAVE_SUPERSECTIONS
|
||||
void pmap_kenter_supersection(vm_offset_t, uint64_t, int flags);
|
||||
#endif
|
||||
|
||||
void pmap_postinit(void);
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !LOCORE */
|
||||
|
||||
#endif /* !_MACHINE_PMAP_V4_H_ */
|
@ -45,8 +45,8 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_PMAP_H_
|
||||
#define _MACHINE_PMAP_H_
|
||||
#ifndef _MACHINE_PMAP_V6_H_
|
||||
#define _MACHINE_PMAP_V6_H_
|
||||
|
||||
#include <sys/queue.h>
|
||||
#include <sys/_cpuset.h>
|
||||
@ -88,27 +88,11 @@ typedef uint32_t ttb_entry_t; /* TTB entry */
|
||||
*/
|
||||
#define NKPT2PG 32
|
||||
#endif
|
||||
|
||||
extern vm_paddr_t phys_avail[];
|
||||
extern vm_paddr_t dump_avail[];
|
||||
extern char *_tmppt; /* poor name! */
|
||||
extern vm_offset_t virtual_avail;
|
||||
extern vm_offset_t virtual_end;
|
||||
#endif /* _KERNEL */
|
||||
|
||||
/*
|
||||
* Pmap stuff
|
||||
*/
|
||||
|
||||
/*
|
||||
* This structure is used to hold a virtual<->physical address
|
||||
* association and is used mostly by bootstrap code
|
||||
*/
|
||||
struct pv_addr {
|
||||
SLIST_ENTRY(pv_addr) pv_list;
|
||||
vm_offset_t pv_va;
|
||||
vm_paddr_t pv_pa;
|
||||
};
|
||||
#endif
|
||||
struct pv_entry;
|
||||
struct pv_chunk;
|
||||
|
||||
@ -170,40 +154,27 @@ struct pv_chunk {
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
struct pcb;
|
||||
extern ttb_entry_t pmap_kern_ttb; /* TTB for kernel pmap */
|
||||
|
||||
#define pmap_page_get_memattr(m) ((m)->md.pat_mode)
|
||||
#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0)
|
||||
|
||||
/*
|
||||
* Only the following functions or macros may be used before pmap_bootstrap()
|
||||
* is called: pmap_kenter(), pmap_kextract(), pmap_kremove(), vtophys(), and
|
||||
* vtopte2().
|
||||
*/
|
||||
void pmap_bootstrap(vm_offset_t );
|
||||
void pmap_kenter(vm_offset_t , vm_paddr_t );
|
||||
void *pmap_kenter_temporary(vm_paddr_t , int );
|
||||
void pmap_bootstrap(vm_offset_t);
|
||||
void pmap_kenter(vm_offset_t, vm_paddr_t);
|
||||
void pmap_kremove(vm_offset_t);
|
||||
void *pmap_mapdev(vm_paddr_t, vm_size_t);
|
||||
void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int);
|
||||
boolean_t pmap_page_is_mapped(vm_page_t );
|
||||
void pmap_page_set_memattr(vm_page_t , vm_memattr_t );
|
||||
void pmap_unmapdev(vm_offset_t, vm_size_t);
|
||||
void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
|
||||
void pmap_kremove_device(vm_offset_t, vm_size_t);
|
||||
void pmap_set_pcb_pagedir(pmap_t , struct pcb *);
|
||||
boolean_t pmap_page_is_mapped(vm_page_t);
|
||||
|
||||
void pmap_tlb_flush(pmap_t , vm_offset_t );
|
||||
void pmap_tlb_flush_range(pmap_t , vm_offset_t , vm_size_t );
|
||||
void pmap_tlb_flush(pmap_t, vm_offset_t);
|
||||
void pmap_tlb_flush_range(pmap_t, vm_offset_t, vm_size_t);
|
||||
|
||||
void pmap_dcache_wb_range(vm_paddr_t , vm_size_t , vm_memattr_t );
|
||||
|
||||
vm_paddr_t pmap_kextract(vm_offset_t );
|
||||
vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *);
|
||||
|
||||
int pmap_fault(pmap_t , vm_offset_t , uint32_t , int , bool);
|
||||
#define vtophys(va) pmap_kextract((vm_offset_t)(va))
|
||||
int pmap_fault(pmap_t, vm_offset_t, uint32_t, int, bool);
|
||||
|
||||
void pmap_set_tex(void);
|
||||
void reinit_mmu(ttb_entry_t ttb, u_int aux_clr, u_int aux_set);
|
||||
@ -211,13 +182,13 @@ void reinit_mmu(ttb_entry_t ttb, u_int aux_clr, u_int aux_set);
|
||||
/*
|
||||
* Pre-bootstrap epoch functions set.
|
||||
*/
|
||||
void pmap_bootstrap_prepare(vm_paddr_t );
|
||||
vm_paddr_t pmap_preboot_get_pages(u_int );
|
||||
void pmap_preboot_map_pages(vm_paddr_t , vm_offset_t , u_int );
|
||||
vm_offset_t pmap_preboot_reserve_pages(u_int );
|
||||
vm_offset_t pmap_preboot_get_vpages(u_int );
|
||||
void pmap_bootstrap_prepare(vm_paddr_t);
|
||||
vm_paddr_t pmap_preboot_get_pages(u_int);
|
||||
void pmap_preboot_map_pages(vm_paddr_t, vm_offset_t, u_int);
|
||||
vm_offset_t pmap_preboot_reserve_pages(u_int);
|
||||
vm_offset_t pmap_preboot_get_vpages(u_int);
|
||||
void pmap_preboot_map_attr(vm_paddr_t, vm_offset_t, vm_size_t, vm_prot_t,
|
||||
vm_memattr_t);
|
||||
|
||||
#endif /* _KERNEL */
|
||||
#endif /* !_MACHINE_PMAP_H_ */
|
||||
#endif /* !_MACHINE_PMAP_V6_H_ */
|
||||
|
@ -1,11 +1,8 @@
|
||||
/*-
|
||||
* Copyright (c) 1991 Regents of the University of California.
|
||||
* Copyright (c) 2016 Svatopluk Kraus
|
||||
* Copyright (c) 2016 Michal Meloun
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department and William Jolitz of UUNET Technologies Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@ -14,18 +11,11 @@
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
@ -34,514 +24,45 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Derived from hp300 version by Mike Hibler, this version by William
|
||||
* Jolitz uses a recursive map [a pde points to the page directory] to
|
||||
* map the page tables using the pagetables themselves. This is done to
|
||||
* reduce the impact on kernel virtual memory for lots of sparse address
|
||||
* space, and to reduce the cost of memory to each process.
|
||||
*
|
||||
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
|
||||
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
|
||||
* from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#include <machine/acle-compat.h>
|
||||
|
||||
#if __ARM_ARCH >= 6
|
||||
#include <machine/pmap-v6.h>
|
||||
#else /* __ARM_ARCH >= 6 */
|
||||
|
||||
#ifndef _MACHINE_PMAP_H_
|
||||
#define _MACHINE_PMAP_H_
|
||||
|
||||
#include <machine/pte.h>
|
||||
#include <machine/cpuconf.h>
|
||||
/*
|
||||
* Pte related macros
|
||||
*/
|
||||
#define PTE_NOCACHE 1
|
||||
#define PTE_CACHE 2
|
||||
#define PTE_DEVICE PTE_NOCACHE
|
||||
#define PTE_PAGETABLE 3
|
||||
|
||||
enum mem_type {
|
||||
STRONG_ORD = 0,
|
||||
DEVICE_NOSHARE,
|
||||
DEVICE_SHARE,
|
||||
NRML_NOCACHE,
|
||||
NRML_IWT_OWT,
|
||||
NRML_IWB_OWB,
|
||||
NRML_IWBA_OWBA
|
||||
};
|
||||
|
||||
#ifndef LOCORE
|
||||
|
||||
#include <sys/queue.h>
|
||||
#include <sys/_cpuset.h>
|
||||
#include <sys/_lock.h>
|
||||
#include <sys/_mutex.h>
|
||||
|
||||
#define PDESIZE sizeof(pd_entry_t) /* for assembly files */
|
||||
#define PTESIZE sizeof(pt_entry_t) /* for assembly files */
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#define vtophys(va) pmap_kextract((vm_offset_t)(va))
|
||||
#include <machine/acle-compat.h>
|
||||
|
||||
#if __ARM_ARCH >= 6
|
||||
#include <machine/pmap-v6.h>
|
||||
#else
|
||||
#include <machine/pmap-v4.h>
|
||||
#endif
|
||||
|
||||
#define pmap_page_get_memattr(m) ((m)->md.pv_memattr)
|
||||
#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0)
|
||||
#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list))
|
||||
void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma);
|
||||
|
||||
/*
|
||||
* Pmap stuff
|
||||
*/
|
||||
|
||||
/*
|
||||
* This structure is used to hold a virtual<->physical address
|
||||
* association and is used mostly by bootstrap code
|
||||
*/
|
||||
struct pv_addr {
|
||||
SLIST_ENTRY(pv_addr) pv_list;
|
||||
vm_offset_t pv_va;
|
||||
vm_paddr_t pv_pa;
|
||||
};
|
||||
|
||||
struct pv_entry;
|
||||
struct pv_chunk;
|
||||
|
||||
struct md_page {
|
||||
int pvh_attrs;
|
||||
vm_memattr_t pv_memattr;
|
||||
vm_offset_t pv_kva; /* first kernel VA mapping */
|
||||
TAILQ_HEAD(,pv_entry) pv_list;
|
||||
};
|
||||
|
||||
struct l1_ttable;
|
||||
struct l2_dtable;
|
||||
|
||||
|
||||
/*
|
||||
* The number of L2 descriptor tables which can be tracked by an l2_dtable.
|
||||
* A bucket size of 16 provides for 16MB of contiguous virtual address
|
||||
* space per l2_dtable. Most processes will, therefore, require only two or
|
||||
* three of these to map their whole working set.
|
||||
*/
|
||||
#define L2_BUCKET_LOG2 4
|
||||
#define L2_BUCKET_SIZE (1 << L2_BUCKET_LOG2)
|
||||
/*
|
||||
* Given the above "L2-descriptors-per-l2_dtable" constant, the number
|
||||
* of l2_dtable structures required to track all possible page descriptors
|
||||
* mappable by an L1 translation table is given by the following constants:
|
||||
*/
|
||||
#define L2_LOG2 ((32 - L1_S_SHIFT) - L2_BUCKET_LOG2)
|
||||
#define L2_SIZE (1 << L2_LOG2)
|
||||
|
||||
struct pmap {
|
||||
struct mtx pm_mtx;
|
||||
u_int8_t pm_domain;
|
||||
struct l1_ttable *pm_l1;
|
||||
struct l2_dtable *pm_l2[L2_SIZE];
|
||||
cpuset_t pm_active; /* active on cpus */
|
||||
struct pmap_statistics pm_stats; /* pmap statictics */
|
||||
TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */
|
||||
};
|
||||
|
||||
typedef struct pmap *pmap_t;
|
||||
|
||||
#ifdef _KERNEL
|
||||
extern struct pmap kernel_pmap_store;
|
||||
#define kernel_pmap (&kernel_pmap_store)
|
||||
|
||||
#define PMAP_ASSERT_LOCKED(pmap) \
|
||||
mtx_assert(&(pmap)->pm_mtx, MA_OWNED)
|
||||
#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx)
|
||||
#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx)
|
||||
#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \
|
||||
NULL, MTX_DEF | MTX_DUPOK)
|
||||
#define PMAP_OWNED(pmap) mtx_owned(&(pmap)->pm_mtx)
|
||||
#define PMAP_MTX(pmap) (&(pmap)->pm_mtx)
|
||||
#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx)
|
||||
#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* For each vm_page_t, there is a list of all currently valid virtual
|
||||
* mappings of that page. An entry is a pv_entry_t, the list is pv_list.
|
||||
*/
|
||||
typedef struct pv_entry {
|
||||
vm_offset_t pv_va; /* virtual address for mapping */
|
||||
TAILQ_ENTRY(pv_entry) pv_list;
|
||||
int pv_flags; /* flags (wired, etc...) */
|
||||
pmap_t pv_pmap; /* pmap where mapping lies */
|
||||
TAILQ_ENTRY(pv_entry) pv_plist;
|
||||
} *pv_entry_t;
|
||||
|
||||
/*
|
||||
* pv_entries are allocated in chunks per-process. This avoids the
|
||||
* need to track per-pmap assignments.
|
||||
*/
|
||||
#define _NPCM 8
|
||||
#define _NPCPV 252
|
||||
|
||||
struct pv_chunk {
|
||||
pmap_t pc_pmap;
|
||||
TAILQ_ENTRY(pv_chunk) pc_list;
|
||||
uint32_t pc_map[_NPCM]; /* bitmap; 1 = free */
|
||||
uint32_t pc_dummy[3]; /* aligns pv_chunk to 4KB */
|
||||
TAILQ_ENTRY(pv_chunk) pc_lru;
|
||||
struct pv_entry pc_pventry[_NPCPV];
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
boolean_t pmap_get_pde_pte(pmap_t, vm_offset_t, pd_entry_t **, pt_entry_t **);
|
||||
|
||||
/*
|
||||
* virtual address to page table entry and
|
||||
* to physical address. Likewise for alternate address space.
|
||||
* Note: these work recursively, thus vtopte of a pte will give
|
||||
* the corresponding pde that in turn maps it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The current top of kernel VM.
|
||||
*/
|
||||
extern vm_offset_t pmap_curmaxkvaddr;
|
||||
|
||||
struct pcb;
|
||||
|
||||
void pmap_set_pcb_pagedir(pmap_t, struct pcb *);
|
||||
/* Virtual address to page table entry */
|
||||
static __inline pt_entry_t *
|
||||
vtopte(vm_offset_t va)
|
||||
{
|
||||
pd_entry_t *pdep;
|
||||
pt_entry_t *ptep;
|
||||
|
||||
if (pmap_get_pde_pte(kernel_pmap, va, &pdep, &ptep) == FALSE)
|
||||
return (NULL);
|
||||
return (ptep);
|
||||
}
|
||||
|
||||
extern vm_paddr_t dump_avail[];
|
||||
extern vm_paddr_t phys_avail[];
|
||||
|
||||
extern char *_tmppt; /* poor name! */
|
||||
|
||||
extern vm_offset_t virtual_avail;
|
||||
extern vm_offset_t virtual_end;
|
||||
|
||||
void pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt);
|
||||
int pmap_change_attr(vm_offset_t, vm_size_t, int);
|
||||
void pmap_kenter(vm_offset_t va, vm_paddr_t pa);
|
||||
void pmap_kenter_nocache(vm_offset_t va, vm_paddr_t pa);
|
||||
void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
|
||||
void pmap_kremove_device(vm_offset_t, vm_size_t);
|
||||
void *pmap_kenter_temporary(vm_paddr_t pa, int i);
|
||||
void pmap_kenter_user(vm_offset_t va, vm_paddr_t pa);
|
||||
vm_paddr_t pmap_kextract(vm_offset_t va);
|
||||
vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *);
|
||||
void pmap_kremove(vm_offset_t);
|
||||
void *pmap_mapdev(vm_offset_t, vm_size_t);
|
||||
void pmap_unmapdev(vm_offset_t, vm_size_t);
|
||||
vm_page_t pmap_use_pt(pmap_t, vm_offset_t);
|
||||
void pmap_debug(int);
|
||||
void pmap_map_section(vm_offset_t, vm_offset_t, vm_offset_t, int, int);
|
||||
void pmap_link_l2pt(vm_offset_t, vm_offset_t, struct pv_addr *);
|
||||
vm_size_t pmap_map_chunk(vm_offset_t, vm_offset_t, vm_offset_t, vm_size_t, int, int);
|
||||
void
|
||||
pmap_map_entry(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa, int prot,
|
||||
int cache);
|
||||
int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t, int);
|
||||
void *pmap_kenter_temporary(vm_paddr_t, int);
|
||||
#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0)
|
||||
void pmap_page_set_memattr(vm_page_t, vm_memattr_t);
|
||||
|
||||
/*
|
||||
* Definitions for MMU domains
|
||||
*/
|
||||
#define PMAP_DOMAINS 15 /* 15 'user' domains (1-15) */
|
||||
#define PMAP_DOMAIN_KERNEL 0 /* The kernel uses domain #0 */
|
||||
void *pmap_mapdev(vm_paddr_t, vm_size_t);
|
||||
void pmap_unmapdev(vm_offset_t, vm_size_t);
|
||||
|
||||
/*
|
||||
* The new pmap ensures that page-tables are always mapping Write-Thru.
|
||||
* Thus, on some platforms we can run fast and loose and avoid syncing PTEs
|
||||
* on every change.
|
||||
*
|
||||
* Unfortunately, not all CPUs have a write-through cache mode. So we
|
||||
* define PMAP_NEEDS_PTE_SYNC for C code to conditionally do PTE syncs,
|
||||
* and if there is the chance for PTE syncs to be needed, we define
|
||||
* PMAP_INCLUDE_PTE_SYNC so e.g. assembly code can include (and run)
|
||||
* the code.
|
||||
*/
|
||||
extern int pmap_needs_pte_sync;
|
||||
struct pcb;
|
||||
void pmap_set_pcb_pagedir(pmap_t, struct pcb *);
|
||||
|
||||
/*
|
||||
* These macros define the various bit masks in the PTE.
|
||||
*
|
||||
* We use these macros since we use different bits on different processor
|
||||
* models.
|
||||
*/
|
||||
void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
|
||||
void pmap_kremove_device(vm_offset_t, vm_size_t);
|
||||
|
||||
#define L1_S_CACHE_MASK_generic (L1_S_B|L1_S_C)
|
||||
#define L1_S_CACHE_MASK_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X)|\
|
||||
L1_S_XSCALE_TEX(TEX_XSCALE_T))
|
||||
vm_paddr_t pmap_kextract(vm_offset_t);
|
||||
#define vtophys(va) pmap_kextract((vm_offset_t)(va))
|
||||
|
||||
#define L2_L_CACHE_MASK_generic (L2_B|L2_C)
|
||||
#define L2_L_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X) | \
|
||||
L2_XSCALE_L_TEX(TEX_XSCALE_T))
|
||||
|
||||
#define L2_S_PROT_U_generic (L2_AP(AP_U))
|
||||
#define L2_S_PROT_W_generic (L2_AP(AP_W))
|
||||
#define L2_S_PROT_MASK_generic (L2_S_PROT_U|L2_S_PROT_W)
|
||||
|
||||
#define L2_S_PROT_U_xscale (L2_AP0(AP_U))
|
||||
#define L2_S_PROT_W_xscale (L2_AP0(AP_W))
|
||||
#define L2_S_PROT_MASK_xscale (L2_S_PROT_U|L2_S_PROT_W)
|
||||
|
||||
#define L2_S_CACHE_MASK_generic (L2_B|L2_C)
|
||||
#define L2_S_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X)| \
|
||||
L2_XSCALE_T_TEX(TEX_XSCALE_X))
|
||||
|
||||
#define L1_S_PROTO_generic (L1_TYPE_S | L1_S_IMP)
|
||||
#define L1_S_PROTO_xscale (L1_TYPE_S)
|
||||
|
||||
#define L1_C_PROTO_generic (L1_TYPE_C | L1_C_IMP2)
|
||||
#define L1_C_PROTO_xscale (L1_TYPE_C)
|
||||
|
||||
#define L2_L_PROTO (L2_TYPE_L)
|
||||
|
||||
#define L2_S_PROTO_generic (L2_TYPE_S)
|
||||
#define L2_S_PROTO_xscale (L2_TYPE_XSCALE_XS)
|
||||
|
||||
/*
|
||||
* User-visible names for the ones that vary with MMU class.
|
||||
*/
|
||||
#define L2_AP(x) (L2_AP0(x) | L2_AP1(x) | L2_AP2(x) | L2_AP3(x))
|
||||
|
||||
#if ARM_NMMUS > 1
|
||||
/* More than one MMU class configured; use variables. */
|
||||
#define L2_S_PROT_U pte_l2_s_prot_u
|
||||
#define L2_S_PROT_W pte_l2_s_prot_w
|
||||
#define L2_S_PROT_MASK pte_l2_s_prot_mask
|
||||
|
||||
#define L1_S_CACHE_MASK pte_l1_s_cache_mask
|
||||
#define L2_L_CACHE_MASK pte_l2_l_cache_mask
|
||||
#define L2_S_CACHE_MASK pte_l2_s_cache_mask
|
||||
|
||||
#define L1_S_PROTO pte_l1_s_proto
|
||||
#define L1_C_PROTO pte_l1_c_proto
|
||||
#define L2_S_PROTO pte_l2_s_proto
|
||||
|
||||
#elif ARM_MMU_GENERIC != 0
|
||||
#define L2_S_PROT_U L2_S_PROT_U_generic
|
||||
#define L2_S_PROT_W L2_S_PROT_W_generic
|
||||
#define L2_S_PROT_MASK L2_S_PROT_MASK_generic
|
||||
|
||||
#define L1_S_CACHE_MASK L1_S_CACHE_MASK_generic
|
||||
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic
|
||||
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic
|
||||
|
||||
#define L1_S_PROTO L1_S_PROTO_generic
|
||||
#define L1_C_PROTO L1_C_PROTO_generic
|
||||
#define L2_S_PROTO L2_S_PROTO_generic
|
||||
|
||||
#elif ARM_MMU_XSCALE == 1
|
||||
#define L2_S_PROT_U L2_S_PROT_U_xscale
|
||||
#define L2_S_PROT_W L2_S_PROT_W_xscale
|
||||
#define L2_S_PROT_MASK L2_S_PROT_MASK_xscale
|
||||
|
||||
#define L1_S_CACHE_MASK L1_S_CACHE_MASK_xscale
|
||||
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale
|
||||
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale
|
||||
|
||||
#define L1_S_PROTO L1_S_PROTO_xscale
|
||||
#define L1_C_PROTO L1_C_PROTO_xscale
|
||||
#define L2_S_PROTO L2_S_PROTO_xscale
|
||||
|
||||
#endif /* ARM_NMMUS > 1 */
|
||||
|
||||
#if defined(CPU_XSCALE_81342)
|
||||
#define PMAP_NEEDS_PTE_SYNC 1
|
||||
#define PMAP_INCLUDE_PTE_SYNC
|
||||
#else
|
||||
#define PMAP_NEEDS_PTE_SYNC 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These macros return various bits based on kernel/user and protection.
|
||||
* Note that the compiler will usually fold these at compile time.
|
||||
*/
|
||||
#define L1_S_PROT_U (L1_S_AP(AP_U))
|
||||
#define L1_S_PROT_W (L1_S_AP(AP_W))
|
||||
#define L1_S_PROT_MASK (L1_S_PROT_U|L1_S_PROT_W)
|
||||
#define L1_S_WRITABLE(pd) ((pd) & L1_S_PROT_W)
|
||||
|
||||
#define L1_S_PROT(ku, pr) ((((ku) == PTE_USER) ? L1_S_PROT_U : 0) | \
|
||||
(((pr) & VM_PROT_WRITE) ? L1_S_PROT_W : 0))
|
||||
|
||||
#define L2_L_PROT_U (L2_AP(AP_U))
|
||||
#define L2_L_PROT_W (L2_AP(AP_W))
|
||||
#define L2_L_PROT_MASK (L2_L_PROT_U|L2_L_PROT_W)
|
||||
|
||||
#define L2_L_PROT(ku, pr) ((((ku) == PTE_USER) ? L2_L_PROT_U : 0) | \
|
||||
(((pr) & VM_PROT_WRITE) ? L2_L_PROT_W : 0))
|
||||
|
||||
#define L2_S_PROT(ku, pr) ((((ku) == PTE_USER) ? L2_S_PROT_U : 0) | \
|
||||
(((pr) & VM_PROT_WRITE) ? L2_S_PROT_W : 0))
|
||||
|
||||
/*
|
||||
* Macros to test if a mapping is mappable with an L1 Section mapping
|
||||
* or an L2 Large Page mapping.
|
||||
*/
|
||||
#define L1_S_MAPPABLE_P(va, pa, size) \
|
||||
((((va) | (pa)) & L1_S_OFFSET) == 0 && (size) >= L1_S_SIZE)
|
||||
|
||||
#define L2_L_MAPPABLE_P(va, pa, size) \
|
||||
((((va) | (pa)) & L2_L_OFFSET) == 0 && (size) >= L2_L_SIZE)
|
||||
|
||||
/*
|
||||
* Provide a fallback in case we were not able to determine it at
|
||||
* compile-time.
|
||||
*/
|
||||
#ifndef PMAP_NEEDS_PTE_SYNC
|
||||
#define PMAP_NEEDS_PTE_SYNC pmap_needs_pte_sync
|
||||
#define PMAP_INCLUDE_PTE_SYNC
|
||||
#endif
|
||||
|
||||
#ifdef ARM_L2_PIPT
|
||||
#define _sync_l2(pte, size) cpu_l2cache_wb_range(vtophys(pte), size)
|
||||
#else
|
||||
#define _sync_l2(pte, size) cpu_l2cache_wb_range(pte, size)
|
||||
#endif
|
||||
|
||||
#define PTE_SYNC(pte) \
|
||||
do { \
|
||||
if (PMAP_NEEDS_PTE_SYNC) { \
|
||||
cpu_dcache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\
|
||||
cpu_drain_writebuf(); \
|
||||
_sync_l2((vm_offset_t)(pte), sizeof(pt_entry_t));\
|
||||
} else \
|
||||
cpu_drain_writebuf(); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define PTE_SYNC_RANGE(pte, cnt) \
|
||||
do { \
|
||||
if (PMAP_NEEDS_PTE_SYNC) { \
|
||||
cpu_dcache_wb_range((vm_offset_t)(pte), \
|
||||
(cnt) << 2); /* * sizeof(pt_entry_t) */ \
|
||||
cpu_drain_writebuf(); \
|
||||
_sync_l2((vm_offset_t)(pte), \
|
||||
(cnt) << 2); /* * sizeof(pt_entry_t) */ \
|
||||
} else \
|
||||
cpu_drain_writebuf(); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
extern pt_entry_t pte_l1_s_cache_mode;
|
||||
extern pt_entry_t pte_l1_s_cache_mask;
|
||||
|
||||
extern pt_entry_t pte_l2_l_cache_mode;
|
||||
extern pt_entry_t pte_l2_l_cache_mask;
|
||||
|
||||
extern pt_entry_t pte_l2_s_cache_mode;
|
||||
extern pt_entry_t pte_l2_s_cache_mask;
|
||||
|
||||
extern pt_entry_t pte_l1_s_cache_mode_pt;
|
||||
extern pt_entry_t pte_l2_l_cache_mode_pt;
|
||||
extern pt_entry_t pte_l2_s_cache_mode_pt;
|
||||
|
||||
extern pt_entry_t pte_l2_s_prot_u;
|
||||
extern pt_entry_t pte_l2_s_prot_w;
|
||||
extern pt_entry_t pte_l2_s_prot_mask;
|
||||
|
||||
extern pt_entry_t pte_l1_s_proto;
|
||||
extern pt_entry_t pte_l1_c_proto;
|
||||
extern pt_entry_t pte_l2_s_proto;
|
||||
|
||||
extern void (*pmap_copy_page_func)(vm_paddr_t, vm_paddr_t);
|
||||
extern void (*pmap_copy_page_offs_func)(vm_paddr_t a_phys,
|
||||
vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, int cnt);
|
||||
extern void (*pmap_zero_page_func)(vm_paddr_t, int, int);
|
||||
|
||||
#if ARM_MMU_GENERIC != 0 || defined(CPU_XSCALE_81342)
|
||||
void pmap_copy_page_generic(vm_paddr_t, vm_paddr_t);
|
||||
void pmap_zero_page_generic(vm_paddr_t, int, int);
|
||||
|
||||
void pmap_pte_init_generic(void);
|
||||
#endif /* ARM_MMU_GENERIC != 0 */
|
||||
|
||||
#if ARM_MMU_XSCALE == 1
|
||||
void pmap_copy_page_xscale(vm_paddr_t, vm_paddr_t);
|
||||
void pmap_zero_page_xscale(vm_paddr_t, int, int);
|
||||
|
||||
void pmap_pte_init_xscale(void);
|
||||
|
||||
void xscale_setup_minidata(vm_offset_t, vm_offset_t, vm_offset_t);
|
||||
|
||||
void pmap_use_minicache(vm_offset_t, vm_size_t);
|
||||
#endif /* ARM_MMU_XSCALE == 1 */
|
||||
#if defined(CPU_XSCALE_81342)
|
||||
#define ARM_HAVE_SUPERSECTIONS
|
||||
#endif
|
||||
|
||||
#define PTE_KERNEL 0
|
||||
#define PTE_USER 1
|
||||
#define l1pte_valid(pde) ((pde) != 0)
|
||||
#define l1pte_section_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_S)
|
||||
#define l1pte_page_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_C)
|
||||
#define l1pte_fpage_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_F)
|
||||
|
||||
#define l2pte_index(v) (((v) & L2_ADDR_BITS) >> L2_S_SHIFT)
|
||||
#define l2pte_valid(pte) ((pte) != 0)
|
||||
#define l2pte_pa(pte) ((pte) & L2_S_FRAME)
|
||||
#define l2pte_minidata(pte) (((pte) & \
|
||||
(L2_B | L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X)))\
|
||||
== (L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X)))
|
||||
|
||||
/* L1 and L2 page table macros */
|
||||
#define pmap_pde_v(pde) l1pte_valid(*(pde))
|
||||
#define pmap_pde_section(pde) l1pte_section_p(*(pde))
|
||||
#define pmap_pde_page(pde) l1pte_page_p(*(pde))
|
||||
#define pmap_pde_fpage(pde) l1pte_fpage_p(*(pde))
|
||||
|
||||
#define pmap_pte_v(pte) l2pte_valid(*(pte))
|
||||
#define pmap_pte_pa(pte) l2pte_pa(*(pte))
|
||||
|
||||
/*
|
||||
* Flags that indicate attributes of pages or mappings of pages.
|
||||
*
|
||||
* The PVF_MOD and PVF_REF flags are stored in the mdpage for each
|
||||
* page. PVF_WIRED, PVF_WRITE, and PVF_NC are kept in individual
|
||||
* pv_entry's for each page. They live in the same "namespace" so
|
||||
* that we can clear multiple attributes at a time.
|
||||
*
|
||||
* Note the "non-cacheable" flag generally means the page has
|
||||
* multiple mappings in a given address space.
|
||||
*/
|
||||
#define PVF_MOD 0x01 /* page is modified */
|
||||
#define PVF_REF 0x02 /* page is referenced */
|
||||
#define PVF_WIRED 0x04 /* mapping is wired */
|
||||
#define PVF_WRITE 0x08 /* mapping is writable */
|
||||
#define PVF_EXEC 0x10 /* mapping is executable */
|
||||
#define PVF_NC 0x20 /* mapping is non-cacheable */
|
||||
#define PVF_MWC 0x40 /* mapping is used multiple times in userland */
|
||||
#define PVF_UNMAN 0x80 /* mapping is unmanaged */
|
||||
|
||||
void vector_page_setprot(int);
|
||||
|
||||
#define SECTION_CACHE 0x1
|
||||
#define SECTION_PT 0x2
|
||||
void pmap_kenter_section(vm_offset_t, vm_paddr_t, int flags);
|
||||
#ifdef ARM_HAVE_SUPERSECTIONS
|
||||
void pmap_kenter_supersection(vm_offset_t, uint64_t, int flags);
|
||||
#endif
|
||||
|
||||
extern char *_tmppt;
|
||||
|
||||
void pmap_postinit(void);
|
||||
|
||||
extern vm_paddr_t dump_avail[];
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !LOCORE */
|
||||
|
||||
#endif /* !_MACHINE_PMAP_H_ */
|
||||
#endif /* __ARM_ARCH >= 6 */
|
||||
|
@ -33,14 +33,9 @@
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#include <machine/acle-compat.h>
|
||||
|
||||
#if __ARM_ARCH >= 6
|
||||
#include <machine/pte-v6.h>
|
||||
#else /* __ARM_ARCH >= 6 */
|
||||
|
||||
#ifndef _MACHINE_PTE_H_
|
||||
#define _MACHINE_PTE_H_
|
||||
#ifndef _MACHINE_PTE_V4_H_
|
||||
#define _MACHINE_PTE_V4_H_
|
||||
|
||||
#ifndef LOCORE
|
||||
typedef uint32_t pd_entry_t; /* page directory entry */
|
||||
@ -72,10 +67,6 @@ typedef pt_entry_t pt2_entry_t; /* compatibility with v6 */
|
||||
#define L2_MASK 0x03 /* Mask for L2 entry type */
|
||||
#define L2_INVAL 0x00 /* L2 invalid type */
|
||||
|
||||
/* L1 and L2 address masks */
|
||||
#define L1_ADDR_MASK 0xfffffc00
|
||||
#define L2_ADDR_MASK 0xfffff000
|
||||
|
||||
/*
|
||||
* The ARM MMU architecture was introduced with ARM v3 (previous ARM
|
||||
* architecture versions used an optional off-CPU memory controller
|
||||
@ -152,9 +143,6 @@ typedef pt_entry_t pt2_entry_t; /* compatibility with v6 */
|
||||
* So, we allocate L2 tables 4 at a time, thus yielding a 4K L2
|
||||
* table.
|
||||
*/
|
||||
#define L1_ADDR_BITS 0xfff00000 /* L1 PTE address bits */
|
||||
#define L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */
|
||||
|
||||
#define L1_TABLE_SIZE 0x4000 /* 16K */
|
||||
#define L2_TABLE_SIZE 0x1000 /* 4K */
|
||||
/*
|
||||
@ -357,7 +345,6 @@ typedef pt_entry_t pt2_entry_t; /* compatibility with v6 */
|
||||
* 1 X 1 1 0 Y Y WT Y Y
|
||||
* 1 X 1 1 1 Y Y WT Y Y
|
||||
*/
|
||||
#endif /* !_MACHINE_PTE_H_ */
|
||||
#endif /* __ARM_ARCH >= 6 */
|
||||
#endif /* !_MACHINE_PTE_V4_H_ */
|
||||
|
||||
/* End of pte.h */
|
@ -27,8 +27,8 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_PTE_H_
|
||||
#define _MACHINE_PTE_H_
|
||||
#ifndef _MACHINE_PTE_V6_H_
|
||||
#define _MACHINE_PTE_V6_H_
|
||||
|
||||
/*
|
||||
* Domain Types for the Domain Access Control Register.
|
||||
@ -288,41 +288,4 @@
|
||||
#define PTE2_KERN(pa, ap, attr) PTE2(pa, (ap) | PTE2_A | PTE2_G, attr)
|
||||
#define PTE2_KERN_NG(pa, ap, attr) PTE2(pa, (ap) | PTE2_A | PTE2_NG, attr)
|
||||
|
||||
|
||||
// ----------------- TO BE DELETED ---------------------------------------------
|
||||
|
||||
/*
|
||||
* sys/arm/arm/elf_trampoline.c
|
||||
*/
|
||||
#define AP_KRW 0x01 /* kernel read/write */
|
||||
|
||||
/*
|
||||
* lib/libkvm/kvm_arm.c
|
||||
*/
|
||||
#define L1_ADDR_MASK 0xfffffc00
|
||||
|
||||
/*
|
||||
* lib/libkvm/kvm_arm.c
|
||||
*/
|
||||
#define L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */
|
||||
|
||||
#ifndef LOCORE
|
||||
/*
|
||||
* sys/arm/arm/minidump_machdep.c
|
||||
* sys/arm/arm/pmap.c
|
||||
* sys/arm/arm/pmap.h (hack for our hack in pmap.h )
|
||||
* lib/libkvm/kvm_arm.c
|
||||
*/
|
||||
typedef uint32_t pd_entry_t; /* page directory entry */
|
||||
|
||||
/*
|
||||
* sys/arm/arm/minidump_machdep.c
|
||||
* sys/arm/arm/pmap.c
|
||||
* sys/arm/arm/pmap.h (hack for our hack in pmap.h )
|
||||
* sys/arm/include/param.h
|
||||
*/
|
||||
typedef uint32_t pt_entry_t; /* page table entry */
|
||||
#endif
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#endif /* !_MACHINE_PTE_H_ */
|
||||
#endif /* !_MACHINE_PTE_V6_H_ */
|
||||
|
@ -2,5 +2,3 @@
|
||||
|
||||
makeoptions KERNVIRTADDR=0xc0200000
|
||||
options KERNVIRTADDR=0xc0200000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
@ -341,7 +341,7 @@ localbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
* Request for the default allocation with a given rid: use resource
|
||||
* list stored in the local device info.
|
||||
*/
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
if ((di = device_get_ivars(child)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
@ -61,8 +61,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <dev/fdt/fdt_common.h>
|
||||
#include <dev/ofw/ofw_bus.h>
|
||||
#include <dev/ofw/ofw_pci.h>
|
||||
#include <dev/ofw/ofw_bus_subr.h>
|
||||
#include <dev/ofw/ofw_pci.h>
|
||||
#include <dev/pci/pcivar.h>
|
||||
#include <dev/pci/pcireg.h>
|
||||
#include <dev/pci/pcib_private.h>
|
||||
@ -844,7 +844,7 @@ mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
type, rid, start, end, count, flags));
|
||||
};
|
||||
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
start = sc->sc_mem_base;
|
||||
end = sc->sc_mem_base + sc->sc_mem_size - 1;
|
||||
count = sc->sc_mem_size;
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include <machine/bus.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <machine/vm.h>
|
||||
|
||||
#include <dev/ofw/openfirm.h>
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
machine arm armv6
|
||||
cpu CPU_CORTEXA
|
||||
makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options KERNVIRTADDR = 0xc1000000
|
||||
makeoptions KERNVIRTADDR = 0xc1000000
|
||||
|
@ -8,8 +8,6 @@ makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
makeoptions KERNVIRTADDR=0xc0400000
|
||||
options KERNVIRTADDR=0xc0400000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options IPI_IRQ_START=0
|
||||
options IPI_IRQ_END=15
|
||||
|
||||
|
@ -7,8 +7,6 @@ makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
makeoptions KERNVIRTADDR=0xc0f00000
|
||||
options KERNVIRTADDR=0xc0f00000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options IPI_IRQ_START=0
|
||||
options IPI_IRQ_END=15
|
||||
|
||||
|
@ -7,8 +7,6 @@ makeoptions CONF_CFLAGS="-march=armv7a"
|
||||
makeoptions KERNVIRTADDR=0xc0f00000
|
||||
options KERNVIRTADDR=0xc0f00000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options IPI_IRQ_START=0
|
||||
options IPI_IRQ_END=15
|
||||
|
||||
|
@ -7,5 +7,3 @@ options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm
|
||||
makeoptions KERNVIRTADDR=0xc0200000
|
||||
|
||||
options SOC_TI_AM335X
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
@ -7,5 +7,3 @@ options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm
|
||||
makeoptions KERNVIRTADDR=0xc0200000
|
||||
|
||||
options SOC_OMAP4
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
@ -12,7 +12,5 @@ files "../xilinx/files.zynq7"
|
||||
options KERNVIRTADDR=0xc0100000 # Used in ldscript.arm
|
||||
makeoptions KERNVIRTADDR=0xc0100000
|
||||
|
||||
options ARM_L2_PIPT
|
||||
|
||||
options IPI_IRQ_START=0
|
||||
options IPI_IRQ_END=15
|
||||
|
@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/debug_monitor.h>
|
||||
#include <machine/kdb.h>
|
||||
#include <machine/param.h>
|
||||
|
||||
#include <ddb/ddb.h>
|
||||
#include <ddb/db_sym.h>
|
||||
|
@ -211,7 +211,7 @@ arm_gic_fdt_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
* Request for the default allocation with a given rid: use resource
|
||||
* list stored in the local device info.
|
||||
*/
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
if ((di = device_get_ivars(child)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/bus.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/rman.h>
|
||||
|
||||
#include <machine/resource.h>
|
||||
|
||||
@ -180,7 +181,7 @@ gic_v3_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
|
||||
struct resource_list_entry *rle;
|
||||
int ranges_len;
|
||||
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
if ((di = device_get_ivars(child)) == NULL)
|
||||
return (NULL);
|
||||
if (type != SYS_RES_MEMORY)
|
||||
|
@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "gic_v3_reg.h"
|
||||
#include "gic_v3_var.h"
|
||||
|
||||
#define GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET 144
|
||||
#define GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET 88
|
||||
|
||||
#include "pic_if.h"
|
||||
|
||||
|
@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <vm/pmap.h>
|
||||
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/pte.h>
|
||||
#include <machine/vmparam.h>
|
||||
#include <machine/minidump.h>
|
||||
|
||||
CTASSERT(sizeof(struct kerneldumpheader) == 512);
|
||||
|
@ -113,6 +113,7 @@ static int nexus_deactivate_resource(device_t, device_t, int, int,
|
||||
static int nexus_setup_intr(device_t dev, device_t child, struct resource *res,
|
||||
int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep);
|
||||
static int nexus_teardown_intr(device_t, device_t, struct resource *, void *);
|
||||
static bus_space_tag_t nexus_get_bus_tag(device_t, device_t);
|
||||
#ifdef SMP
|
||||
static int nexus_bind_intr(device_t, device_t, struct resource *, int);
|
||||
#endif
|
||||
@ -134,6 +135,7 @@ static device_method_t nexus_methods[] = {
|
||||
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
|
||||
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
|
||||
DEVMETHOD(bus_teardown_intr, nexus_teardown_intr),
|
||||
DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag),
|
||||
#ifdef SMP
|
||||
DEVMETHOD(bus_bind_intr, nexus_bind_intr),
|
||||
#endif
|
||||
@ -221,7 +223,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
* (ie. they aren't maintained by a child bus), then work out
|
||||
* the start/end values.
|
||||
*/
|
||||
if ((start == 0UL) && (end == ~0UL) && (count == 1)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
|
||||
if (device_get_parent(child) != bus || ndev == NULL)
|
||||
return(NULL);
|
||||
rle = resource_list_find(&ndev->nx_resources, type, *rid);
|
||||
@ -307,6 +309,13 @@ nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu)
|
||||
}
|
||||
#endif
|
||||
|
||||
static bus_space_tag_t
|
||||
nexus_get_bus_tag(device_t bus __unused, device_t child __unused)
|
||||
{
|
||||
|
||||
return(&memmap_bus);
|
||||
}
|
||||
|
||||
static int
|
||||
nexus_activate_resource(device_t bus, device_t child, int type, int rid,
|
||||
struct resource *r)
|
||||
|
@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/frame.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/pcpu.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
#include <sys/dtrace_bsd.h>
|
||||
|
@ -292,7 +292,7 @@ thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
type, rid, start, end, count, flags));
|
||||
};
|
||||
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
|
||||
/* Read BAR manually to get resource address and size */
|
||||
pci_read_bar(child, *rid, &map, &testval, NULL);
|
||||
|
@ -283,7 +283,7 @@ thunder_pcie_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
|
||||
|
||||
sc = device_get_softc(bus);
|
||||
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
if ((di = device_get_ivars(child)) == NULL)
|
||||
return (NULL);
|
||||
if (type == SYS_RES_IOPORT)
|
||||
|
@ -435,7 +435,7 @@ thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
end, count, flags));
|
||||
};
|
||||
|
||||
if ((start == 0UL) && (end == ~0UL)) {
|
||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) {
|
||||
device_printf(dev,
|
||||
"Cannot allocate resource with unspecified range\n");
|
||||
goto fail;
|
||||
|
@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <machine/frame.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#include <compat/cloudabi/cloudabi_util.h>
|
||||
|
@ -113,7 +113,8 @@ boot1.efifat: boot1.efi
|
||||
uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu
|
||||
mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2
|
||||
bzip2 -f -d ${.TARGET}.bz2
|
||||
dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
|
||||
dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc \
|
||||
status=none
|
||||
|
||||
CLEANFILES= boot1.efi boot1.efifat
|
||||
|
||||
|
@ -46,7 +46,6 @@ int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *, uint64_t *);
|
||||
int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t);
|
||||
|
||||
int efi_status_to_errno(EFI_STATUS);
|
||||
time_t efi_time(EFI_TIME *);
|
||||
|
||||
EFI_STATUS main(int argc, CHAR16 *argv[]);
|
||||
void exit(EFI_STATUS status);
|
||||
|
@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define SECSPERHOUR ( 60*60 )
|
||||
#define SECSPERDAY (24 * SECSPERHOUR)
|
||||
|
||||
time_t
|
||||
static time_t
|
||||
efi_time(EFI_TIME *ETime)
|
||||
{
|
||||
/*
|
||||
@ -164,7 +164,7 @@ efi_time(EFI_TIME *ETime)
|
||||
return UTime;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
EFI_GetTimeOfDay(
|
||||
OUT struct timeval *tp,
|
||||
OUT struct timezone *tzp
|
||||
|
@ -117,6 +117,8 @@ elf64_exec(struct preloaded_file *fp)
|
||||
if (err != 0)
|
||||
return (err);
|
||||
|
||||
dev_cleanup();
|
||||
|
||||
/* Clean D-cache under kernel area and invalidate whole I-cache */
|
||||
clean_addr = (vm_offset_t)efi_translate(fp->f_addr);
|
||||
clean_size = (vm_offset_t)efi_translate(kernendp) - clean_addr;
|
||||
|
@ -72,14 +72,14 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
|
||||
boot2: boot2.ld
|
||||
@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
|
||||
echo "$$x bytes available"; test $$x -ge 0
|
||||
dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync
|
||||
dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync status=none
|
||||
|
||||
boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
|
||||
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
|
||||
-o ${.TARGET} -P 1 boot2.bin
|
||||
|
||||
boot2.ldr:
|
||||
dd if=/dev/zero of=${.TARGET} bs=512 count=1
|
||||
dd if=/dev/zero of=${.TARGET} bs=512 count=1 status=none
|
||||
|
||||
boot2.bin: boot2.out
|
||||
${OBJCOPY} -S -O binary boot2.out ${.TARGET}
|
||||
|
@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp
|
||||
|
||||
${BOOT}: ${LDR} ${LOADER}
|
||||
cat ${LDR} ${LOADER} > ${.TARGET}.tmp
|
||||
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
|
||||
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none
|
||||
rm ${.TARGET}.tmp
|
||||
|
||||
LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
|
||||
|
@ -65,7 +65,7 @@ BOOT2SIZE= 65536
|
||||
zfsboot2: zfsboot.ld
|
||||
@set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \
|
||||
echo "$$x bytes available"; test $$x -ge 0
|
||||
dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync
|
||||
dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync status=none
|
||||
|
||||
zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
|
||||
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \
|
||||
|
@ -3228,7 +3228,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
|
||||
softc->state = DA_STATE_PROBE_RC;
|
||||
xpt_schedule(periph, priority);
|
||||
return;
|
||||
} else
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach to anything that claims to be a
|
||||
* direct access or optical disk device,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user