Merging ^/head r278916 through r279022.
This commit is contained in:
commit
0d36d957d3
@ -343,16 +343,15 @@ WMAKEENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \
|
||||
SIZE="${XSIZE}"
|
||||
|
||||
.if ${XCC:M/*}
|
||||
XFLAGS= --sysroot=${WORLDTMP}
|
||||
.if defined(CROSS_BINUTILS_PREFIX)
|
||||
# In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
|
||||
# directory, but the compiler will look in the right place for it's
|
||||
# tools so we don't need to tell it where to look.
|
||||
.if exists(${CROSS_BINUTILS_PREFIX})
|
||||
XFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
||||
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
||||
.endif
|
||||
.else
|
||||
XFLAGS+= -B${WORLDTMP}/usr/bin
|
||||
BFLAGS+= -B${WORLDTMP}/usr/bin
|
||||
.endif
|
||||
.if ${TARGET} == "arm"
|
||||
.if ${TARGET_ARCH:M*hf*} != ""
|
||||
@ -369,6 +368,8 @@ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1
|
||||
TARGET_ABI?= unknown
|
||||
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
|
||||
XCFLAGS+= -target ${TARGET_TRIPLE}
|
||||
XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
||||
XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
||||
.endif
|
||||
.endif
|
||||
|
||||
@ -912,25 +913,25 @@ packageworld:
|
||||
.for dist in base ${EXTRA_DISTRIBUTIONS}
|
||||
.if defined(NO_ROOT)
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \
|
||||
--exclude usr/lib/debug \
|
||||
@${DESTDIR}/${DISTDIR}/${dist}.meta
|
||||
tar cvf - --exclude usr/lib/debug \
|
||||
@${DESTDIR}/${DISTDIR}/${dist}.meta | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz
|
||||
.else
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \
|
||||
--exclude usr/lib/debug .
|
||||
tar cvf - --exclude usr/lib/debug . | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.for dist in ${DEBUG_DISTRIBUTIONS}
|
||||
. if defined(NO_ROOT)
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \
|
||||
@${DESTDIR}/${DISTDIR}/${dist}.debug.meta
|
||||
tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz
|
||||
. else
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJLf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \
|
||||
usr/lib/debug
|
||||
tar cvLf - usr/lib/debug | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz
|
||||
. endif
|
||||
.endfor
|
||||
|
||||
@ -1138,19 +1139,21 @@ distributekernel distributekernel.debug:
|
||||
packagekernel:
|
||||
.if defined(NO_ROOT)
|
||||
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz \
|
||||
@${DESTDIR}/${DISTDIR}/kernel.meta
|
||||
tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz
|
||||
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
|
||||
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz \
|
||||
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
|
||||
tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz
|
||||
.endfor
|
||||
.else
|
||||
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz .
|
||||
tar cvf - . | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz
|
||||
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
|
||||
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .
|
||||
tar cvf - . | \
|
||||
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
@ -1244,11 +1247,6 @@ _m4= lib/libohash \
|
||||
usr.bin/m4
|
||||
.endif
|
||||
|
||||
.if ${BOOTSTRAPPING} < 1000013
|
||||
_yacc= lib/liby \
|
||||
usr.bin/yacc
|
||||
.endif
|
||||
|
||||
.if ${BOOTSTRAPPING} < 1000014
|
||||
_crunch= usr.sbin/crunch
|
||||
.endif
|
||||
@ -1270,6 +1268,11 @@ _lex= usr.bin/lex
|
||||
_awk= usr.bin/awk
|
||||
.endif
|
||||
|
||||
.if ${BOOTSTRAPPING} < 1001506
|
||||
_yacc= lib/liby \
|
||||
usr.bin/yacc
|
||||
.endif
|
||||
|
||||
.if ${MK_BSNMP} != "no"
|
||||
_gensnmptree= usr.sbin/bsnmpd/gensnmptree
|
||||
.endif
|
||||
|
8
UPDATING
8
UPDATING
@ -34,6 +34,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
|
||||
2015mmdd:
|
||||
Clang and llvm have been upgraded to 3.6.0 release.
|
||||
|
||||
20150217:
|
||||
If you are running a -CURRENT kernel since r273872 (Oct 30th, 2014),
|
||||
but before r278950, the RNG was not seeded properly. Immediately
|
||||
upgrade the kernel to r278950 or later and regenerate any keys (e.g.
|
||||
ssh keys or openssl keys) that were generated w/ a kernel from that
|
||||
range. This does not effect programs that directly used /dev/random
|
||||
or /dev/urandom. All userland uses of arc4random(3) are affected.
|
||||
|
||||
20150210:
|
||||
The autofs(4) ABI was changed in order to restore binary compatibility
|
||||
with 10.1-RELEASE. The automountd(8) daemon needs to be rebuilt to work
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <libelf.h>
|
||||
#include <gelf.h>
|
||||
|
||||
/*
|
||||
* In Solaris 10 GA, the only mechanism for communicating helper information
|
||||
@ -62,9 +61,7 @@ static const char *olddevname = "/devices/pseudo/dtrace@0:helper";
|
||||
|
||||
static const char *modname; /* Name of this load object */
|
||||
static int gen; /* DOF helper generation */
|
||||
#ifdef illumos
|
||||
extern dof_hdr_t __SUNW_dof; /* DOF defined in the .SUNW_dof section */
|
||||
#endif
|
||||
static boolean_t dof_init_debug = B_FALSE; /* From DTRACE_DOF_INIT_DEBUG */
|
||||
|
||||
static void
|
||||
@ -99,11 +96,7 @@ static void dtrace_dof_init(void) __attribute__ ((constructor));
|
||||
static void
|
||||
dtrace_dof_init(void)
|
||||
{
|
||||
#ifdef illumos
|
||||
dof_hdr_t *dof = &__SUNW_dof;
|
||||
#else
|
||||
dof_hdr_t *dof = NULL;
|
||||
#endif
|
||||
#ifdef _LP64
|
||||
Elf64_Ehdr *elf;
|
||||
#else
|
||||
@ -118,17 +111,6 @@ dtrace_dof_init(void)
|
||||
#endif
|
||||
int fd;
|
||||
const char *p;
|
||||
#ifndef illumos
|
||||
Elf *e;
|
||||
Elf_Scn *scn = NULL;
|
||||
Elf_Data *dofdata = NULL;
|
||||
dof_hdr_t *dof_next = NULL;
|
||||
GElf_Shdr shdr;
|
||||
int efd;
|
||||
char *s;
|
||||
size_t shstridx;
|
||||
uint64_t aligned_filesz;
|
||||
#endif
|
||||
|
||||
if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL)
|
||||
return;
|
||||
@ -152,42 +134,6 @@ dtrace_dof_init(void)
|
||||
modname = lmp->l_name;
|
||||
else
|
||||
modname++;
|
||||
#ifndef illumos
|
||||
elf_version(EV_CURRENT);
|
||||
if ((efd = open(lmp->l_name, O_RDONLY, 0)) < 0) {
|
||||
dprintf(1, "couldn't open file for reading\n");
|
||||
return;
|
||||
}
|
||||
if ((e = elf_begin(efd, ELF_C_READ, NULL)) == NULL) {
|
||||
dprintf(1, "elf_begin failed\n");
|
||||
close(efd);
|
||||
return;
|
||||
}
|
||||
elf_getshdrstrndx(e, &shstridx);
|
||||
dof = NULL;
|
||||
while ((scn = elf_nextscn(e, scn)) != NULL) {
|
||||
gelf_getshdr(scn, &shdr);
|
||||
if (shdr.sh_type == SHT_SUNW_dof) {
|
||||
s = elf_strptr(e, shstridx, shdr.sh_name);
|
||||
if (s != NULL && strcmp(s, ".SUNW_dof") == 0) {
|
||||
dofdata = elf_getdata(scn, NULL);
|
||||
dof = dofdata->d_buf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dof == NULL) {
|
||||
dprintf(1, "SUNW_dof section not found\n");
|
||||
elf_end(e);
|
||||
close(efd);
|
||||
return;
|
||||
}
|
||||
|
||||
while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) {
|
||||
aligned_filesz = (shdr.sh_addralign == 0 ? dof->dofh_filesz :
|
||||
roundup2(dof->dofh_filesz, shdr.sh_addralign));
|
||||
dof_next = (void *) ((char *) dof + aligned_filesz);
|
||||
#endif
|
||||
|
||||
if (dof->dofh_ident[DOF_ID_MAG0] != DOF_MAG_MAG0 ||
|
||||
dof->dofh_ident[DOF_ID_MAG1] != DOF_MAG_MAG1 ||
|
||||
@ -237,21 +183,12 @@ dtrace_dof_init(void)
|
||||
dprintf(1, "DTrace ioctl failed for DOF at %p", dof);
|
||||
else {
|
||||
dprintf(1, "DTrace ioctl succeeded for DOF at %p\n", dof);
|
||||
#ifndef illumos
|
||||
#ifdef __FreeBSD__
|
||||
gen = dh.gen;
|
||||
#endif
|
||||
}
|
||||
|
||||
(void) close(fd);
|
||||
|
||||
#ifndef illumos
|
||||
/* End of while loop */
|
||||
dof = dof_next;
|
||||
}
|
||||
|
||||
elf_end(e);
|
||||
(void) close(efd);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef illumos
|
||||
|
@ -275,6 +275,9 @@ struct dtrace_hdl {
|
||||
int dt_cpp_argc; /* count of initialized cpp(1) arguments */
|
||||
int dt_cpp_args; /* size of dt_cpp_argv[] array */
|
||||
char *dt_ld_path; /* pathname of ld(1) to invoke if needed */
|
||||
#ifdef __FreeBSD__
|
||||
char *dt_objcopy_path; /* pathname of objcopy(1) to invoke if needed */
|
||||
#endif
|
||||
dt_list_t dt_lib_path; /* linked-list forming library search path */
|
||||
uint_t dt_lazyload; /* boolean: set via -xlazyload */
|
||||
uint_t dt_droptags; /* boolean: set via -xdroptags */
|
||||
|
@ -281,7 +281,11 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
sym->st_value = 0;
|
||||
sym->st_size = dof->dofh_filesz;
|
||||
sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT);
|
||||
#ifdef illumos
|
||||
sym->st_other = 0;
|
||||
#else
|
||||
sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN);
|
||||
#endif
|
||||
sym->st_shndx = ESHDR_DOF;
|
||||
sym++;
|
||||
|
||||
@ -471,7 +475,11 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf64_t *dep)
|
||||
sym->st_value = 0;
|
||||
sym->st_size = dof->dofh_filesz;
|
||||
sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_OBJECT);
|
||||
#ifdef illumos
|
||||
sym->st_other = 0;
|
||||
#else
|
||||
sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN);
|
||||
#endif
|
||||
sym->st_shndx = ESHDR_DOF;
|
||||
sym++;
|
||||
|
||||
@ -711,11 +719,7 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd)
|
||||
|
||||
shp = &elf_file.shdr[ESHDR_DOF];
|
||||
shp->sh_name = 11; /* DTRACE_SHSTRTAB64[11] = ".SUNW_dof" */
|
||||
#ifdef illumos
|
||||
shp->sh_flags = SHF_ALLOC;
|
||||
#else
|
||||
shp->sh_flags = SHF_WRITE | SHF_ALLOC;
|
||||
#endif
|
||||
shp->sh_type = SHT_SUNW_dof;
|
||||
shp->sh_offset = off;
|
||||
shp->sh_size = dof->dofh_filesz;
|
||||
@ -1874,7 +1878,7 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags,
|
||||
#endif
|
||||
|
||||
(void) snprintf(drti, sizeof (drti), "/usr/lib%s/dtrace/drti.o",
|
||||
use_32 ? "32":"");
|
||||
use_32 ? "32" : "");
|
||||
|
||||
len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile,
|
||||
drti) + 1;
|
||||
@ -1885,26 +1889,61 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags,
|
||||
drti);
|
||||
#endif
|
||||
if ((status = system(cmd)) == -1) {
|
||||
ret = dt_link_error(dtp, NULL, -1, NULL,
|
||||
ret = dt_link_error(dtp, NULL, fd, NULL,
|
||||
"failed to run %s: %s", dtp->dt_ld_path,
|
||||
strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (WIFSIGNALED(status)) {
|
||||
ret = dt_link_error(dtp, NULL, -1, NULL,
|
||||
ret = dt_link_error(dtp, NULL, fd, NULL,
|
||||
"failed to link %s: %s failed due to signal %d",
|
||||
file, dtp->dt_ld_path, WTERMSIG(status));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (WEXITSTATUS(status) != 0) {
|
||||
ret = dt_link_error(dtp, NULL, -1, NULL,
|
||||
ret = dt_link_error(dtp, NULL, fd, NULL,
|
||||
"failed to link %s: %s exited with status %d\n",
|
||||
file, dtp->dt_ld_path, WEXITSTATUS(status));
|
||||
goto done;
|
||||
}
|
||||
(void) close(fd); /* release temporary file */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/*
|
||||
* Now that we've linked drti.o, reduce the global __SUNW_dof
|
||||
* symbol to a local symbol. This is needed to so that multiple
|
||||
* generated object files (for different providers, for
|
||||
* instance) can be linked together. This is accomplished using
|
||||
* the -Blocal flag with Sun's linker, but GNU ld doesn't appear
|
||||
* to have an equivalent option.
|
||||
*/
|
||||
asprintf(&cmd, "%s --localize-hidden %s", dtp->dt_objcopy_path,
|
||||
file);
|
||||
if ((status = system(cmd)) == -1) {
|
||||
ret = dt_link_error(dtp, NULL, -1, NULL,
|
||||
"failed to run %s: %s", dtp->dt_objcopy_path,
|
||||
strerror(errno));
|
||||
free(cmd);
|
||||
goto done;
|
||||
}
|
||||
free(cmd);
|
||||
|
||||
if (WIFSIGNALED(status)) {
|
||||
ret = dt_link_error(dtp, NULL, -1, NULL,
|
||||
"failed to link %s: %s failed due to signal %d",
|
||||
file, dtp->dt_objcopy_path, WTERMSIG(status));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (WEXITSTATUS(status) != 0) {
|
||||
ret = dt_link_error(dtp, NULL, -1, NULL,
|
||||
"failed to link %s: %s exited with status %d\n",
|
||||
file, dtp->dt_objcopy_path, WEXITSTATUS(status));
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
(void) close(fd);
|
||||
}
|
||||
|
@ -785,6 +785,7 @@ const char *_dtrace_defld = "/usr/ccs/bin/ld"; /* default ld(1) to invoke */
|
||||
#else
|
||||
const char *_dtrace_defcpp = "cpp"; /* default cpp(1) to invoke */
|
||||
const char *_dtrace_defld = "ld"; /* default ld(1) to invoke */
|
||||
const char *_dtrace_defobjcopy = "objcopy"; /* default objcopy(1) to invoke */
|
||||
#endif
|
||||
|
||||
const char *_dtrace_libdir = "/usr/lib/dtrace"; /* default library directory */
|
||||
@ -1185,6 +1186,9 @@ dt_vopen(int version, int flags, int *errp,
|
||||
dtp->dt_cpp_argc = 1;
|
||||
dtp->dt_cpp_args = 1;
|
||||
dtp->dt_ld_path = strdup(_dtrace_defld);
|
||||
#ifdef __FreeBSD__
|
||||
dtp->dt_objcopy_path = strdup(_dtrace_defobjcopy);
|
||||
#endif
|
||||
dtp->dt_provmod = provmod;
|
||||
dtp->dt_vector = vector;
|
||||
dtp->dt_varg = arg;
|
||||
@ -1193,6 +1197,9 @@ dt_vopen(int version, int flags, int *errp,
|
||||
|
||||
if (dtp->dt_mods == NULL || dtp->dt_provs == NULL ||
|
||||
dtp->dt_procs == NULL || dtp->dt_ld_path == NULL ||
|
||||
#ifdef __FreeBSD__
|
||||
dtp->dt_objcopy_path == NULL ||
|
||||
#endif
|
||||
dtp->dt_cpp_path == NULL || dtp->dt_cpp_argv == NULL)
|
||||
return (set_open_errno(dtp, errp, EDT_NOMEM));
|
||||
|
||||
@ -1673,6 +1680,9 @@ dtrace_close(dtrace_hdl_t *dtp)
|
||||
free(dtp->dt_cpp_argv);
|
||||
free(dtp->dt_cpp_path);
|
||||
free(dtp->dt_ld_path);
|
||||
#ifdef __FreeBSD__
|
||||
free(dtp->dt_objcopy_path);
|
||||
#endif
|
||||
|
||||
free(dtp->dt_mods);
|
||||
free(dtp->dt_provs);
|
||||
|
@ -280,6 +280,28 @@ dt_opt_ld_path(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
static int
|
||||
dt_opt_objcopy_path(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
|
||||
{
|
||||
char *objcopy;
|
||||
|
||||
if (arg == NULL)
|
||||
return (dt_set_errno(dtp, EDT_BADOPTVAL));
|
||||
|
||||
if (dtp->dt_pcb != NULL)
|
||||
return (dt_set_errno(dtp, EDT_BADOPTCTX));
|
||||
|
||||
if ((objcopy = strdup(arg)) == NULL)
|
||||
return (dt_set_errno(dtp, EDT_NOMEM));
|
||||
|
||||
free(dtp->dt_objcopy_path);
|
||||
dtp->dt_objcopy_path = objcopy;
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
dt_opt_libdir(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
|
||||
@ -960,6 +982,9 @@ static const dt_option_t _dtrace_ctoptions[] = {
|
||||
{ "linkmode", dt_opt_linkmode },
|
||||
{ "linktype", dt_opt_linktype },
|
||||
{ "nolibs", dt_opt_cflags, DTRACE_C_NOLIBS },
|
||||
#ifdef __FreeBSD__
|
||||
{ "objcopypath", dt_opt_objcopy_path },
|
||||
#endif
|
||||
{ "pgmax", dt_opt_pgmax },
|
||||
{ "pspec", dt_opt_cflags, DTRACE_C_PSPEC },
|
||||
{ "setenv", dt_opt_setenv, 1 },
|
||||
|
@ -754,7 +754,7 @@ ipv6_down()
|
||||
IFS="$_ifs"
|
||||
for _inet6 in $inetList ; do
|
||||
# get rid of extraneous line
|
||||
case $_inet in
|
||||
case $_inet6 in
|
||||
inet6\ *) ;;
|
||||
*) continue ;;
|
||||
esac
|
||||
|
@ -327,7 +327,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
|
||||
struct sockaddr *sa;
|
||||
sigset_t mask;
|
||||
sigset_t newmask;
|
||||
socklen_t inlen, salen;
|
||||
socklen_t salen;
|
||||
ssize_t recvlen = 0;
|
||||
int kin_len, n, rpc_lock_value;
|
||||
u_int32_t xid;
|
||||
@ -520,7 +520,6 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
|
||||
goto call_again_same_xid;
|
||||
}
|
||||
}
|
||||
inlen = (socklen_t)recvlen;
|
||||
|
||||
/*
|
||||
* now decode and validate the response
|
||||
|
@ -462,12 +462,10 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
||||
u_int recvsz;
|
||||
{
|
||||
struct netbuf *svcaddr;
|
||||
struct netconfig *nconf;
|
||||
CLIENT *cl;
|
||||
int len;
|
||||
|
||||
cl = NULL;
|
||||
nconf = NULL;
|
||||
svcaddr = NULL;
|
||||
if ((raddr->sun_len == 0) ||
|
||||
((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) ||
|
||||
|
@ -168,7 +168,6 @@ __printf_render_float(struct __printf_io *io, const struct printf_info *pi, cons
|
||||
int realsz; /* field size expanded by dprec, sign, etc */
|
||||
int dprec; /* a copy of prec if [diouxX], 0 otherwise */
|
||||
char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */
|
||||
int prsize; /* max size of printed field */
|
||||
int ret; /* return value accumulator */
|
||||
char *decimal_point; /* locale specific decimal point */
|
||||
int n2; /* XXX: for PRINTANDPAD */
|
||||
@ -344,8 +343,6 @@ __printf_render_float(struct __printf_io *io, const struct printf_info *pi, cons
|
||||
if (ox[1])
|
||||
realsz += 2;
|
||||
|
||||
prsize = pi->width > realsz ? pi->width : realsz;
|
||||
|
||||
/* right-adjusting blank padding */
|
||||
if (pi->pad != '0' && pi->left == 0)
|
||||
ret += __printf_pad(io, pi->width - realsz, 0);
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)mmap.2 8.4 (Berkeley) 5/11/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd September 17, 2014
|
||||
.Dd February 18, 2015
|
||||
.Dt MMAP 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -160,7 +160,7 @@ is specified,
|
||||
must be a multiple of the pagesize.
|
||||
If
|
||||
.Dv MAP_EXCL
|
||||
is not specified, a successfull
|
||||
is not specified, a successful
|
||||
.Dv MAP_FIXED
|
||||
request replaces any previous mappings for the process'
|
||||
pages in the range from
|
||||
@ -225,7 +225,7 @@ it.
|
||||
You can test file fragmentation by observing the KB/t (kilobytes per
|
||||
transfer) results from an
|
||||
.Dq Li iostat 1
|
||||
while reading a large file sequentially, e.g.\& using
|
||||
while reading a large file sequentially, e.g.,\& using
|
||||
.Dq Li dd if=filename of=/dev/null bs=32k .
|
||||
.Pp
|
||||
The
|
||||
@ -448,17 +448,3 @@ was specified and insufficient memory was available.
|
||||
.Xr munmap 2 ,
|
||||
.Xr getpagesize 3 ,
|
||||
.Xr getpagesizes 3
|
||||
.Sh BUGS
|
||||
The
|
||||
.Fa len
|
||||
argument
|
||||
is limited to the maximum file size or available userland address
|
||||
space.
|
||||
Files may not be able to be made more than 1TB large on 32 bit systems
|
||||
due to file systems restrictions and bugs, but address space is far more
|
||||
restrictive.
|
||||
Larger files may be possible on 64 bit systems.
|
||||
.Pp
|
||||
The previous documented limit of 2GB was a documentation bug.
|
||||
That limit has not existed since
|
||||
.Fx 2.2 .
|
||||
|
@ -33,18 +33,12 @@
|
||||
# with xz(1) (extremely time consuming)
|
||||
# WITH_CLOUDWARE: if set, build cloud hosting disk images with the release
|
||||
# TARGET/TARGET_ARCH: architecture of built release
|
||||
# XZ_FLAGS: Additional arguments to pass to xz(1)
|
||||
# XZ_THREADS: Number of xz(1) threads to use
|
||||
# NO_XZTHREADS: Disable multi-threaded xz(1) compression
|
||||
#
|
||||
|
||||
WORLDDIR?= ${.CURDIR}/..
|
||||
PORTSDIR?= /usr/ports
|
||||
DOCDIR?= /usr/doc
|
||||
RELNOTES_LANG?= en_US.ISO8859-1
|
||||
XZCMD?= /usr/bin/xz
|
||||
XZ_FLAGS?=
|
||||
XZ_THREADS?=
|
||||
|
||||
.if !defined(TARGET) || empty(TARGET)
|
||||
TARGET= ${MACHINE}
|
||||
@ -59,15 +53,6 @@ TARGET_ARCH= ${TARGET}
|
||||
IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
|
||||
DISTDIR= dist
|
||||
|
||||
.if !defined(NO_XZTHREADS) && empty(XZ_THREADS)
|
||||
XZ_THREADS= 0
|
||||
.else
|
||||
XZ_THREADS= ${XZ_THREADS}
|
||||
.endif
|
||||
.if !empty(XZ_THREADS)
|
||||
XZ_FLAGS+= -T ${XZ_THREADS}
|
||||
.endif
|
||||
|
||||
# Define OSRELEASE by using newvars.sh
|
||||
.if !defined(OSRELEASE) || empty(OSRELEASE)
|
||||
.for _V in TYPE BRANCH REVISION
|
||||
@ -158,16 +143,18 @@ kernel.txz:
|
||||
src.txz:
|
||||
mkdir -p ${DISTDIR}/usr
|
||||
ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
|
||||
cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \
|
||||
--exclude .git --exclude @ --exclude usr/src/release/dist usr/src
|
||||
cd ${DISTDIR} && tar cLvf - --exclude .svn --exclude .zfs \
|
||||
--exclude .git --exclude @ --exclude usr/src/release/dist usr/src | \
|
||||
${XZ_CMD} > ${.OBJDIR}/src.txz
|
||||
|
||||
ports.txz:
|
||||
mkdir -p ${DISTDIR}/usr
|
||||
ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
|
||||
cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \
|
||||
cd ${DISTDIR} && tar cLvf - \
|
||||
--exclude .git --exclude .svn \
|
||||
--exclude usr/ports/distfiles --exclude usr/ports/packages \
|
||||
--exclude 'usr/ports/INDEX*' --exclude work usr/ports
|
||||
--exclude 'usr/ports/INDEX*' --exclude work usr/ports | \
|
||||
${XZ_CMD} > ${.OBJDIR}/ports.txz
|
||||
|
||||
reldoc:
|
||||
cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \
|
||||
@ -309,7 +296,7 @@ release-install:
|
||||
.for I in ${IMAGES}
|
||||
cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
|
||||
. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
|
||||
${XZCMD} ${XZ_FLAGS} -k ${DESTDIR}/${OSRELEASE}-${I}
|
||||
${XZ_CMD} -k ${DESTDIR}/${OSRELEASE}-${I}
|
||||
. endif
|
||||
.endfor
|
||||
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
|
||||
|
@ -101,7 +101,7 @@ vm-install:
|
||||
# the DESTDIR.
|
||||
. for FORMAT in ${VMFORMATS}
|
||||
# Don't keep the originals. There is a copy in ${.OBJDIR} if needed.
|
||||
${XZCMD} ${XZ_FLAGS} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
|
||||
${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
|
||||
. endfor
|
||||
. endif
|
||||
cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
|
||||
|
@ -7404,7 +7404,7 @@ getdevid(struct cam_devitem *item)
|
||||
retry:
|
||||
ccb->ccb_h.func_code = XPT_DEV_ADVINFO;
|
||||
ccb->ccb_h.flags = CAM_DIR_IN;
|
||||
ccb->cdai.flags = 0;
|
||||
ccb->cdai.flags = CDAI_FLAG_NONE;
|
||||
ccb->cdai.buftype = CDAI_TYPE_SCSI_DEVID;
|
||||
ccb->cdai.bufsiz = item->device_id_len;
|
||||
if (item->device_id_len != 0)
|
||||
|
@ -121,10 +121,7 @@ ${_YC:R}.o: ${_YC}
|
||||
.endfor
|
||||
|
||||
# DTrace probe definitions
|
||||
# libelf is currently needed for drti.o
|
||||
.if ${SRCS:M*.d}
|
||||
LDADD+= -lelf
|
||||
DPADD+= ${LIBELF}
|
||||
CFLAGS+= -I${.OBJDIR}
|
||||
.endif
|
||||
.for _DSRC in ${SRCS:M*.d:N*/*}
|
||||
|
@ -131,6 +131,7 @@ LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a
|
||||
LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a
|
||||
LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a
|
||||
LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a
|
||||
LIBXO?= ${DESTDIR}${LIBDIR}/libxo.a
|
||||
LIBY?= ${DESTDIR}${LIBDIR}/liby.a
|
||||
LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a
|
||||
LIBZ?= ${DESTDIR}${LIBDIR}/libz.a
|
||||
|
@ -234,6 +234,15 @@ STRIP?= -s
|
||||
COMPRESS_CMD?= gzip -cn
|
||||
COMPRESS_EXT?= .gz
|
||||
|
||||
# Set XZ_THREADS to 1 to disable multi-threading.
|
||||
XZ_THREADS?= 0
|
||||
|
||||
.if !empty(XZ_THREADS)
|
||||
XZ_CMD?= xz -T ${XZ_THREADS}
|
||||
.else
|
||||
XZ_CMD?= xz
|
||||
.endif
|
||||
|
||||
# Pointer to the top directory into which tests are installed. Should not be
|
||||
# overriden by Makefiles, but the user may choose to set this in src.conf(5).
|
||||
TESTSBASE?= /usr/tests
|
||||
|
@ -128,7 +128,10 @@ CWARNFLAGS+= -Wno-unknown-pragmas
|
||||
CLANG_NO_IAS= -no-integrated-as
|
||||
.endif
|
||||
CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\
|
||||
-mllvm -simplifycfg-dup-ret -mllvm -enable-gvn=false
|
||||
-mllvm -simplifycfg-dup-ret -mllvm
|
||||
.if ${COMPILER_VERSION} > 30400
|
||||
CLANG_OPT_SMALL+= -enable-gvn=false
|
||||
.endif
|
||||
CFLAGS.clang+= -Qunused-arguments
|
||||
.if ${MACHINE_CPUARCH} == "sparc64"
|
||||
# Don't emit .cfi directives, since we must use GNU as on sparc64, for now.
|
||||
|
@ -88,7 +88,8 @@ cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data)
|
||||
break;
|
||||
|
||||
case PT_SETXSTATE:
|
||||
if (data > cpu_max_ext_state_size) {
|
||||
if (data < sizeof(struct savefpu) ||
|
||||
data > cpu_max_ext_state_size) {
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ db_stack_trace_cmd(struct unwind_state *state)
|
||||
|
||||
finished = false;
|
||||
while (!finished) {
|
||||
finished = unwind_stack_one(state);
|
||||
finished = unwind_stack_one(state, 0);
|
||||
|
||||
/* Print the frame details */
|
||||
sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset);
|
||||
|
@ -33,9 +33,12 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/linker.h>
|
||||
|
||||
#include <machine/stack.h>
|
||||
|
||||
#include "linker_if.h"
|
||||
|
||||
/*
|
||||
* Definitions for the instruction interpreter.
|
||||
*
|
||||
@ -61,7 +64,7 @@ __FBSDID("$FreeBSD$");
|
||||
* These are set in the linker script. Their addresses will be
|
||||
* either the start or end of the exception table or index.
|
||||
*/
|
||||
extern int extab_start, extab_end, exidx_start, exidx_end;
|
||||
extern int exidx_start, exidx_end;
|
||||
|
||||
/*
|
||||
* Entry types.
|
||||
@ -104,13 +107,47 @@ expand_prel31(uint32_t prel31)
|
||||
return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2;
|
||||
}
|
||||
|
||||
struct search_context {
|
||||
uint32_t addr;
|
||||
caddr_t exidx_start;
|
||||
caddr_t exidx_end;
|
||||
};
|
||||
|
||||
static int
|
||||
module_search(linker_file_t lf, void *context)
|
||||
{
|
||||
struct search_context *sc = context;
|
||||
linker_symval_t symval;
|
||||
c_linker_sym_t sym;
|
||||
|
||||
if (lf->address <= (caddr_t)sc->addr &&
|
||||
(lf->address + lf->size) >= (caddr_t)sc->addr) {
|
||||
if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_start", &sym) == 0 ||
|
||||
LINKER_LOOKUP_SYMBOL(lf, "exidx_start", &sym) == 0) &&
|
||||
LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0)
|
||||
sc->exidx_start = symval.value;
|
||||
|
||||
if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_end", &sym) == 0 ||
|
||||
LINKER_LOOKUP_SYMBOL(lf, "exidx_end", &sym) == 0) &&
|
||||
LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0)
|
||||
sc->exidx_end = symval.value;
|
||||
|
||||
if (sc->exidx_start != NULL && sc->exidx_end != NULL)
|
||||
return (1);
|
||||
panic("Invalid module %s, no unwind tables\n", lf->filename);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform a binary search of the index table to find the function
|
||||
* with the largest address that doesn't exceed addr.
|
||||
*/
|
||||
static struct unwind_idx *
|
||||
find_index(uint32_t addr)
|
||||
find_index(uint32_t addr, int search_modules)
|
||||
{
|
||||
struct search_context sc;
|
||||
caddr_t idx_start, idx_end;
|
||||
unsigned int min, mid, max;
|
||||
struct unwind_idx *start;
|
||||
struct unwind_idx *item;
|
||||
@ -118,9 +155,23 @@ find_index(uint32_t addr)
|
||||
uint32_t func_addr;
|
||||
|
||||
start = (struct unwind_idx *)&exidx_start;
|
||||
idx_start = (caddr_t)&exidx_start;
|
||||
idx_end = (caddr_t)&exidx_end;
|
||||
|
||||
/* This may acquire a lock */
|
||||
if (search_modules) {
|
||||
bzero(&sc, sizeof(sc));
|
||||
sc.addr = addr;
|
||||
if (linker_file_foreach(module_search, &sc) != 0 &&
|
||||
sc.exidx_start != NULL && sc.exidx_end != NULL) {
|
||||
start = (struct unwind_idx *)sc.exidx_start;
|
||||
idx_start = sc.exidx_start;
|
||||
idx_end = sc.exidx_end;
|
||||
}
|
||||
}
|
||||
|
||||
min = 0;
|
||||
max = (&exidx_end - &exidx_start) / 2;
|
||||
max = (idx_end - idx_start) / sizeof(struct unwind_idx);
|
||||
|
||||
while (min != max) {
|
||||
mid = min + (max - min + 1) / 2;
|
||||
@ -332,7 +383,7 @@ unwind_tab(struct unwind_state *state)
|
||||
}
|
||||
|
||||
int
|
||||
unwind_stack_one(struct unwind_state *state)
|
||||
unwind_stack_one(struct unwind_state *state, int can_lock)
|
||||
{
|
||||
struct unwind_idx *index;
|
||||
int finished;
|
||||
@ -344,7 +395,7 @@ unwind_stack_one(struct unwind_state *state)
|
||||
state->start_pc = state->registers[PC];
|
||||
|
||||
/* Find the item to run */
|
||||
index = find_index(state->start_pc);
|
||||
index = find_index(state->start_pc, can_lock);
|
||||
|
||||
finished = 0;
|
||||
if (index->insn != EXIDX_CANTUNWIND) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*-
|
||||
* Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
|
||||
* Copyright (c) 2012 Luiz Otavio O Souza.
|
||||
* Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>
|
||||
* Copyright (c) 2012-2015 Luiz Otavio O Souza <loos@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -251,16 +251,14 @@ bcm_gpio_set_function(struct bcm_gpio_softc *sc, uint32_t pin, uint32_t f)
|
||||
static void
|
||||
bcm_gpio_set_pud(struct bcm_gpio_softc *sc, uint32_t pin, uint32_t state)
|
||||
{
|
||||
uint32_t bank, offset;
|
||||
uint32_t bank;
|
||||
|
||||
/* Must be called with lock held. */
|
||||
BCM_GPIO_LOCK_ASSERT(sc);
|
||||
|
||||
bank = pin / 32;
|
||||
offset = pin - 32 * bank;
|
||||
|
||||
bank = BCM_GPIO_BANK(pin);
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), state);
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), (1 << offset));
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), BCM_GPIO_MASK(pin));
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), 0);
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), 0);
|
||||
}
|
||||
@ -438,29 +436,25 @@ static int
|
||||
bcm_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value)
|
||||
{
|
||||
struct bcm_gpio_softc *sc = device_get_softc(dev);
|
||||
uint32_t bank, offset;
|
||||
uint32_t bank, reg;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sc->sc_gpio_npins; i++) {
|
||||
if (sc->sc_gpio_pins[i].gp_pin == pin)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i >= sc->sc_gpio_npins)
|
||||
return (EINVAL);
|
||||
|
||||
/* We never write to read-only/reserved pins. */
|
||||
if (bcm_gpio_pin_is_ro(sc, pin))
|
||||
return (EINVAL);
|
||||
|
||||
bank = pin / 32;
|
||||
offset = pin - 32 * bank;
|
||||
|
||||
BCM_GPIO_LOCK(sc);
|
||||
bank = BCM_GPIO_BANK(pin);
|
||||
if (value)
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPSET(bank), (1 << offset));
|
||||
reg = BCM_GPIO_GPSET(bank);
|
||||
else
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPCLR(bank), (1 << offset));
|
||||
reg = BCM_GPIO_GPCLR(bank);
|
||||
BCM_GPIO_WRITE(sc, reg, BCM_GPIO_MASK(pin));
|
||||
BCM_GPIO_UNLOCK(sc);
|
||||
|
||||
return (0);
|
||||
@ -470,24 +464,20 @@ static int
|
||||
bcm_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val)
|
||||
{
|
||||
struct bcm_gpio_softc *sc = device_get_softc(dev);
|
||||
uint32_t bank, offset, reg_data;
|
||||
uint32_t bank, reg_data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sc->sc_gpio_npins; i++) {
|
||||
if (sc->sc_gpio_pins[i].gp_pin == pin)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i >= sc->sc_gpio_npins)
|
||||
return (EINVAL);
|
||||
|
||||
bank = pin / 32;
|
||||
offset = pin - 32 * bank;
|
||||
|
||||
bank = BCM_GPIO_BANK(pin);
|
||||
BCM_GPIO_LOCK(sc);
|
||||
reg_data = BCM_GPIO_READ(sc, BCM_GPIO_GPLEV(bank));
|
||||
BCM_GPIO_UNLOCK(sc);
|
||||
*val = (reg_data & (1 << offset)) ? 1 : 0;
|
||||
*val = (reg_data & BCM_GPIO_MASK(pin)) ? 1 : 0;
|
||||
|
||||
return (0);
|
||||
}
|
||||
@ -496,30 +486,26 @@ static int
|
||||
bcm_gpio_pin_toggle(device_t dev, uint32_t pin)
|
||||
{
|
||||
struct bcm_gpio_softc *sc = device_get_softc(dev);
|
||||
uint32_t bank, data, offset;
|
||||
uint32_t bank, data, reg;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sc->sc_gpio_npins; i++) {
|
||||
if (sc->sc_gpio_pins[i].gp_pin == pin)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i >= sc->sc_gpio_npins)
|
||||
return (EINVAL);
|
||||
|
||||
/* We never write to read-only/reserved pins. */
|
||||
if (bcm_gpio_pin_is_ro(sc, pin))
|
||||
return (EINVAL);
|
||||
|
||||
bank = pin / 32;
|
||||
offset = pin - 32 * bank;
|
||||
|
||||
BCM_GPIO_LOCK(sc);
|
||||
bank = BCM_GPIO_BANK(pin);
|
||||
data = BCM_GPIO_READ(sc, BCM_GPIO_GPLEV(bank));
|
||||
if (data & (1 << offset))
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPCLR(bank), (1 << offset));
|
||||
if (data & BCM_GPIO_MASK(pin))
|
||||
reg = BCM_GPIO_GPCLR(bank);
|
||||
else
|
||||
BCM_GPIO_WRITE(sc, BCM_GPIO_GPSET(bank), (1 << offset));
|
||||
reg = BCM_GPIO_GPSET(bank);
|
||||
BCM_GPIO_WRITE(sc, reg, BCM_GPIO_MASK(pin));
|
||||
BCM_GPIO_UNLOCK(sc);
|
||||
|
||||
return (0);
|
||||
|
@ -55,6 +55,6 @@ struct unwind_state {
|
||||
#define LR 14
|
||||
#define PC 15
|
||||
|
||||
int unwind_stack_one(struct unwind_state *);
|
||||
int unwind_stack_one(struct unwind_state *, int);
|
||||
|
||||
#endif /* !_MACHINE_STACK_H_ */
|
||||
|
@ -1140,6 +1140,7 @@ struct ccb_eng_exec { /* This structure must match SCSIIO size */
|
||||
struct ccb_dev_advinfo {
|
||||
struct ccb_hdr ccb_h;
|
||||
uint32_t flags;
|
||||
#define CDAI_FLAG_NONE 0x0 /* No flags set */
|
||||
#define CDAI_FLAG_STORE 0x1 /* If set, action becomes store */
|
||||
uint32_t buftype; /* IN: Type of data being requested */
|
||||
/* NB: buftype is interpreted on a per-transport basis */
|
||||
|
@ -3787,7 +3787,7 @@ dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector,
|
||||
xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
|
||||
cdai.ccb_h.func_code = XPT_DEV_ADVINFO;
|
||||
cdai.buftype = CDAI_TYPE_RCAPLONG;
|
||||
cdai.flags |= CDAI_FLAG_STORE;
|
||||
cdai.flags = CDAI_FLAG_STORE;
|
||||
cdai.bufsiz = rcap_len;
|
||||
cdai.buf = (uint8_t *)rcaplong;
|
||||
xpt_action((union ccb *)&cdai);
|
||||
|
@ -1007,7 +1007,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element_t *elm,
|
||||
xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL);
|
||||
cdai.ccb_h.func_code = XPT_DEV_ADVINFO;
|
||||
cdai.buftype = CDAI_TYPE_PHYS_PATH;
|
||||
cdai.flags = 0;
|
||||
cdai.flags = CDAI_FLAG_NONE;
|
||||
cdai.bufsiz = MAXPATHLEN;
|
||||
cdai.buf = old_physpath;
|
||||
xpt_action((union ccb *)&cdai);
|
||||
@ -1019,7 +1019,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element_t *elm,
|
||||
xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL);
|
||||
cdai.ccb_h.func_code = XPT_DEV_ADVINFO;
|
||||
cdai.buftype = CDAI_TYPE_PHYS_PATH;
|
||||
cdai.flags |= CDAI_FLAG_STORE;
|
||||
cdai.flags = CDAI_FLAG_STORE;
|
||||
cdai.bufsiz = sbuf_len(args->physpath);
|
||||
cdai.buf = sbuf_data(args->physpath);
|
||||
xpt_action((union ccb *)&cdai);
|
||||
|
@ -69,9 +69,10 @@ void
|
||||
dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes,
|
||||
uint32_t *intrpc)
|
||||
{
|
||||
u_int32_t *frame, *lastframe;
|
||||
int scp_offset;
|
||||
int depth = 0;
|
||||
struct unwind_state state;
|
||||
register_t sp;
|
||||
int scp_offset;
|
||||
int depth = 0;
|
||||
pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller;
|
||||
|
||||
if (intrpc != 0)
|
||||
@ -79,23 +80,17 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes,
|
||||
|
||||
aframes++;
|
||||
|
||||
frame = (u_int32_t *)__builtin_frame_address(0);;
|
||||
lastframe = NULL;
|
||||
scp_offset = -(get_pc_str_offset() >> 2);
|
||||
__asm __volatile("mov %0, sp" : "=&r" (sp));
|
||||
|
||||
while ((frame != NULL) && (depth < pcstack_limit)) {
|
||||
db_addr_t scp;
|
||||
#if 0
|
||||
u_int32_t savecode;
|
||||
int r;
|
||||
u_int32_t *rp;
|
||||
#endif
|
||||
state.registers[FP] = (uint32_t)__builtin_frame_address(0);
|
||||
state.registers[SP] = sp;
|
||||
state.registers[LR] = (uint32_t)__builtin_return_address(0);
|
||||
state.registers[PC] = (uint32_t)dtrace_getpcstack;
|
||||
|
||||
/*
|
||||
* In theory, the SCP isn't guaranteed to be in the function
|
||||
* that generated the stack frame. We hope for the best.
|
||||
*/
|
||||
scp = frame[FR_SCP];
|
||||
while (depth < pcstack_limit) {
|
||||
int done;
|
||||
|
||||
done = unwind_stack_one(&state, 1);
|
||||
|
||||
if (aframes > 0) {
|
||||
aframes--;
|
||||
@ -104,39 +99,10 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes,
|
||||
}
|
||||
}
|
||||
else {
|
||||
pcstack[depth++] = scp;
|
||||
pcstack[depth++] = state.registers[PC];
|
||||
}
|
||||
|
||||
#if 0
|
||||
savecode = ((u_int32_t *)scp)[scp_offset];
|
||||
if ((savecode & 0x0e100000) == 0x08000000) {
|
||||
/* Looks like an STM */
|
||||
rp = frame - 4;
|
||||
for (r = 10; r >= 0; r--) {
|
||||
if (savecode & (1 << r)) {
|
||||
/* register r == *rp-- */
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Switch to next frame up
|
||||
*/
|
||||
if (frame[FR_RFP] == 0)
|
||||
break; /* Top of stack */
|
||||
|
||||
lastframe = frame;
|
||||
frame = (u_int32_t *)(frame[FR_RFP]);
|
||||
|
||||
if (INKERNEL((int)frame)) {
|
||||
/* staying in kernel */
|
||||
if (frame <= lastframe) {
|
||||
/* bad frame pointer */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (done)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -176,55 +142,28 @@ dtrace_getarg(int arg, int aframes)
|
||||
int
|
||||
dtrace_getstackdepth(int aframes)
|
||||
{
|
||||
u_int32_t *frame, *lastframe;
|
||||
int scp_offset;
|
||||
int depth = 1;
|
||||
struct unwind_state state;
|
||||
register_t sp;
|
||||
int scp_offset;
|
||||
int done = 0;
|
||||
int depth = 1;
|
||||
|
||||
frame = (u_int32_t *)__builtin_frame_address(0);;
|
||||
lastframe = NULL;
|
||||
scp_offset = -(get_pc_str_offset() >> 2);
|
||||
__asm __volatile("mov %0, sp" : "=&r" (sp));
|
||||
|
||||
while (frame != NULL) {
|
||||
db_addr_t scp;
|
||||
#if 0
|
||||
u_int32_t savecode;
|
||||
int r;
|
||||
u_int32_t *rp;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* In theory, the SCP isn't guaranteed to be in the function
|
||||
* that generated the stack frame. We hope for the best.
|
||||
*/
|
||||
scp = frame[FR_SCP];
|
||||
state.registers[FP] = (uint32_t)__builtin_frame_address(0);
|
||||
state.registers[SP] = sp;
|
||||
state.registers[LR] = (uint32_t)__builtin_return_address(0);
|
||||
state.registers[PC] = (uint32_t)dtrace_getstackdepth;
|
||||
|
||||
do {
|
||||
done = unwind_stack_one(&state, 1);
|
||||
depth++;
|
||||
|
||||
/*
|
||||
* Switch to next frame up
|
||||
*/
|
||||
if (frame[FR_RFP] == 0)
|
||||
break; /* Top of stack */
|
||||
|
||||
lastframe = frame;
|
||||
frame = (u_int32_t *)(frame[FR_RFP]);
|
||||
|
||||
if (INKERNEL((int)frame)) {
|
||||
/* staying in kernel */
|
||||
if (frame <= lastframe) {
|
||||
/* bad frame pointer */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
} while (!done);
|
||||
|
||||
if (depth < aframes)
|
||||
return 0;
|
||||
else
|
||||
return depth - aframes;
|
||||
|
||||
}
|
||||
|
||||
ulong_t
|
||||
|
@ -495,7 +495,7 @@ options KTRACE_REQUEST_POOL=101
|
||||
options KTR
|
||||
options KTR_BOOT_ENTRIES=1024
|
||||
options KTR_ENTRIES=(128*1024)
|
||||
options KTR_COMPILE=(KTR_INTR|KTR_PROC)
|
||||
options KTR_COMPILE=(KTR_ALL)
|
||||
options KTR_MASK=KTR_INTR
|
||||
options KTR_CPUMASK=0x3
|
||||
options KTR_VERBOSE
|
||||
|
54
sys/conf/config.mk
Normal file
54
sys/conf/config.mk
Normal file
@ -0,0 +1,54 @@
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Common code to marry kernel config(8) goo and module building goo.
|
||||
#
|
||||
|
||||
# Generate options files that otherwise would be built
|
||||
# in substantially similar ways through the tree. Move
|
||||
# the code here when they all produce identical results
|
||||
# (or should)
|
||||
.if !defined(KERNBUILDDIR)
|
||||
opt_bpf.h:
|
||||
echo "#define DEV_BPF 1" > ${.TARGET}
|
||||
.if ${MK_INET_SUPPORT} != "no"
|
||||
opt_inet.h:
|
||||
@echo "#define INET 1" > ${.TARGET}
|
||||
@echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
|
||||
.endif
|
||||
.if ${MK_INET6_SUPPORT} != "no"
|
||||
opt_inet6.h:
|
||||
@echo "#define INET6 1" > ${.TARGET}
|
||||
.endif
|
||||
.if ${MK_EISA} != "no"
|
||||
opt_eisa.h:
|
||||
@echo "#define DEV_EISA 1" > ${.TARGET}
|
||||
.endif
|
||||
opt_mrouting.h:
|
||||
echo "#define MROUTING 1" > ${.TARGET}
|
||||
opt_natm.h:
|
||||
echo "#define NATM 1" > ${.TARGET}
|
||||
opt_scsi.h:
|
||||
echo "#define SCSI_DELAY 15000" > ${.TARGET}
|
||||
opt_wlan.h:
|
||||
echo "#define IEEE80211_DEBUG 1" > ${.TARGET}
|
||||
echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET}
|
||||
echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET}
|
||||
KERN_OPTS.i386=NEW_PCIB DEV_PCI
|
||||
KERN_OPTS.pc98=NEW_PCIB DEV_PCI
|
||||
KERN_OPTS.amd64=NEW_PCIB DEV_PCI
|
||||
KERN_OPTS.powerpc=NEW_PCIB DEV_PCI
|
||||
KERN_OPTS=MROUTING NATM IEEE80211_DEBUG \
|
||||
IEEE80211_AMPDU_AGE IEEE80211_SUPPORT_MESH DEV_BPF \
|
||||
${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA}
|
||||
.if ${MK_INET_SUPPORT} != "no"
|
||||
KERN_OPTS+= INET TCP_OFFLOAD
|
||||
.endif
|
||||
.if ${MK_INET6_SUPPORT} != "no"
|
||||
KERN_OPTS+= INET6
|
||||
.endif
|
||||
.if ${MK_EISA} != "no"
|
||||
KERN_OPTS+= DEV_EISA
|
||||
.endif
|
||||
.else
|
||||
KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u
|
||||
.endif
|
@ -271,6 +271,7 @@ contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug
|
||||
contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug
|
||||
contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug
|
||||
contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug
|
||||
contrib/dev/acpica/components/disassembler/dmcstyle.c optional acpi acpi_debug
|
||||
contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug
|
||||
contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug
|
||||
contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug
|
||||
|
@ -57,7 +57,7 @@ arm/arm/trap.c optional !armv6
|
||||
arm/arm/trap-v6.c optional armv6
|
||||
arm/arm/uio_machdep.c standard
|
||||
arm/arm/undefined.c standard
|
||||
arm/arm/unwind.c optional ddb
|
||||
arm/arm/unwind.c optional ddb | kdtrace_hooks
|
||||
arm/arm/vm_machdep.c standard
|
||||
arm/arm/vfp.c standard
|
||||
board_id.h standard \
|
||||
|
@ -70,6 +70,7 @@ OBJCOPY?= objcopy
|
||||
# do this after bsd.own.mk.
|
||||
.include "kern.opts.mk"
|
||||
.include <bsd.compiler.mk>
|
||||
.include "config.mk"
|
||||
|
||||
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
|
||||
|
||||
@ -124,6 +125,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
|
||||
.if ${MACHINE_CPUARCH} == arm
|
||||
CFLAGS.clang+= -mllvm -arm-use-movt=0
|
||||
CFLAGS.clang+= -mfpu=none
|
||||
CFLAGS+= -funwind-tables
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == powerpc
|
||||
@ -163,6 +165,11 @@ OBJS+= ${_firmw:C/\:.*$/.fwo/}
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
# Conditionally include SRCS based on kernel config options.
|
||||
.for _o in ${KERN_OPTS}
|
||||
SRCS+=${SRCS.${_o}}
|
||||
.endfor
|
||||
|
||||
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
|
||||
|
||||
.if !defined(PROG)
|
||||
@ -316,34 +323,6 @@ unload:
|
||||
${KMODUNLOAD} -v ${PROG}
|
||||
.endif
|
||||
|
||||
# Generate options files that otherwise would be built
|
||||
# in substantially similar ways through the tree. Move
|
||||
# the code here when they all produce identical results
|
||||
# (or should)
|
||||
.if !defined(KERNBUILDDIR)
|
||||
opt_bpf.h:
|
||||
echo "#define DEV_BPF 1" > ${.TARGET}
|
||||
.if ${MK_INET_SUPPORT} != "no"
|
||||
opt_inet.h:
|
||||
@echo "#define INET 1" > ${.TARGET}
|
||||
@echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
|
||||
.endif
|
||||
.if ${MK_INET6_SUPPORT} != "no"
|
||||
opt_inet6.h:
|
||||
@echo "#define INET6 1" > ${.TARGET}
|
||||
.endif
|
||||
opt_mrouting.h:
|
||||
echo "#define MROUTING 1" > ${.TARGET}
|
||||
opt_natm.h:
|
||||
echo "#define NATM 1" > ${.TARGET}
|
||||
opt_scsi.h:
|
||||
echo "#define SCSI_DELAY 15000" > ${.TARGET}
|
||||
opt_wlan.h:
|
||||
echo "#define IEEE80211_DEBUG 1" > ${.TARGET}
|
||||
echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET}
|
||||
echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET}
|
||||
.endif
|
||||
|
||||
.if defined(KERNBUILDDIR)
|
||||
.PATH: ${KERNBUILDDIR}
|
||||
CFLAGS+= -I${KERNBUILDDIR}
|
||||
|
@ -1,3 +1,222 @@
|
||||
----------------------------------------
|
||||
04 February 2015. Summary of changes for version 20150204:
|
||||
|
||||
This release is available at https://acpica.org/downloads
|
||||
|
||||
ACPICA kernel-resident subsystem:
|
||||
|
||||
Updated all ACPICA copyrights and signons to 2014. Added the 2014
|
||||
copyright to all module headers and signons, including the standard Linux
|
||||
header. This affects virtually every file in the ACPICA core subsystem,
|
||||
iASL compiler, all ACPICA utilities, and the test suites.
|
||||
|
||||
Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues.
|
||||
A raw gpe handling mechanism was created to allow better handling of GPE
|
||||
storms that aren't easily managed by the normal handler. The raw handler
|
||||
allows disabling/renabling of the the GPE so that interrupt storms can be
|
||||
avoided in cases where events cannot be timely serviced. In this scenario,
|
||||
handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API
|
||||
will leave the reference counts undisturbed, thereby preventing unintentional
|
||||
clearing of the GPE when the intent in only to temporarily disable it. Raw
|
||||
handlers allow enabling and disabling of a GPE by removing GPE register
|
||||
locking. As such, raw handlers much provide their own locks while using
|
||||
GPE API's to protect access to GPE data structures.
|
||||
Lv Zheng
|
||||
|
||||
Events: Always modify GPE registers under the GPE lock.
|
||||
Applies GPE lock around AcpiFinishGpe() to protect access to GPE register
|
||||
values. Reported as bug by joe.liu@apple.com.
|
||||
|
||||
Unix makefiles: Separate option to disable optimizations and _FORTIFY_SOURCE.
|
||||
This change removes the _FORTIFY_SOURCE flag from the NOOPT disable option and
|
||||
creates a separate flag (NOFORTIFY) for this purpose. Some toolchains may
|
||||
define _FORTIFY_SOURCE which leads redefined errors when building ACPICA. This
|
||||
allows disabling the option without also having to disable optimazations.
|
||||
David Box
|
||||
|
||||
Current Release:
|
||||
Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total
|
||||
Debug Version: 199.2K Code, 82.4K Data, 281.6K Total
|
||||
|
||||
----------------------------------------
|
||||
07 November 2014. Summary of changes for version 20141107:
|
||||
|
||||
This release is available at https://acpica.org/downloads
|
||||
|
||||
This release introduces and implements language extensions to ASL that
|
||||
provide support for symbolic ("C-style") operators and expressions. These
|
||||
language extensions are known collectively as ASL+.
|
||||
|
||||
|
||||
1) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
Disassembler: Fixed a problem with disassembly of the UartSerialBus
|
||||
macro. Changed "StopBitsNone" to the correct "StopBitsZero". David E.
|
||||
Box.
|
||||
|
||||
Disassembler: Fixed the Unicode macro support to add escape sequences.
|
||||
All non-printable ASCII values are emitted as escape sequences, as well
|
||||
as the standard escapes for quote and backslash. Ensures that the
|
||||
disassembled macro can be correctly recompiled.
|
||||
|
||||
iASL: Added Printf/Fprintf macros for formatted output. These macros are
|
||||
translated to existing AML Concatenate and Store operations. Printf
|
||||
writes to the ASL Debug object. Fprintf allows the specification of an
|
||||
ASL name as the target. Only a single format specifier is required, %o,
|
||||
since the AML interpreter dynamically converts objects to the required
|
||||
type. David E. Box.
|
||||
|
||||
(old) Store (Concatenate (Concatenate (Concatenate (Concatenate
|
||||
(Concatenate (Concatenate (Concatenate ("", Arg0),
|
||||
": Unexpected value for "), Arg1), ", "), Arg2),
|
||||
" at line "), Arg3), Debug)
|
||||
|
||||
(new) Printf ("%o: Unexpected value for %o, %o at line %o",
|
||||
Arg0, Arg1, Arg2, Arg3)
|
||||
|
||||
(old) Store (Concatenate (Concatenate (Concatenate (Concatenate
|
||||
("", Arg1), ": "), Arg0), " Successful"), STR1)
|
||||
|
||||
(new) Fprintf (STR1, "%o: %o Successful", Arg1, Arg0)
|
||||
|
||||
iASL: Added debug options (-bp, -bt) to dynamically prune levels of the
|
||||
ASL parse tree before the AML code is generated. This allows blocks of
|
||||
ASL code to be removed in order to help locate and identify problem
|
||||
devices and/or code. David E. Box.
|
||||
|
||||
AcpiExec: Added support (-fi) for an optional namespace object
|
||||
initialization file. This file specifies initial values for namespace
|
||||
objects as necessary for debugging and testing different ASL code paths
|
||||
that may be taken as a result of BIOS options.
|
||||
|
||||
|
||||
2) Overview of symbolic operator support for ASL (ASL+)
|
||||
-------------------------------------------------------
|
||||
|
||||
As an extension to the ASL language, iASL implements support for symbolic
|
||||
(C-style) operators for math and logical expressions. This can greatly
|
||||
simplify ASL code as well as improve both readability and
|
||||
maintainability. These language extensions can exist concurrently with
|
||||
all legacy ASL code and expressions.
|
||||
|
||||
The symbolic extensions are 100% compatible with existing AML
|
||||
interpreters, since no new AML opcodes are created. To implement the
|
||||
extensions, the iASL compiler transforms the symbolic expressions into
|
||||
the legacy ASL/AML equivalents at compile time.
|
||||
|
||||
Full symbolic expressions are supported, along with the standard C
|
||||
precedence and associativity rules.
|
||||
|
||||
Full disassembler support for the symbolic expressions is provided, and
|
||||
creates an automatic migration path for existing ASL code to ASL+ code
|
||||
via the disassembly process. By default, the disassembler now emits ASL+
|
||||
code with symbolic expressions. An option (-dl) is provided to force the
|
||||
disassembler to emit legacy ASL code if desired.
|
||||
|
||||
Below is the complete list of the currently supported symbolic operators
|
||||
with examples. See the iASL User Guide for additional information.
|
||||
|
||||
|
||||
ASL+ Syntax Legacy ASL Equivalent
|
||||
----------- ---------------------
|
||||
|
||||
// Math operators
|
||||
|
||||
Z = X + Y Add (X, Y, Z)
|
||||
Z = X - Y Subtract (X, Y, Z)
|
||||
Z = X * Y Multiply (X, Y, Z)
|
||||
Z = X / Y Divide (X, Y, , Z)
|
||||
Z = X % Y Mod (X, Y, Z)
|
||||
Z = X << Y ShiftLeft (X, Y, Z)
|
||||
Z = X >> Y ShiftRight (X, Y, Z)
|
||||
Z = X & Y And (X, Y, Z)
|
||||
Z = X | Y Or (X, Y, Z)
|
||||
Z = X ^ Y Xor (X, Y, Z)
|
||||
Z = ~X Not (X, Z)
|
||||
X++ Increment (X)
|
||||
X-- Decrement (X)
|
||||
|
||||
// Logical operators
|
||||
|
||||
(X == Y) LEqual (X, Y)
|
||||
(X != Y) LNotEqual (X, Y)
|
||||
(X < Y) LLess (X, Y)
|
||||
(X > Y) LGreater (X, Y)
|
||||
(X <= Y) LLessEqual (X, Y)
|
||||
(X >= Y) LGreaterEqual (X, Y)
|
||||
(X && Y) LAnd (X, Y)
|
||||
(X || Y) LOr (X, Y)
|
||||
(!X) LNot (X)
|
||||
|
||||
// Assignment and compound assignment operations
|
||||
|
||||
X = Y Store (Y, X)
|
||||
X += Y Add (X, Y, X)
|
||||
X -= Y Subtract (X, Y, X)
|
||||
X *= Y Multiply (X, Y, X)
|
||||
X /= Y Divide (X, Y, , X)
|
||||
X %= Y Mod (X, Y, X)
|
||||
X <<= Y ShiftLeft (X, Y, X)
|
||||
X >>= Y ShiftRight (X, Y, X)
|
||||
X &= Y And (X, Y, X)
|
||||
X |= Y Or (X, Y, X)
|
||||
X ^= Y Xor (X, Y, X)
|
||||
|
||||
|
||||
3) ASL+ Examples:
|
||||
-----------------
|
||||
|
||||
Legacy ASL:
|
||||
If (LOr (LOr (LEqual (And (R510, 0x03FB), 0x02E0), LEqual (
|
||||
And (R520, 0x03FB), 0x02E0)), LOr (LEqual (And (R530,
|
||||
0x03FB),
|
||||
0x02E0), LEqual (And (R540, 0x03FB), 0x02E0))))
|
||||
{
|
||||
And (MEMB, 0xFFFFFFF0, SRMB)
|
||||
Store (MEMB, Local2)
|
||||
Store (PDBM, Local1)
|
||||
And (PDBM, 0xFFFFFFFFFFFFFFF9, PDBM)
|
||||
Store (SRMB, MEMB)
|
||||
Or (PDBM, 0x02, PDBM)
|
||||
}
|
||||
|
||||
ASL+ version:
|
||||
If (((R510 & 0x03FB) == 0x02E0) ||
|
||||
((R520 & 0x03FB) == 0x02E0) ||
|
||||
((R530 & 0x03FB) == 0x02E0) ||
|
||||
((R540 & 0x03FB) == 0x02E0))
|
||||
{
|
||||
SRMB = (MEMB & 0xFFFFFFF0)
|
||||
Local2 = MEMB
|
||||
Local1 = PDBM
|
||||
PDBM &= 0xFFFFFFFFFFFFFFF9
|
||||
MEMB = SRMB
|
||||
PDBM |= 0x02
|
||||
}
|
||||
|
||||
Legacy ASL:
|
||||
Store (0x1234, Local1)
|
||||
Multiply (Add (Add (Local1, TEST), 0x20), Local2, Local3)
|
||||
Multiply (Local2, Add (Add (Local1, TEST), 0x20), Local3)
|
||||
Add (Local1, Add (TEST, Multiply (0x20, Local2)), Local3)
|
||||
Store (Index (PKG1, 0x03), Local6)
|
||||
Store (Add (Local3, Local2), Debug)
|
||||
Add (Local1, 0x0F, Local2)
|
||||
Add (Local1, Multiply (Local2, Local3), Local2)
|
||||
Multiply (Add (Add (Local1, TEST), 0x20), ToBCD (Local1), Local3)
|
||||
|
||||
ASL+ version:
|
||||
Local1 = 0x1234
|
||||
Local3 = (((Local1 + TEST) + 0x20) * Local2)
|
||||
Local3 = (Local2 * ((Local1 + TEST) + 0x20))
|
||||
Local3 = (Local1 + (TEST + (0x20 * Local2)))
|
||||
Local6 = Index (PKG1, 0x03)
|
||||
Debug = (Local3 + Local2)
|
||||
Local2 = (Local1 + 0x0F)
|
||||
Local2 = (Local1 + (Local2 * Local3))
|
||||
Local3 = (((Local1 + TEST) + 0x20) * ToBCD (Local1))
|
||||
|
||||
|
||||
----------------------------------------
|
||||
26 September 2014. Summary of changes for version 20140926:
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -357,8 +357,12 @@ AdAmlDisassemble (
|
||||
AcpiDmDumpDataTable (Table);
|
||||
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
|
||||
Table->Signature);
|
||||
fprintf (stderr, "Formatted output: %s - %u bytes\n",
|
||||
DisasmFilename, CmGetFileSize (File));
|
||||
|
||||
if (File)
|
||||
{
|
||||
fprintf (stderr, "Formatted output: %s - %u bytes\n",
|
||||
DisasmFilename, CmGetFileSize (File));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -376,8 +380,11 @@ AdAmlDisassemble (
|
||||
{
|
||||
AcpiOsPrintf ("/**** Before second load\n");
|
||||
|
||||
NsSetupNamespaceListing (File);
|
||||
NsDisplayNamespace ();
|
||||
if (File)
|
||||
{
|
||||
NsSetupNamespaceListing (File);
|
||||
NsDisplayNamespace ();
|
||||
}
|
||||
AcpiOsPrintf ("*****/\n");
|
||||
}
|
||||
|
||||
@ -457,8 +464,11 @@ AdAmlDisassemble (
|
||||
if (AslCompilerdebug)
|
||||
{
|
||||
AcpiOsPrintf ("/**** After second load and resource conversion\n");
|
||||
NsSetupNamespaceListing (File);
|
||||
NsDisplayNamespace ();
|
||||
if (File)
|
||||
{
|
||||
NsSetupNamespaceListing (File);
|
||||
NsDisplayNamespace ();
|
||||
}
|
||||
AcpiOsPrintf ("*****/\n");
|
||||
|
||||
AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
|
||||
@ -487,8 +497,11 @@ AdAmlDisassemble (
|
||||
AcpiDmDumpDataTable (Table);
|
||||
|
||||
fprintf (stderr, "Disassembly completed\n");
|
||||
fprintf (stderr, "ASL Output: %s - %u bytes\n",
|
||||
DisasmFilename, CmGetFileSize (File));
|
||||
if (File)
|
||||
{
|
||||
fprintf (stderr, "ASL Output: %s - %u bytes\n",
|
||||
DisasmFilename, CmGetFileSize (File));
|
||||
}
|
||||
|
||||
if (Gbl_MapfileFlag)
|
||||
{
|
||||
@ -507,7 +520,7 @@ AdAmlDisassemble (
|
||||
ACPI_FREE (Table);
|
||||
}
|
||||
|
||||
if (OutToFile && File)
|
||||
if (File)
|
||||
{
|
||||
if (AslCompilerdebug) /* Display final namespace, with transforms */
|
||||
{
|
||||
@ -544,12 +557,26 @@ AdDisassemblerHeader (
|
||||
{
|
||||
time_t Timer;
|
||||
|
||||
|
||||
time (&Timer);
|
||||
|
||||
/* Header and input table info */
|
||||
|
||||
AcpiOsPrintf ("/*\n");
|
||||
AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * "));
|
||||
AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
|
||||
|
||||
if (AcpiGbl_CstyleDisassembly)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
" * Disassembling to symbolic ASL+ operators\n"
|
||||
" *\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
" * Disassembling to non-symbolic legacy ASL operators\n"
|
||||
" *\n");
|
||||
}
|
||||
|
||||
AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
|
||||
AcpiOsPrintf (" *\n");
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -374,6 +374,12 @@ AnGetBtype (
|
||||
UINT32 ThisNodeBtype = 0;
|
||||
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
AcpiOsPrintf ("Null Op in AnGetBtype\n");
|
||||
return (ACPI_UINT32_MAX);
|
||||
}
|
||||
|
||||
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
|
||||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
|
||||
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -107,6 +107,12 @@ CgGenerateAmlOutput (
|
||||
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
CgAmlWriteWalk, NULL, NULL);
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
|
||||
" Parent Child Next Flags AcTyp Final Col L\n",
|
||||
76, " ");
|
||||
|
||||
CgCloseTable ();
|
||||
}
|
||||
|
||||
@ -138,7 +144,8 @@ CgAmlWriteWalk (
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"Final parse tree used for AML output:\n");
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n",
|
||||
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
|
||||
" Parent Child Next Flags AcTyp Final Col L\n",
|
||||
76, " ");
|
||||
}
|
||||
|
||||
@ -161,7 +168,8 @@ CgAmlWriteWalk (
|
||||
}
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n",
|
||||
"%08X %04X %04X %01X %04X %04X %04X %04X "
|
||||
"%08X %08X %08X %08X %08X %08X %04X %02d %02d\n",
|
||||
/* 1 */ (UINT32) Op->Asl.Value.Integer,
|
||||
/* 2 */ Op->Asl.ParseOpcode,
|
||||
/* 3 */ Op->Asl.AmlOpcode,
|
||||
@ -171,13 +179,14 @@ CgAmlWriteWalk (
|
||||
/* 7 */ Op->Asl.AmlSubtreeLength,
|
||||
/* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
|
||||
/* 9 */ Op,
|
||||
/* 10 */ Op->Asl.Child,
|
||||
/* 11 */ Op->Asl.Parent,
|
||||
/* 12 */ Op->Asl.CompileFlags,
|
||||
/* 13 */ Op->Asl.AcpiBtype,
|
||||
/* 14 */ Op->Asl.FinalAmlLength,
|
||||
/* 15 */ Op->Asl.Column,
|
||||
/* 16 */ Op->Asl.LineNumber);
|
||||
/* 10 */ Op->Asl.Parent,
|
||||
/* 11 */ Op->Asl.Child,
|
||||
/* 12 */ Op->Asl.Next,
|
||||
/* 13 */ Op->Asl.CompileFlags,
|
||||
/* 14 */ Op->Asl.AcpiBtype,
|
||||
/* 15 */ Op->Asl.FinalAmlLength,
|
||||
/* 16 */ Op->Asl.Column,
|
||||
/* 17 */ Op->Asl.LineNumber);
|
||||
|
||||
/* Generate the AML for this node */
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -118,10 +118,9 @@ CmDoCompile (
|
||||
AslCompilerparse();
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Check for parse errors */
|
||||
/* Check for parser-detected syntax errors */
|
||||
|
||||
Status = AslCheckForErrorExit ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (Gbl_SyntaxError)
|
||||
{
|
||||
fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
|
||||
LsDumpParseTree ();
|
||||
@ -147,6 +146,13 @@ CmDoCompile (
|
||||
Event = UtBeginEvent ("Flush source input");
|
||||
CmFlushSourceCode ();
|
||||
|
||||
/* Prune the parse tree if requested (debug purposes only) */
|
||||
|
||||
if (Gbl_PruneParseTree)
|
||||
{
|
||||
AslPruneParseTree (Gbl_PruneDepth, Gbl_PruneType);
|
||||
}
|
||||
|
||||
/* Optional parse tree dump, compiler debug output only */
|
||||
|
||||
LsDumpParseTree ();
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -542,6 +542,27 @@ OptOptimizeNamePath (
|
||||
ACPI_NAMESPACE_NODE *TargetNode);
|
||||
|
||||
|
||||
/*
|
||||
* aslprintf - Printf/Fprintf macros
|
||||
*/
|
||||
void
|
||||
OpcDoPrintf (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
OpcDoFprintf (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* aslprune - parse tree pruner
|
||||
*/
|
||||
void
|
||||
AslPruneParseTree (
|
||||
UINT32 PruneDepth,
|
||||
UINT32 Type);
|
||||
|
||||
|
||||
/*
|
||||
* aslcodegen - code generation
|
||||
*/
|
||||
@ -683,6 +704,16 @@ ACPI_PARSE_OBJECT *
|
||||
TrCreateLeafNode (
|
||||
UINT32 ParseOpcode);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateAssignmentNode (
|
||||
ACPI_PARSE_OBJECT *Target,
|
||||
ACPI_PARSE_OBJECT *Source);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateTargetOperand (
|
||||
ACPI_PARSE_OBJECT *OriginalOp,
|
||||
ACPI_PARSE_OBJECT *ParentOp);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateValuedLeafNode (
|
||||
UINT32 ParseOpcode,
|
||||
|
@ -6,7 +6,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -117,7 +117,49 @@ NamePathTail [.]{NameSeg}
|
||||
else {yyterminate ();} }
|
||||
";" { count (0); return(';'); }
|
||||
|
||||
/* ASL Extension: Standard C operators */
|
||||
|
||||
"~" { count (3); return (PARSEOP_EXP_NOT); }
|
||||
"!" { count (3); return (PARSEOP_EXP_LOGICAL_NOT); }
|
||||
"*" { count (3); return (PARSEOP_EXP_MULTIPLY); }
|
||||
"/" { count (3); return (PARSEOP_EXP_DIVIDE); }
|
||||
"%" { count (3); return (PARSEOP_EXP_MODULO); }
|
||||
"+" { count (3); return (PARSEOP_EXP_ADD); }
|
||||
"-" { count (3); return (PARSEOP_EXP_SUBTRACT); }
|
||||
">>" { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); }
|
||||
"<<" { count (3); return (PARSEOP_EXP_SHIFT_LEFT); }
|
||||
"<" { count (3); return (PARSEOP_EXP_LESS); }
|
||||
">" { count (3); return (PARSEOP_EXP_GREATER); }
|
||||
"&" { count (3); return (PARSEOP_EXP_AND); }
|
||||
"<=" { count (3); return (PARSEOP_EXP_LESS_EQUAL); }
|
||||
">=" { count (3); return (PARSEOP_EXP_GREATER_EQUAL); }
|
||||
"==" { count (3); return (PARSEOP_EXP_EQUAL); }
|
||||
"!=" { count (3); return (PARSEOP_EXP_NOT_EQUAL); }
|
||||
"|" { count (3); return (PARSEOP_EXP_OR); }
|
||||
"&&" { count (3); return (PARSEOP_EXP_LOGICAL_AND); }
|
||||
"||" { count (3); return (PARSEOP_EXP_LOGICAL_OR); }
|
||||
"++" { count (3); return (PARSEOP_EXP_INCREMENT); }
|
||||
"--" { count (3); return (PARSEOP_EXP_DECREMENT); }
|
||||
"^ " { count (3); return (PARSEOP_EXP_XOR); }
|
||||
|
||||
/* ASL Extension: Standard C assignment operators */
|
||||
|
||||
"=" { count (3); return (PARSEOP_EXP_EQUALS); }
|
||||
"+=" { count (3); return (PARSEOP_EXP_ADD_EQ); }
|
||||
"-=" { count (3); return (PARSEOP_EXP_SUB_EQ); }
|
||||
"*=" { count (3); return (PARSEOP_EXP_MUL_EQ); }
|
||||
"/=" { count (3); return (PARSEOP_EXP_DIV_EQ); }
|
||||
"%=" { count (3); return (PARSEOP_EXP_MOD_EQ); }
|
||||
"<<=" { count (3); return (PARSEOP_EXP_SHL_EQ); }
|
||||
">>=" { count (3); return (PARSEOP_EXP_SHR_EQ); }
|
||||
"&=" { count (3); return (PARSEOP_EXP_AND_EQ); }
|
||||
"^=" { count (3); return (PARSEOP_EXP_XOR_EQ); }
|
||||
"|=" { count (3); return (PARSEOP_EXP_OR_EQ); }
|
||||
|
||||
|
||||
/*
|
||||
* Begin standard ASL grammar
|
||||
*/
|
||||
0[xX]{HexDigitChar}+ |
|
||||
{DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
|
||||
count (1); return (PARSEOP_INTEGER); }
|
||||
@ -592,6 +634,44 @@ NamePathTail [.]{NameSeg}
|
||||
"Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); }
|
||||
"Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); }
|
||||
|
||||
/* ToPld macro */
|
||||
|
||||
"ToPLD" { count (0); return (PARSEOP_TOPLD); }
|
||||
|
||||
"PLD_Revision" { count (0); return (PARSEOP_PLD_REVISION); }
|
||||
"PLD_IgnoreColor" { count (0); return (PARSEOP_PLD_IGNORECOLOR); }
|
||||
"PLD_Red" { count (0); return (PARSEOP_PLD_RED); }
|
||||
"PLD_Green" { count (0); return (PARSEOP_PLD_GREEN); }
|
||||
"PLD_Blue" { count (0); return (PARSEOP_PLD_BLUE); }
|
||||
"PLD_Width" { count (0); return (PARSEOP_PLD_WIDTH); }
|
||||
"PLD_Height" { count (0); return (PARSEOP_PLD_HEIGHT); }
|
||||
"PLD_UserVisible" { count (0); return (PARSEOP_PLD_USERVISIBLE); }
|
||||
"PLD_Dock" { count (0); return (PARSEOP_PLD_DOCK); }
|
||||
"PLD_Lid" { count (0); return (PARSEOP_PLD_LID); }
|
||||
"PLD_Panel" { count (0); return (PARSEOP_PLD_PANEL); }
|
||||
"PLD_VerticalPosition" { count (0); return (PARSEOP_PLD_VERTICALPOSITION); }
|
||||
"PLD_HorizontalPosition" { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); }
|
||||
"PLD_Shape" { count (0); return (PARSEOP_PLD_SHAPE); }
|
||||
"PLD_GroupOrientation" { count (0); return (PARSEOP_PLD_GROUPORIENTATION); }
|
||||
"PLD_GroupToken" { count (0); return (PARSEOP_PLD_GROUPTOKEN); }
|
||||
"PLD_GroupPosition" { count (0); return (PARSEOP_PLD_GROUPPOSITION); }
|
||||
"PLD_Bay" { count (0); return (PARSEOP_PLD_BAY); }
|
||||
"PLD_Ejectable" { count (0); return (PARSEOP_PLD_EJECTABLE); }
|
||||
"PLD_EjectRequired" { count (0); return (PARSEOP_PLD_EJECTREQUIRED); }
|
||||
"PLD_CabinetNumber" { count (0); return (PARSEOP_PLD_CABINETNUMBER); }
|
||||
"PLD_CardCageNumber" { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); }
|
||||
"PLD_Reference" { count (0); return (PARSEOP_PLD_REFERENCE); }
|
||||
"PLD_Rotation" { count (0); return (PARSEOP_PLD_ROTATION); }
|
||||
"PLD_Order" { count (0); return (PARSEOP_PLD_ORDER); }
|
||||
"PLD_Reserved" { count (0); return (PARSEOP_PLD_RESERVED); }
|
||||
"PLD_VerticalOffset" { count (0); return (PARSEOP_PLD_VERTICALOFFSET); }
|
||||
"PLD_HorizontalOffset" { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); }
|
||||
|
||||
|
||||
/* printf debug macros */
|
||||
"printf" { count (0); return (PARSEOP_PRINTF); }
|
||||
"fprintf" { count (0); return (PARSEOP_FPRINTF); }
|
||||
|
||||
/* Predefined compiler names */
|
||||
|
||||
"__DATE__" { count (0); return (PARSEOP___DATE__); }
|
||||
@ -628,10 +708,6 @@ NamePathTail [.]{NameSeg}
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
|
||||
return (PARSEOP_NAMESTRING); }
|
||||
|
||||
"*" |
|
||||
"/" { count (1);
|
||||
AslCompilererror ("Parse error, expecting ASL keyword or name");}
|
||||
|
||||
. { count (1);
|
||||
sprintf (MsgBuffer,
|
||||
"Invalid character (0x%2.2X), expecting ASL keyword or name",
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -49,8 +49,8 @@
|
||||
* Compiler versions and names
|
||||
*/
|
||||
#define ASL_REVISION ACPI_CA_VERSION
|
||||
#define ASL_COMPILER_NAME "ASL Optimizing Compiler"
|
||||
#define AML_DISASSEMBLER_NAME "AML Disassembler"
|
||||
#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler"
|
||||
#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
|
||||
#define ASL_INVOCATION_NAME "iasl"
|
||||
#define ASL_CREATOR_ID "INTL"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -918,6 +918,8 @@ AslCompilererror (
|
||||
const char *CompilerMessage)
|
||||
{
|
||||
|
||||
Gbl_SyntaxError++;
|
||||
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber,
|
||||
Gbl_LogicalLineNumber, Gbl_CurrentLineOffset,
|
||||
Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename,
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -68,8 +68,8 @@ FlFileError (
|
||||
UINT8 ErrorId)
|
||||
{
|
||||
|
||||
sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename,
|
||||
strerror (errno));
|
||||
sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename,
|
||||
Gbl_Files[FileId].Description, strerror (errno));
|
||||
AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
|
||||
}
|
||||
|
||||
@ -98,6 +98,9 @@ FlOpenFile (
|
||||
FILE *File;
|
||||
|
||||
|
||||
Gbl_Files[FileId].Filename = Filename;
|
||||
Gbl_Files[FileId].Handle = NULL;
|
||||
|
||||
File = fopen (Filename, Mode);
|
||||
if (!File)
|
||||
{
|
||||
@ -105,8 +108,7 @@ FlOpenFile (
|
||||
AslAbort ();
|
||||
}
|
||||
|
||||
Gbl_Files[FileId].Filename = Filename;
|
||||
Gbl_Files[FileId].Handle = File;
|
||||
Gbl_Files[FileId].Handle = File;
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -485,6 +485,8 @@ FlOpenAmlOutputFile (
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = Filename;
|
||||
}
|
||||
|
||||
/* Open the output AML file in binary mode */
|
||||
@ -563,9 +565,14 @@ FlOpenMiscOutputFiles (
|
||||
|
||||
if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
/*
|
||||
* A problem with freopen is that on error,
|
||||
* we no longer have stderr.
|
||||
*/
|
||||
Gbl_DebugFlag = FALSE;
|
||||
memcpy (stderr, stdout, sizeof (FILE));
|
||||
FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME);
|
||||
AslAbort ();
|
||||
}
|
||||
|
||||
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
|
||||
@ -758,6 +765,26 @@ FlOpenMiscOutputFiles (
|
||||
AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a map file if requested */
|
||||
|
||||
if (Gbl_MapfileFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the hex file, text mode (closed at compiler exit) */
|
||||
|
||||
FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
|
||||
|
||||
AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -127,6 +127,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0);
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0);
|
||||
|
||||
/* Exception reporting */
|
||||
|
||||
@ -173,6 +174,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE);
|
||||
|
||||
|
||||
#define HEX_OUTPUT_NONE 0
|
||||
@ -251,6 +253,8 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0)
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG");
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID");
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_PruneDepth, 0);
|
||||
ASL_EXTERN UINT16 ASL_INIT_GLOBAL (Gbl_PruneType, 0);
|
||||
|
||||
|
||||
/* Static structures */
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -41,8 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#define __ASLLOAD_C__
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/include/amlcode.h>
|
||||
#include <contrib/dev/acpica/include/acdispat.h>
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -187,13 +187,17 @@ Usage (
|
||||
ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
|
||||
ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
|
||||
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
|
||||
ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
|
||||
ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
|
||||
ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
|
||||
ACPI_OPTION ("-in", "Ignore NoOp opcodes");
|
||||
ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
|
||||
|
||||
printf ("\nDebug Options:\n");
|
||||
ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)");
|
||||
ACPI_OPTION ("-bf", "Create debug file (full output) (*.txt)");
|
||||
ACPI_OPTION ("-bs", "Create debug file (parse tree only) (*.txt)");
|
||||
ACPI_OPTION ("-bp <depth>", "Prune ASL parse tree");
|
||||
ACPI_OPTION ("-bt <type>", "Object type to be pruned from the parse tree");
|
||||
ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)");
|
||||
ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)");
|
||||
ACPI_OPTION ("-n", "Parse only, no output generation");
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -446,7 +446,38 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
|
||||
/* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
|
||||
/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
|
||||
/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* RED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* GREEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* BLUE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* WIDTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* HEIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* USERVISIBLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* DOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* LID */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* PANEL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* VERTICALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* HORIZONTALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* SHAPE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* GROUPORIENTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* GROUPTOKEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* GROUPPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* BAY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* EJECTABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* EJECTREQUIRED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* CABINETNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* CARDCAGENUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* REFERENCE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* ROTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* ORDER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* RESERVED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* VERTICALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* HORIZONTALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* PRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
|
||||
/* FPRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
|
||||
/*! [End] no source code translation !*/
|
||||
|
||||
};
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -116,7 +116,7 @@ const char *PolarityDecode[] =
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: External interface.
|
||||
* Create and open the mapfile and emit all of the collected
|
||||
* Map file has already been opened. Emit all of the collected
|
||||
* hardware mapping information. Includes: GPIO information,
|
||||
* Serial information, and a dump of the entire ACPI device tree.
|
||||
*
|
||||
@ -126,8 +126,6 @@ void
|
||||
MpEmitMappingInfo (
|
||||
void)
|
||||
{
|
||||
char *NewFilename;
|
||||
|
||||
|
||||
/* Mapfile option enabled? */
|
||||
|
||||
@ -136,22 +134,6 @@ MpEmitMappingInfo (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Create/Open a map file */
|
||||
|
||||
NewFilename = FlGenerateFilename (Gbl_OutputFilenamePrefix,
|
||||
FILE_SUFFIX_MAP);
|
||||
if (!NewFilename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Open the hex file, text mode (closed at compiler exit) */
|
||||
|
||||
FlOpenFile (ASL_FILE_MAP_OUTPUT, NewFilename, "w+t");
|
||||
AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
|
||||
|
||||
if (!Gbl_GpioList)
|
||||
{
|
||||
FlPrintFile (ASL_FILE_MAP_OUTPUT,
|
||||
@ -630,9 +612,6 @@ MpNamespaceXrefBegin (
|
||||
|
||||
if (Op->Asl.Node == Info->TargetNode)
|
||||
{
|
||||
DevicePathname = AcpiNsGetExternalPathname (
|
||||
Info->TargetNode);
|
||||
|
||||
while (ParentOp && (!ParentOp->Asl.Node))
|
||||
{
|
||||
ParentOp = ParentOp->Asl.Parent;
|
||||
@ -654,6 +633,8 @@ MpNamespaceXrefBegin (
|
||||
DevicePathname, HidString);
|
||||
|
||||
Info->References++;
|
||||
|
||||
ACPI_FREE (DevicePathname);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -67,10 +67,63 @@ static void
|
||||
OpcDoEisaId (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static void
|
||||
OpcDoPld (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static void
|
||||
OpcDoUuId (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static UINT8 *
|
||||
OpcEncodePldBuffer (
|
||||
ACPI_PLD_INFO *PldInfo);
|
||||
|
||||
|
||||
/* ToPld strings */
|
||||
|
||||
static char *AslPldPanelList[] =
|
||||
{
|
||||
"TOP",
|
||||
"BOTTOM",
|
||||
"LEFT",
|
||||
"RIGHT",
|
||||
"FRONT",
|
||||
"BACK",
|
||||
"UNKNOWN",
|
||||
NULL
|
||||
};
|
||||
|
||||
static char *AslPldVerticalPositionList[] =
|
||||
{
|
||||
"UPPER",
|
||||
"CENTER",
|
||||
"LOWER",
|
||||
NULL
|
||||
};
|
||||
|
||||
static char *AslPldHorizontalPositionList[] =
|
||||
{
|
||||
"LEFT",
|
||||
"CENTER",
|
||||
"RIGHT",
|
||||
NULL
|
||||
};
|
||||
|
||||
static char *AslPldShapeList[] =
|
||||
{
|
||||
"ROUND",
|
||||
"OVAL",
|
||||
"SQUARE",
|
||||
"VERTICALRECTANGLE",
|
||||
"HORIZONTALRECTANGLE",
|
||||
"VERTICALTRAPEZOID",
|
||||
"HORIZONTALTRAPEZOID",
|
||||
"UNKNOWN",
|
||||
"CHAMFERED",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -651,11 +704,700 @@ OpcDoEisaId (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcEncodePldBuffer
|
||||
*
|
||||
* PARAMETERS: PldInfo - _PLD buffer struct (Using local struct)
|
||||
*
|
||||
* RETURN: Encode _PLD buffer suitable for return value from _PLD
|
||||
*
|
||||
* DESCRIPTION: Bit-packs a _PLD buffer struct.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT8 *
|
||||
OpcEncodePldBuffer (
|
||||
ACPI_PLD_INFO *PldInfo)
|
||||
{
|
||||
UINT32 *Buffer;
|
||||
UINT32 Dword;
|
||||
|
||||
|
||||
Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE);
|
||||
if (!Buffer)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* First 32 bits */
|
||||
|
||||
Dword = 0;
|
||||
ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
|
||||
ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
|
||||
ACPI_PLD_SET_RED (&Dword, PldInfo->Red);
|
||||
ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green);
|
||||
ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue);
|
||||
ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
|
||||
|
||||
/* Second 32 bits */
|
||||
|
||||
Dword = 0;
|
||||
ACPI_PLD_SET_WIDTH (&Dword, PldInfo->Width);
|
||||
ACPI_PLD_SET_HEIGHT (&Dword, PldInfo->Height);
|
||||
ACPI_MOVE_32_TO_32 (&Buffer[1], &Dword);
|
||||
|
||||
/* Third 32 bits */
|
||||
|
||||
Dword = 0;
|
||||
ACPI_PLD_SET_USER_VISIBLE (&Dword, PldInfo->UserVisible);
|
||||
ACPI_PLD_SET_DOCK (&Dword, PldInfo->Dock);
|
||||
ACPI_PLD_SET_LID (&Dword, PldInfo->Lid);
|
||||
ACPI_PLD_SET_PANEL (&Dword, PldInfo->Panel);
|
||||
ACPI_PLD_SET_VERTICAL (&Dword, PldInfo->VerticalPosition);
|
||||
ACPI_PLD_SET_HORIZONTAL (&Dword, PldInfo->HorizontalPosition);
|
||||
ACPI_PLD_SET_SHAPE (&Dword, PldInfo->Shape);
|
||||
ACPI_PLD_SET_ORIENTATION (&Dword, PldInfo->GroupOrientation);
|
||||
ACPI_PLD_SET_TOKEN (&Dword, PldInfo->GroupToken);
|
||||
ACPI_PLD_SET_POSITION (&Dword, PldInfo->GroupPosition);
|
||||
ACPI_PLD_SET_BAY (&Dword, PldInfo->Bay);
|
||||
ACPI_MOVE_32_TO_32 (&Buffer[2], &Dword);
|
||||
|
||||
/* Fourth 32 bits */
|
||||
|
||||
Dword = 0;
|
||||
ACPI_PLD_SET_EJECTABLE (&Dword, PldInfo->Ejectable);
|
||||
ACPI_PLD_SET_OSPM_EJECT (&Dword, PldInfo->OspmEjectRequired);
|
||||
ACPI_PLD_SET_CABINET (&Dword, PldInfo->CabinetNumber);
|
||||
ACPI_PLD_SET_CARD_CAGE (&Dword, PldInfo->CardCageNumber);
|
||||
ACPI_PLD_SET_REFERENCE (&Dword, PldInfo->Reference);
|
||||
ACPI_PLD_SET_ROTATION (&Dword, PldInfo->Rotation);
|
||||
ACPI_PLD_SET_ORDER (&Dword, PldInfo->Order);
|
||||
ACPI_MOVE_32_TO_32 (&Buffer[3], &Dword);
|
||||
|
||||
if (PldInfo->Revision >= 2)
|
||||
{
|
||||
/* Fifth 32 bits */
|
||||
|
||||
Dword = 0;
|
||||
ACPI_PLD_SET_VERT_OFFSET (&Dword, PldInfo->VerticalOffset);
|
||||
ACPI_PLD_SET_HORIZ_OFFSET (&Dword, PldInfo->HorizontalOffset);
|
||||
ACPI_MOVE_32_TO_32 (&Buffer[4], &Dword);
|
||||
}
|
||||
|
||||
return (ACPI_CAST_PTR (UINT8, Buffer));
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcStrupr (strupr)
|
||||
*
|
||||
* PARAMETERS: SrcString - The source string to convert
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert string to uppercase
|
||||
*
|
||||
* NOTE: This is not a POSIX function, so it appears here, not in utclib.c
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
OpcStrupr (
|
||||
char *SrcString)
|
||||
{
|
||||
char *String;
|
||||
|
||||
|
||||
if (!SrcString)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Walk entire string, uppercasing the letters */
|
||||
|
||||
for (String = SrcString; *String; String++)
|
||||
{
|
||||
*String = (char) toupper ((int) *String);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcFindName
|
||||
*
|
||||
* PARAMETERS: List - Array of char strings to be searched
|
||||
* Name - Char string to string for
|
||||
* Index - Index value to set if found
|
||||
*
|
||||
* RETURN: TRUE if any names matched, FALSE otherwise
|
||||
*
|
||||
* DESCRIPTION: Match PLD name to value in lookup table. Sets Value to
|
||||
* equivalent parameter value.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
OpcFindName (
|
||||
char **List,
|
||||
char *Name,
|
||||
UINT64 *Index)
|
||||
{
|
||||
char *Str;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
OpcStrupr (Name);
|
||||
|
||||
for (i = 0, Str = List[0]; Str; i++, Str = List[i])
|
||||
{
|
||||
if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name))))
|
||||
{
|
||||
*Index = i;
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcDoPld
|
||||
*
|
||||
* PARAMETERS: Op - Parse node
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert ToPLD macro to 20-byte buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
OpcDoPld (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
UINT8 *Buffer;
|
||||
ACPI_PARSE_OBJECT *Node;
|
||||
ACPI_PLD_INFO PldInfo;
|
||||
ACPI_PARSE_OBJECT *NewOp;
|
||||
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_NOT_EXIST, Op, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Op->Asl.ParseOpcode != PARSEOP_TOPLD)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Op, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE);
|
||||
if (!Buffer)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO));
|
||||
|
||||
Node = Op->Asl.Child;
|
||||
while (Node)
|
||||
{
|
||||
switch (Node->Asl.ParseOpcode)
|
||||
{
|
||||
case PARSEOP_PLD_REVISION:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 127)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
PldInfo.Revision = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_IGNORECOLOR:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 1)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
PldInfo.IgnoreColor = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_RED:
|
||||
case PARSEOP_PLD_GREEN:
|
||||
case PARSEOP_PLD_BLUE:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 255)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.ParseOpcode == PARSEOP_PLD_RED)
|
||||
{
|
||||
PldInfo.Red = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else if (Node->Asl.ParseOpcode == PARSEOP_PLD_GREEN)
|
||||
{
|
||||
PldInfo.Green = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else /* PARSEOP_PLD_BLUE */
|
||||
{
|
||||
PldInfo.Blue = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_WIDTH:
|
||||
case PARSEOP_PLD_HEIGHT:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 65535)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.ParseOpcode == PARSEOP_PLD_WIDTH)
|
||||
{
|
||||
PldInfo.Width = (UINT16) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else /* PARSEOP_PLD_HEIGHT */
|
||||
{
|
||||
PldInfo.Height = (UINT16) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_USERVISIBLE:
|
||||
case PARSEOP_PLD_DOCK:
|
||||
case PARSEOP_PLD_LID:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 1)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.ParseOpcode == PARSEOP_PLD_USERVISIBLE)
|
||||
{
|
||||
PldInfo.UserVisible = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else if (Node->Asl.ParseOpcode == PARSEOP_PLD_DOCK)
|
||||
{
|
||||
PldInfo.Dock = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else
|
||||
{
|
||||
PldInfo.Lid = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_PANEL:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
|
||||
{
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 6)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else /* PARSEOP_STRING */
|
||||
{
|
||||
if (!OpcFindName(AslPldPanelList,
|
||||
Node->Asl.Child->Asl.Value.String,
|
||||
&Node->Asl.Child->Asl.Value.Integer))
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PldInfo.Panel = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_VERTICALPOSITION:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
|
||||
{
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 2)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else /* PARSEOP_STRING */
|
||||
{
|
||||
if (!OpcFindName(AslPldVerticalPositionList,
|
||||
Node->Asl.Child->Asl.Value.String,
|
||||
&Node->Asl.Child->Asl.Value.Integer))
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PldInfo.VerticalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_HORIZONTALPOSITION:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
|
||||
{
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 2)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else /* PARSEOP_STRING */
|
||||
{
|
||||
if (!OpcFindName(AslPldHorizontalPositionList,
|
||||
Node->Asl.Child->Asl.Value.String,
|
||||
&Node->Asl.Child->Asl.Value.Integer))
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PldInfo.HorizontalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_SHAPE:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
|
||||
{
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 8)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else /* PARSEOP_STRING */
|
||||
{
|
||||
if (!OpcFindName(AslPldShapeList,
|
||||
Node->Asl.Child->Asl.Value.String,
|
||||
&Node->Asl.Child->Asl.Value.Integer))
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PldInfo.Shape = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_GROUPORIENTATION:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 1)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
PldInfo.GroupOrientation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_GROUPTOKEN:
|
||||
case PARSEOP_PLD_GROUPPOSITION:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 255)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (Node->Asl.ParseOpcode == PARSEOP_PLD_GROUPTOKEN)
|
||||
{
|
||||
PldInfo.GroupToken = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else /* PARSEOP_PLD_GROUPPOSITION */
|
||||
{
|
||||
PldInfo.GroupPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_BAY:
|
||||
case PARSEOP_PLD_EJECTABLE:
|
||||
case PARSEOP_PLD_EJECTREQUIRED:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 1)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.ParseOpcode == PARSEOP_PLD_BAY)
|
||||
{
|
||||
PldInfo.Bay = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else if (Node->Asl.ParseOpcode == PARSEOP_PLD_EJECTABLE)
|
||||
{
|
||||
PldInfo.Ejectable = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else /* PARSEOP_PLD_EJECTREQUIRED */
|
||||
{
|
||||
PldInfo.OspmEjectRequired = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_CABINETNUMBER:
|
||||
case PARSEOP_PLD_CARDCAGENUMBER:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 255)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.ParseOpcode == PARSEOP_PLD_CABINETNUMBER)
|
||||
{
|
||||
PldInfo.CabinetNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else /* PARSEOP_PLD_CARDCAGENUMBER */
|
||||
{
|
||||
PldInfo.CardCageNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_REFERENCE:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 1)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
PldInfo.Reference = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_ROTATION:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 7)
|
||||
{
|
||||
switch (Node->Asl.Child->Asl.Value.Integer)
|
||||
{
|
||||
case 45:
|
||||
|
||||
Node->Asl.Child->Asl.Value.Integer = 1;
|
||||
break;
|
||||
|
||||
case 90:
|
||||
|
||||
Node->Asl.Child->Asl.Value.Integer = 2;
|
||||
break;
|
||||
|
||||
case 135:
|
||||
|
||||
Node->Asl.Child->Asl.Value.Integer = 3;
|
||||
break;
|
||||
|
||||
case 180:
|
||||
|
||||
Node->Asl.Child->Asl.Value.Integer = 4;
|
||||
break;
|
||||
|
||||
case 225:
|
||||
|
||||
Node->Asl.Child->Asl.Value.Integer = 5;
|
||||
break;
|
||||
|
||||
case 270:
|
||||
|
||||
Node->Asl.Child->Asl.Value.Integer = 6;
|
||||
break;
|
||||
|
||||
case 315:
|
||||
|
||||
Node->Asl.Child->Asl.Value.Integer = 7;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PldInfo.Rotation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_ORDER:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 31)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
PldInfo.Order = (UINT8) Node->Asl.Child->Asl.Value.Integer;
|
||||
break;
|
||||
|
||||
case PARSEOP_PLD_VERTICALOFFSET:
|
||||
case PARSEOP_PLD_HORIZONTALOFFSET:
|
||||
|
||||
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.Child->Asl.Value.Integer > 65535)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Node->Asl.ParseOpcode == PARSEOP_PLD_VERTICALOFFSET)
|
||||
{
|
||||
PldInfo.VerticalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
else /* PARSEOP_PLD_HORIZONTALOFFSET */
|
||||
{
|
||||
PldInfo.HorizontalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
Node = Node->Asl.Next;
|
||||
}
|
||||
|
||||
Buffer = OpcEncodePldBuffer(&PldInfo);
|
||||
|
||||
/* Change Op to a Buffer */
|
||||
|
||||
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
|
||||
Op->Common.AmlOpcode = AML_BUFFER_OP;
|
||||
|
||||
/* Disable further optimization */
|
||||
|
||||
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Child node is the buffer length */
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_INTEGER);
|
||||
|
||||
NewOp->Asl.AmlOpcode = AML_BYTE_OP;
|
||||
NewOp->Asl.Value.Integer = 20;
|
||||
NewOp->Asl.Parent = Op;
|
||||
|
||||
Op->Asl.Child = NewOp;
|
||||
Op = NewOp;
|
||||
|
||||
/* Peer to the child is the raw buffer data */
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
|
||||
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
|
||||
NewOp->Asl.AmlLength = 20;
|
||||
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
|
||||
NewOp->Asl.Parent = Op->Asl.Parent;
|
||||
|
||||
Op->Asl.Next = NewOp;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcDoUuId
|
||||
*
|
||||
* PARAMETERS: Op - Parse node
|
||||
* PARAMETERS: Op - Parse node
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -673,7 +1415,7 @@ OpcDoUuId (
|
||||
ACPI_PARSE_OBJECT *NewOp;
|
||||
|
||||
|
||||
InString = (char *) Op->Asl.Value.String;
|
||||
InString = ACPI_CAST_PTR (char, Op->Asl.Value.String);
|
||||
Buffer = UtLocalCalloc (16);
|
||||
|
||||
Status = AuValidateUuid (InString);
|
||||
@ -712,7 +1454,7 @@ OpcDoUuId (
|
||||
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
|
||||
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
|
||||
NewOp->Asl.AmlLength = 16;
|
||||
NewOp->Asl.Value.String = (char *) Buffer;
|
||||
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
|
||||
NewOp->Asl.Parent = Op->Asl.Parent;
|
||||
|
||||
Op->Asl.Next = NewOp;
|
||||
@ -723,7 +1465,7 @@ OpcDoUuId (
|
||||
*
|
||||
* FUNCTION: OpcGenerateAmlOpcode
|
||||
*
|
||||
* PARAMETERS: Op - Parse node
|
||||
* PARAMETERS: Op - Parse node
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -737,7 +1479,6 @@ void
|
||||
OpcGenerateAmlOpcode (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
UINT16 Index;
|
||||
|
||||
|
||||
@ -783,6 +1524,21 @@ OpcGenerateAmlOpcode (
|
||||
OpcDoEisaId (Op);
|
||||
break;
|
||||
|
||||
case PARSEOP_PRINTF:
|
||||
|
||||
OpcDoPrintf (Op);
|
||||
break;
|
||||
|
||||
case PARSEOP_FPRINTF:
|
||||
|
||||
OpcDoFprintf (Op);
|
||||
break;
|
||||
|
||||
case PARSEOP_TOPLD:
|
||||
|
||||
OpcDoPld (Op);
|
||||
break;
|
||||
|
||||
case PARSEOP_TOUUID:
|
||||
|
||||
OpcDoUuId (Op);
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -184,7 +184,7 @@ AslDoOptions (
|
||||
}
|
||||
break;
|
||||
|
||||
case 'b': /* Debug output options */
|
||||
case 'b': /* Debug options */
|
||||
|
||||
switch (AcpiGbl_Optarg[0])
|
||||
{
|
||||
@ -193,10 +193,37 @@ AslDoOptions (
|
||||
AslCompilerdebug = 1; /* same as yydebug */
|
||||
DtParserdebug = 1;
|
||||
PrParserdebug = 1;
|
||||
Gbl_DebugFlag = TRUE;
|
||||
break;
|
||||
|
||||
case 'p': /* Prune ASL parse tree */
|
||||
|
||||
/* Get the required argument */
|
||||
|
||||
if (AcpiGetoptArgument (argc, argv))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
Gbl_PruneParseTree = TRUE;
|
||||
Gbl_PruneDepth = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
|
||||
Gbl_DebugFlag = TRUE;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
|
||||
/* Get the required argument */
|
||||
|
||||
if (AcpiGetoptArgument (argc, argv))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
Gbl_PruneType = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -205,9 +232,6 @@ AslDoOptions (
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Produce debug output file */
|
||||
|
||||
Gbl_DebugFlag = TRUE;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
@ -250,6 +274,12 @@ AslDoOptions (
|
||||
|
||||
break;
|
||||
|
||||
case 'l': /* Use legacy ASL code (not ASL+) for disassembly */
|
||||
|
||||
Gbl_DoCompile = FALSE;
|
||||
AcpiGbl_CstyleDisassembly = FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
|
||||
@ -530,7 +560,6 @@ AslDoOptions (
|
||||
|
||||
Gbl_OutputFilenamePrefix = AcpiGbl_Optarg;
|
||||
UtConvertBackslashes (Gbl_OutputFilenamePrefix);
|
||||
|
||||
Gbl_UseDefaultAmlFilename = FALSE;
|
||||
break;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -99,7 +99,7 @@ AslLocalAllocate (
|
||||
* These shift/reduce conflicts are expected. There should be zero
|
||||
* reduce/reduce conflicts.
|
||||
*/
|
||||
%expect 86
|
||||
%expect 89
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
380
sys/contrib/dev/acpica/compiler/aslprintf.c
Normal file
380
sys/contrib/dev/acpica/compiler/aslprintf.c
Normal file
@ -0,0 +1,380 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslprintf - ASL Printf/Fprintf macro support
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
|
||||
*/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/amlcode.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslprintf")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
OpcCreateConcatenateNode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_PARSE_OBJECT *Node);
|
||||
|
||||
static void
|
||||
OpcParsePrintf (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_PARSE_OBJECT *DestOp);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcDoPrintf
|
||||
*
|
||||
* PARAMETERS: Op - printf parse node
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert printf macro to a Store(..., Debug) AML operation.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
OpcDoPrintf (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *DestOp;
|
||||
|
||||
|
||||
/* Store destination is the Debug op */
|
||||
|
||||
DestOp = TrAllocateNode (PARSEOP_DEBUG);
|
||||
DestOp->Asl.AmlOpcode = AML_DEBUG_OP;
|
||||
DestOp->Asl.Parent = Op;
|
||||
DestOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
|
||||
|
||||
OpcParsePrintf (Op, DestOp);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcDoFprintf
|
||||
*
|
||||
* PARAMETERS: Op - fprintf parse node
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert fprintf macro to a Store AML operation.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
OpcDoFprintf (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *DestOp;
|
||||
|
||||
|
||||
/* Store destination is the first argument of fprintf */
|
||||
|
||||
DestOp = Op->Asl.Child;
|
||||
Op->Asl.Child = DestOp->Asl.Next;
|
||||
DestOp->Asl.Next = NULL;
|
||||
|
||||
OpcParsePrintf (Op, DestOp);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcParsePrintf
|
||||
*
|
||||
* PARAMETERS: Op - Printf parse node
|
||||
* DestOp - Destination of Store operation
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert printf macro to a Store AML operation. The printf
|
||||
* macro parse tree is layed out as follows:
|
||||
*
|
||||
* Op - printf parse op
|
||||
* Op->Child - Format string
|
||||
* Op->Next - Format string arguments
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
OpcParsePrintf (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_PARSE_OBJECT *DestOp)
|
||||
{
|
||||
char *Format;
|
||||
char *StartPosition = NULL;
|
||||
ACPI_PARSE_OBJECT *ArgNode;
|
||||
ACPI_PARSE_OBJECT *NextNode;
|
||||
UINT32 StringLength = 0;
|
||||
char *NewString;
|
||||
BOOLEAN StringToProcess = FALSE;
|
||||
ACPI_PARSE_OBJECT *NewOp;
|
||||
|
||||
|
||||
/* Get format string */
|
||||
|
||||
Format = ACPI_CAST_PTR (char, Op->Asl.Child->Asl.Value.String);
|
||||
ArgNode = Op->Asl.Child->Asl.Next;
|
||||
|
||||
/*
|
||||
* Detach argument list so that we can use a NULL check to distinguish
|
||||
* the first concatenation operation we need to make
|
||||
*/
|
||||
Op->Asl.Child = NULL;
|
||||
|
||||
for (; *Format; ++Format)
|
||||
{
|
||||
if (*Format != '%')
|
||||
{
|
||||
if (!StringToProcess)
|
||||
{
|
||||
/* Mark the beginning of a string */
|
||||
|
||||
StartPosition = Format;
|
||||
StringToProcess = TRUE;
|
||||
}
|
||||
|
||||
++StringLength;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Save string, if any, to new string object and concat it */
|
||||
|
||||
if (StringToProcess)
|
||||
{
|
||||
NewString = UtStringCacheCalloc (StringLength + 1);
|
||||
ACPI_STRNCPY (NewString, StartPosition, StringLength);
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
NewOp->Asl.Value.String = NewString;
|
||||
NewOp->Asl.AmlOpcode = AML_STRING_OP;
|
||||
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
|
||||
NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
|
||||
|
||||
OpcCreateConcatenateNode(Op, NewOp);
|
||||
|
||||
StringLength = 0;
|
||||
StringToProcess = FALSE;
|
||||
}
|
||||
|
||||
++Format;
|
||||
|
||||
/*
|
||||
* We have a format parameter and will need an argument to go
|
||||
* with it
|
||||
*/
|
||||
if (!ArgNode ||
|
||||
ArgNode->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_ARG_COUNT_LO, Op, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* We do not support sub-specifiers of printf (flags, width,
|
||||
* precision, length). For specifiers we only support %x/%X for
|
||||
* hex or %s for strings. Also, %o for generic "acpi object".
|
||||
*/
|
||||
switch (*Format)
|
||||
{
|
||||
case 's':
|
||||
|
||||
if (ArgNode->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)
|
||||
{
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgNode,
|
||||
"String required");
|
||||
return;
|
||||
}
|
||||
|
||||
NextNode = ArgNode->Asl.Next;
|
||||
ArgNode->Asl.Next = NULL;
|
||||
OpcCreateConcatenateNode(Op, ArgNode);
|
||||
ArgNode = NextNode;
|
||||
continue;
|
||||
|
||||
case 'X':
|
||||
case 'x':
|
||||
case 'o':
|
||||
|
||||
NextNode = ArgNode->Asl.Next;
|
||||
ArgNode->Asl.Next = NULL;
|
||||
|
||||
/*
|
||||
* Append an empty string if the first argument is
|
||||
* not a string. This will implicitly conver the 2nd
|
||||
* concat source to a string per the ACPI specification.
|
||||
*/
|
||||
if (!Op->Asl.Child)
|
||||
{
|
||||
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
NewOp->Asl.Value.String = "";
|
||||
NewOp->Asl.AmlOpcode = AML_STRING_OP;
|
||||
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
|
||||
NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
|
||||
|
||||
OpcCreateConcatenateNode(Op, NewOp);
|
||||
}
|
||||
|
||||
OpcCreateConcatenateNode(Op, ArgNode);
|
||||
ArgNode = NextNode;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Op,
|
||||
"Unrecognized format specifier");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Process any remaining string */
|
||||
|
||||
if (StringToProcess)
|
||||
{
|
||||
NewString = UtStringCacheCalloc (StringLength + 1);
|
||||
ACPI_STRNCPY (NewString, StartPosition, StringLength);
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
NewOp->Asl.Value.String = NewString;
|
||||
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
|
||||
NewOp->Asl.AmlOpcode = AML_STRING_OP;
|
||||
NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
|
||||
|
||||
OpcCreateConcatenateNode(Op, NewOp);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we get here and there's no child node then Format
|
||||
* was an empty string. Just make a no op.
|
||||
*/
|
||||
if (!Op->Asl.Child)
|
||||
{
|
||||
Op->Asl.ParseOpcode = PARSEOP_NOOP;
|
||||
AslError(ASL_WARNING, ASL_MSG_NULL_STRING, Op,
|
||||
"Converted to NOOP");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for erroneous extra arguments */
|
||||
|
||||
if (ArgNode &&
|
||||
ArgNode->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
|
||||
{
|
||||
AslError(ASL_WARNING, ASL_MSG_ARG_COUNT_HI, ArgNode,
|
||||
"Extra arguments ignored");
|
||||
}
|
||||
|
||||
/* Change Op to a Store */
|
||||
|
||||
Op->Asl.ParseOpcode = PARSEOP_STORE;
|
||||
Op->Common.AmlOpcode = AML_STORE_OP;
|
||||
Op->Asl.CompileFlags = 0;
|
||||
|
||||
/* Disable further optimization */
|
||||
|
||||
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Set Store destination */
|
||||
|
||||
Op->Asl.Child->Asl.Next = DestOp;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: OpcCreateConcatenateNode
|
||||
*
|
||||
* PARAMETERS: Op - Parse node
|
||||
* Node - Parse node to be concatenated
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Make Node the child of Op. If child node already exists, then
|
||||
* concat child with Node and makes concat node the child of Op.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
OpcCreateConcatenateNode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_PARSE_OBJECT *Node)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *NewConcatOp;
|
||||
|
||||
|
||||
if (!Op->Asl.Child)
|
||||
{
|
||||
Op->Asl.Child = Node;
|
||||
Node->Asl.Parent = Op;
|
||||
return;
|
||||
}
|
||||
|
||||
NewConcatOp = TrAllocateNode (PARSEOP_CONCATENATE);
|
||||
NewConcatOp->Asl.AmlOpcode = AML_CONCAT_OP;
|
||||
NewConcatOp->Asl.AcpiBtype = 0x7;
|
||||
NewConcatOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
|
||||
|
||||
/* First arg is child of Op*/
|
||||
|
||||
NewConcatOp->Asl.Child = Op->Asl.Child;
|
||||
Op->Asl.Child->Asl.Parent = NewConcatOp;
|
||||
|
||||
/* Second arg is Node */
|
||||
|
||||
NewConcatOp->Asl.Child->Asl.Next = Node;
|
||||
Node->Asl.Parent = NewConcatOp;
|
||||
|
||||
/* Third arg is Zero (not used) */
|
||||
|
||||
NewConcatOp->Asl.Child->Asl.Next->Asl.Next =
|
||||
TrAllocateNode (PARSEOP_ZERO);
|
||||
NewConcatOp->Asl.Child->Asl.Next->Asl.Next->Asl.Parent =
|
||||
NewConcatOp;
|
||||
|
||||
Op->Asl.Child = NewConcatOp;
|
||||
NewConcatOp->Asl.Parent = Op;
|
||||
}
|
239
sys/contrib/dev/acpica/compiler/aslprune.c
Normal file
239
sys/contrib/dev/acpica/compiler/aslprune.c
Normal file
@ -0,0 +1,239 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslprune - Parse tree prune utility
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
|
||||
*/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/acapps.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslprune")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
PrTreePruneWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
static void
|
||||
PrPrintObjectAtLevel (
|
||||
UINT32 Level,
|
||||
const char *ObjectName);
|
||||
|
||||
|
||||
typedef struct acpi_prune_info
|
||||
{
|
||||
UINT32 PruneLevel;
|
||||
UINT16 ParseOpcode;
|
||||
UINT16 Count;
|
||||
|
||||
} ACPI_PRUNE_INFO;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslPruneParseTree
|
||||
*
|
||||
* PARAMETERS: PruneDepth - Number of levels to prune
|
||||
* Type - Prune type (Device, Method, etc.)
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Prune off one or more levels of the ASL parse tree
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AslPruneParseTree (
|
||||
UINT32 PruneDepth,
|
||||
UINT32 Type)
|
||||
{
|
||||
ACPI_PRUNE_INFO PruneObj;
|
||||
|
||||
|
||||
PruneObj.PruneLevel = PruneDepth;
|
||||
PruneObj.Count = 0;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case 0:
|
||||
PruneObj.ParseOpcode = (UINT16) PARSEOP_DEVICE;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
PruneObj.ParseOpcode = (UINT16) PARSEOP_METHOD;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
PruneObj.ParseOpcode = (UINT16) PARSEOP_IF;
|
||||
break;
|
||||
|
||||
default:
|
||||
AcpiOsPrintf ("Unsupported type: %u\n", Type);
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("Pruning parse tree, from depth %u\n",
|
||||
PruneDepth);
|
||||
|
||||
AcpiOsPrintf ("\nRemoving Objects:\n");
|
||||
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
PrTreePruneWalk, NULL, ACPI_CAST_PTR (void, &PruneObj));
|
||||
|
||||
AcpiOsPrintf ("\n%u Total Objects Removed\n", PruneObj.Count);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: PrPrintObjectAtLevel
|
||||
*
|
||||
* PARAMETERS: Level - Current nesting level
|
||||
* ObjectName - ACPI name for the object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print object name with indent
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
PrPrintObjectAtLevel (
|
||||
UINT32 Level,
|
||||
const char *ObjectName)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
for (i = 0; i < Level; i++)
|
||||
{
|
||||
AcpiOsPrintf (" ");
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("[%s] at Level [%u]\n", ObjectName, Level);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: PrTreePruneWalk
|
||||
*
|
||||
* PARAMETERS: Parse tree walk callback
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Prune off one or more levels of the ASL parse tree
|
||||
*
|
||||
* Current objects that can be pruned are: Devices, Methods, and If/Else
|
||||
* blocks.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
PrTreePruneWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context)
|
||||
{
|
||||
ACPI_PRUNE_INFO *PruneObj = (ACPI_PRUNE_INFO *) Context;
|
||||
|
||||
|
||||
/* We only care about objects below the Prune Level threshold */
|
||||
|
||||
if (Level <= PruneObj->PruneLevel)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
if ((Op->Asl.ParseOpcode != PruneObj->ParseOpcode) &&
|
||||
!(Op->Asl.ParseOpcode == PARSEOP_ELSE &&
|
||||
PruneObj->ParseOpcode == PARSEOP_IF))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
switch (Op->Asl.ParseOpcode)
|
||||
{
|
||||
case PARSEOP_METHOD:
|
||||
|
||||
AcpiOsPrintf ("Method");
|
||||
PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
|
||||
Op->Asl.Child->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next = NULL;
|
||||
PruneObj->Count++;
|
||||
break;
|
||||
|
||||
case PARSEOP_DEVICE:
|
||||
|
||||
AcpiOsPrintf ("Device");
|
||||
PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
|
||||
Op->Asl.Child->Asl.Next = NULL;
|
||||
PruneObj->Count++;
|
||||
break;
|
||||
|
||||
case PARSEOP_IF:
|
||||
case PARSEOP_ELSE:
|
||||
|
||||
if (Op->Asl.ParseOpcode == PARSEOP_ELSE)
|
||||
{
|
||||
PrPrintObjectAtLevel(Level, "Else");
|
||||
Op->Asl.Child = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
PrPrintObjectAtLevel(Level, "If");
|
||||
Op->Asl.Child->Asl.Next = NULL;
|
||||
}
|
||||
|
||||
PruneObj->Count++;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -6,7 +6,7 @@ NoEcho('
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -92,6 +92,149 @@ DefinitionBlockTerm
|
||||
'{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);}
|
||||
;
|
||||
|
||||
/*
|
||||
* ASL Extensions: C-style math/logical operators and expressions.
|
||||
* The implementation transforms these operators into the standard
|
||||
* AML opcodes and syntax.
|
||||
*
|
||||
* Supported operators and precedence rules (high-to-low)
|
||||
*
|
||||
* NOTE: The operator precedence and associativity rules are
|
||||
* implemented by the tokens in asltokens.y
|
||||
*
|
||||
* (left-to-right):
|
||||
* 1) ( ) expr++ expr--
|
||||
*
|
||||
* (right-to-left):
|
||||
* 2) ! ~
|
||||
*
|
||||
* (left-to-right):
|
||||
* 3) * / %
|
||||
* 4) + -
|
||||
* 5) >> <<
|
||||
* 6) < > <= >=
|
||||
* 7) == !=
|
||||
* 8) &
|
||||
* 9) ^
|
||||
* 10) |
|
||||
* 11) &&
|
||||
* 12) ||
|
||||
*
|
||||
* (right-to-left):
|
||||
* 13) = += -= *= /= %= <<= >>= &= ^= |=
|
||||
*/
|
||||
Expression
|
||||
|
||||
/* Unary operators */
|
||||
|
||||
: PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
|
||||
| PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
|
||||
| SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
|
||||
{$$ = TrLinkChildren ($<n>3,1,$1);}
|
||||
| SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
|
||||
{$$ = TrLinkChildren ($<n>3,1,$1);}
|
||||
|
||||
/* Binary operators: math and logical */
|
||||
|
||||
| TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
|
||||
TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
|
||||
| TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
|
||||
| TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
|
||||
| TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
|
||||
| TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
|
||||
/* Parentheses */
|
||||
|
||||
| '(' TermArg ')' { $$ = $2;}
|
||||
;
|
||||
|
||||
EqualsTerm
|
||||
|
||||
/* All assignment-type operations */
|
||||
|
||||
: SuperName PARSEOP_EXP_EQUALS
|
||||
TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
|
||||
|
||||
| TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
;
|
||||
|
||||
|
||||
/* ACPI 3.0 -- allow semicolons between terms */
|
||||
|
||||
TermList
|
||||
@ -104,6 +247,7 @@ TermList
|
||||
|
||||
Term
|
||||
: Object {}
|
||||
| Expression {}
|
||||
| Type1Opcode {}
|
||||
| Type2Opcode {}
|
||||
| Type2IntegerOpcode {}
|
||||
@ -211,7 +355,8 @@ Removed from TermArg due to reduce/reduce conflicts
|
||||
*/
|
||||
|
||||
TermArg
|
||||
: Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
: Expression {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
@ -305,6 +450,7 @@ Type2Opcode
|
||||
| RefOfTerm {}
|
||||
| SizeOfTerm {}
|
||||
| StoreTerm {}
|
||||
| EqualsTerm {}
|
||||
| TimerTerm {}
|
||||
| WaitTerm {}
|
||||
| UserTerm {}
|
||||
@ -362,6 +508,8 @@ Type2BufferOpcode /* "Type5" Opcodes */
|
||||
|
||||
Type2BufferOrStringOpcode
|
||||
: ConcatTerm {}
|
||||
| PrintfTerm {}
|
||||
| FprintfTerm {}
|
||||
| MidTerm {}
|
||||
;
|
||||
|
||||
@ -387,6 +535,7 @@ Type4Opcode
|
||||
Type5Opcode
|
||||
: ResourceTemplateTerm {}
|
||||
| UnicodeTerm {}
|
||||
| ToPLDTerm {}
|
||||
| ToUUIDTerm {}
|
||||
;
|
||||
|
||||
@ -1370,6 +1519,86 @@ ToIntegerTerm
|
||||
error ')' {$$ = AslDoError(); yyclearin;}
|
||||
;
|
||||
|
||||
PldKeyword
|
||||
: PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);}
|
||||
| PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);}
|
||||
| PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);}
|
||||
| PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);}
|
||||
| PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);}
|
||||
| PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);}
|
||||
| PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);}
|
||||
| PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);}
|
||||
| PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);}
|
||||
| PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);}
|
||||
| PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);}
|
||||
| PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);}
|
||||
| PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);}
|
||||
| PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);}
|
||||
| PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);}
|
||||
| PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);}
|
||||
| PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);}
|
||||
| PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);}
|
||||
| PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);}
|
||||
| PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);}
|
||||
| PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);}
|
||||
| PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);}
|
||||
| PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);}
|
||||
| PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);}
|
||||
| PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);}
|
||||
| PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);}
|
||||
| PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);}
|
||||
| PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);}
|
||||
;
|
||||
|
||||
PldKeywordList
|
||||
: {$$ = NULL;}
|
||||
| PldKeyword
|
||||
PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);}
|
||||
| PldKeyword
|
||||
PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);}
|
||||
| PldKeywordList ',' /* Allows a trailing comma at list end */
|
||||
| PldKeywordList ','
|
||||
PldKeyword
|
||||
PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
|
||||
| PldKeywordList ','
|
||||
PldKeyword
|
||||
PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
|
||||
;
|
||||
|
||||
ToPLDTerm
|
||||
: PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);}
|
||||
PldKeywordList
|
||||
')' {$$ = TrLinkChildren ($<n>3,1,$4);}
|
||||
| PARSEOP_TOPLD '('
|
||||
error ')' {$$ = AslDoError(); yyclearin;}
|
||||
;
|
||||
|
||||
PrintfArgList
|
||||
: {$$ = NULL;}
|
||||
| TermArg {$$ = $1;}
|
||||
| PrintfArgList ','
|
||||
TermArg {$$ = TrLinkPeerNode ($1, $3);}
|
||||
;
|
||||
|
||||
PrintfTerm
|
||||
: PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);}
|
||||
StringData
|
||||
PrintfArgList
|
||||
')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
|
||||
| PARSEOP_PRINTF '('
|
||||
error ')' {$$ = AslDoError(); yyclearin;}
|
||||
;
|
||||
|
||||
FprintfTerm
|
||||
: PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);}
|
||||
TermArg ','
|
||||
StringData
|
||||
PrintfArgList
|
||||
')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
|
||||
| PARSEOP_FPRINTF '('
|
||||
error ')' {$$ = AslDoError(); yyclearin;}
|
||||
;
|
||||
|
||||
ToStringTerm
|
||||
: PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);}
|
||||
TermArg
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -88,6 +88,7 @@ AslInitializeGlobals (
|
||||
|
||||
/* Init compiler globals */
|
||||
|
||||
Gbl_SyntaxError = 0;
|
||||
Gbl_CurrentColumn = 0;
|
||||
Gbl_CurrentLineNumber = 1;
|
||||
Gbl_LogicalLineNumber = 1;
|
||||
|
@ -5,7 +5,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -6,7 +6,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -69,6 +69,14 @@ typedef struct asl_file_node
|
||||
ASL_FILE_NODE *Gbl_IncludeFileStack = NULL;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslParserCleanup
|
||||
*
|
||||
* Used to delete the current buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AslParserCleanup (
|
||||
void)
|
||||
@ -188,7 +196,8 @@ AslPopInputFileStack (
|
||||
|
||||
|
||||
Fnode = Gbl_IncludeFileStack;
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nPop InputFile Stack, Fnode %p\n\n", Fnode);
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nPop InputFile Stack, Fnode %p\n\n", Fnode);
|
||||
|
||||
if (!Fnode)
|
||||
{
|
||||
@ -248,11 +257,11 @@ AslPushInputFileStack (
|
||||
|
||||
Fnode = UtLocalCalloc (sizeof (ASL_FILE_NODE));
|
||||
|
||||
Fnode->File = yyin;
|
||||
Fnode->Next = Gbl_IncludeFileStack;
|
||||
Fnode->State = YY_CURRENT_BUFFER;
|
||||
Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
|
||||
Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
|
||||
Fnode->File = yyin;
|
||||
Fnode->Next = Gbl_IncludeFileStack;
|
||||
Fnode->State = YY_CURRENT_BUFFER;
|
||||
Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
|
||||
Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
|
||||
|
||||
/* Push it on the stack */
|
||||
|
||||
@ -263,7 +272,8 @@ AslPushInputFileStack (
|
||||
State = yy_create_buffer (InputFile, YY_BUF_SIZE);
|
||||
yy_switch_to_buffer (State);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nPush InputFile Stack, returning %p\n\n", InputFile);
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nPush InputFile Stack, returning %p\n\n", InputFile);
|
||||
|
||||
/* Reset the global line count and filename */
|
||||
|
||||
@ -313,7 +323,7 @@ AslResetCurrentLineBuffer (
|
||||
*
|
||||
* FUNCTION: AslInsertLineBuffer
|
||||
*
|
||||
* PARAMETERS: SourceChar - One char from the input ASL source file
|
||||
* PARAMETERS: SourceChar - One char from the input ASL source file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -354,7 +364,8 @@ AslInsertLineBuffer (
|
||||
*Gbl_LineBufPtr = (UINT8) SourceChar;
|
||||
Gbl_LineBufPtr++;
|
||||
|
||||
if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
|
||||
if (Gbl_LineBufPtr >
|
||||
(Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
|
||||
{
|
||||
#if 0
|
||||
/*
|
||||
@ -363,9 +374,9 @@ AslInsertLineBuffer (
|
||||
*/
|
||||
sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize);
|
||||
AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
|
||||
#endif
|
||||
|
||||
AslResetCurrentLineBuffer ();
|
||||
@ -384,12 +395,12 @@ AslInsertLineBuffer (
|
||||
*
|
||||
* FUNCTION: count
|
||||
*
|
||||
* PARAMETERS: yytext - Contains the matched keyword.
|
||||
* Type - Keyword/Character type:
|
||||
* 0 = anything except a keyword
|
||||
* 1 = pseudo-keywords
|
||||
* 2 = non-executable ASL keywords
|
||||
* 3 = executable ASL keywords
|
||||
* PARAMETERS: yytext - Contains the matched keyword.
|
||||
* Type - Keyword/Character type:
|
||||
* 0 = anything except a keyword
|
||||
* 1 = pseudo-keywords
|
||||
* 2 = non-executable ASL keywords
|
||||
* 3 = executable ASL keywords
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -458,7 +469,7 @@ loop:
|
||||
|
||||
/* Eat chars until end-of-comment */
|
||||
|
||||
while ((c = input()) != '*' && c != EOF)
|
||||
while (((c = input ()) != '*') && (c != EOF))
|
||||
{
|
||||
AslInsertLineBuffer (c);
|
||||
c1 = c;
|
||||
@ -476,16 +487,16 @@ loop:
|
||||
if ((c1 == '/') && (c == '*'))
|
||||
{
|
||||
AslCommonError (ASL_WARNING, ASL_MSG_NESTED_COMMENT,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_InputByteCount, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_InputByteCount, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
}
|
||||
|
||||
/* Comment is closed only if the NEXT character is a slash */
|
||||
|
||||
AslInsertLineBuffer (c);
|
||||
|
||||
if ((c1 = input()) != '/' && c1 != EOF)
|
||||
if (((c1 = input ()) != '/') && (c1 != EOF))
|
||||
{
|
||||
unput(c1);
|
||||
goto loop;
|
||||
@ -505,9 +516,9 @@ EarlyEOF:
|
||||
* Premature End-Of-File
|
||||
*/
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
@ -534,7 +545,7 @@ AslDoCommentType2 (
|
||||
AslInsertLineBuffer ('/');
|
||||
AslInsertLineBuffer ('/');
|
||||
|
||||
while ((c = input()) != '\n' && c != EOF)
|
||||
while (((c = input ()) != '\n') && (c != EOF))
|
||||
{
|
||||
AslInsertLineBuffer (c);
|
||||
}
|
||||
@ -682,9 +693,9 @@ DoCharacter:
|
||||
/* Unknown escape sequence issue warning, but use the character */
|
||||
|
||||
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_ESCAPE,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -709,9 +720,9 @@ DoCharacter:
|
||||
if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
|
||||
{
|
||||
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -753,9 +764,9 @@ DoCharacter:
|
||||
if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
|
||||
{
|
||||
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -797,9 +808,9 @@ DoCharacter:
|
||||
* Premature End-Of-File
|
||||
*/
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
return (FALSE);
|
||||
|
||||
|
||||
@ -813,9 +824,9 @@ CompletedString:
|
||||
if (!CleanString)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
@ -829,8 +840,8 @@ BufferOverflow:
|
||||
/* Literal was too long */
|
||||
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
|
||||
return (FALSE);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ NoEcho('
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user