Index: head/contrib/amd/amd/get_args.c =================================================================== --- head/contrib/amd/amd/get_args.c (revision 195625) +++ head/contrib/amd/amd/get_args.c (revision 195626) @@ -1,437 +1,437 @@ /* * Copyright (c) 1997-2006 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Jan-Simon Pendry at Imperial College, London. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgment: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * File: am-utils/amd/get_args.c * */ /* * Argument decode */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include /* include auto-generated version file */ #include char *amu_conf_file = "/etc/amd.conf"; /* default amd configuration file */ char *conf_tag = NULL; /* default conf file tags to use */ int usage = 0; int use_conf_file = 0; /* default don't use amd.conf file */ char *mnttab_file_name = NULL; /* symbol must be available always */ /* * Return the version string (dynamic buffer) */ char * get_version_string(void) { char *vers = NULL; char tmpbuf[1024]; char *wire_buf; int wire_buf_len = 0; size_t len; /* max allocated length (to avoid buf overflow) */ /* * First get dynamic string listing all known networks. * This could be a long list, if host has lots of interfaces. */ wire_buf = print_wires(); if (wire_buf) wire_buf_len = strlen(wire_buf); len = 2048 + wire_buf_len; vers = xmalloc(len); xsnprintf(vers, len, "%s\n%s\n%s\n%s\n", "Copyright (c) 1997-2006 Erez Zadok", "Copyright (c) 1990 Jan-Simon Pendry", "Copyright (c) 1990 Imperial College of Science, Technology & Medicine", "Copyright (c) 1990 The Regents of the University of California."); xsnprintf(tmpbuf, sizeof(tmpbuf), "%s version %s (build %d).\n", PACKAGE_NAME, PACKAGE_VERSION, AMU_BUILD_VERSION); strlcat(vers, tmpbuf, len); xsnprintf(tmpbuf, sizeof(tmpbuf), "Report bugs to %s.\n", PACKAGE_BUGREPORT); strlcat(vers, tmpbuf, len); xsnprintf(tmpbuf, sizeof(tmpbuf), "Configured by %s@%s on date %s.\n", USER_NAME, HOST_NAME, CONFIG_DATE); strlcat(vers, tmpbuf, len); - xsnprintf(tmpbuf, sizeof(tmpbuf), "Built by %s@%s on date %s.\n", - BUILD_USER, BUILD_HOST, BUILD_DATE); + xsnprintf(tmpbuf, sizeof(tmpbuf), "Built by %s@%s.\n", + BUILD_USER, BUILD_HOST); strlcat(vers, tmpbuf, len); xsnprintf(tmpbuf, sizeof(tmpbuf), "cpu=%s (%s-endian), arch=%s, karch=%s.\n", cpu, endian, gopt.arch, gopt.karch); strlcat(vers, tmpbuf, len); xsnprintf(tmpbuf, sizeof(tmpbuf), "full_os=%s, os=%s, osver=%s, vendor=%s, distro=%s.\n", gopt.op_sys_full, gopt.op_sys, gopt.op_sys_ver, gopt.op_sys_vendor, DISTRO_NAME); strlcat(vers, tmpbuf, len); xsnprintf(tmpbuf, sizeof(tmpbuf), "domain=%s, host=%s, hostd=%s.\n", hostdomain, am_get_hostname(), hostd); strlcat(vers, tmpbuf, len); strlcat(vers, "Map support for: ", len); mapc_showtypes(tmpbuf, sizeof(tmpbuf)); strlcat(vers, tmpbuf, len); strlcat(vers, ".\nAMFS: ", len); ops_showamfstypes(tmpbuf, sizeof(tmpbuf)); strlcat(vers, tmpbuf, len); strlcat(vers, ", inherit.\nFS: ", len); /* hack: "show" that we support type:=inherit */ ops_showfstypes(tmpbuf, sizeof(tmpbuf)); strlcat(vers, tmpbuf, len); /* append list of networks if available */ if (wire_buf) { strlcat(vers, wire_buf, len); XFREE(wire_buf); } return vers; } static void show_usage(void) { fprintf(stderr, "Usage: %s [-nprvHS] [-a mount_point] [-c cache_time] [-d domain]\n\ \t[-k kernel_arch] [-l logfile%s\n\ \t[-t timeout.retrans] [-w wait_timeout] [-A arch] [-C cluster_name]\n\ \t[-o op_sys_ver] [-O op_sys_name]\n\ \t[-F conf_file] [-T conf_tag]", am_get_progname(), #ifdef HAVE_SYSLOG # ifdef LOG_DAEMON "|\"syslog[:facility]\"]" # else /* not LOG_DAEMON */ "|\"syslog\"]" # endif /* not LOG_DAEMON */ #else /* not HAVE_SYSLOG */ "]" #endif /* not HAVE_SYSLOG */ ); #ifdef HAVE_MAP_NIS fputs(" [-y nis-domain]\n", stderr); #else /* not HAVE_MAP_NIS */ fputc('\n', stderr); #endif /* HAVE_MAP_NIS */ show_opts('x', xlog_opt); #ifdef DEBUG show_opts('D', dbg_opt); #endif /* DEBUG */ fprintf(stderr, "\t[directory mapname [-map_options]] ...\n"); } void get_args(int argc, char *argv[]) { int opt_ch, i; FILE *fp = stdin; char getopt_arguments[] = "+nprvSa:c:d:k:l:o:t:w:x:y:C:D:F:T:O:HA:"; char *getopt_args; int print_version = 0; /* 1 means we should print version info */ #ifdef HAVE_GNU_GETOPT getopt_args = getopt_arguments; #else /* ! HAVE_GNU_GETOPT */ getopt_args = &getopt_arguments[1]; #endif /* HAVE_GNU_GETOPT */ /* if no arguments were passed, try to use /etc/amd.conf file */ if (argc <= 1) use_conf_file = 1; while ((opt_ch = getopt(argc, argv, getopt_args)) != -1) switch (opt_ch) { case 'a': if (*optarg != '/') { fprintf(stderr, "%s: -a option must begin with a '/'\n", am_get_progname()); exit(1); } gopt.auto_dir = optarg; break; case 'c': gopt.am_timeo = atoi(optarg); if (gopt.am_timeo <= 0) gopt.am_timeo = AM_TTL; break; case 'd': gopt.sub_domain = optarg; break; case 'k': gopt.karch = optarg; break; case 'l': gopt.logfile = optarg; break; case 'n': gopt.flags |= CFM_NORMALIZE_HOSTNAMES; break; case 'o': gopt.op_sys_ver = optarg; break; case 'p': gopt.flags |= CFM_PRINT_PID; break; case 'r': gopt.flags |= CFM_RESTART_EXISTING_MOUNTS; break; case 't': /* timeo.retrans (also affects toplvl mounts) */ { char *dot = strchr(optarg, '.'); int i; if (dot) *dot = '\0'; if (*optarg) { for (i=0; i .version fi RUN="`cat .version`" RUN="`expr $RUN + 1`" echo $RUN > .version ConfStr="$ConfStr (${RUN})" echo "Version <${ConfStr}>"; rm -f version.c cat > version.c << -EoF- /* * version file for $PROG */ #include const char * Version = "${ConfStr}"; -EoF- Index: head/contrib/sendmail/cf/sh/makeinfo.sh =================================================================== --- head/contrib/sendmail/cf/sh/makeinfo.sh (revision 195625) +++ head/contrib/sendmail/cf/sh/makeinfo.sh (revision 195626) @@ -1,60 +1,60 @@ #!/bin/sh # # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 # The Regents of the University of California. All rights reserved. # # By using this file, you agree to the terms and conditions set # forth in the LICENSE file which can be found at the top level of # the sendmail distribution. # # # $Id: makeinfo.sh,v 8.14 1999/02/07 07:26:25 gshapiro Exp $ # # $FreeBSD$ # usewhoami=0 usehostname=0 for p in `echo $PATH | sed 's/:/ /g'` do if [ "x$p" = "x" ] then p="." fi if [ -f $p/whoami ] then usewhoami=1 if [ $usehostname -ne 0 ] then break; fi fi if [ -f $p/hostname ] then usehostname=1 if [ $usewhoami -ne 0 ] then break; fi fi done if [ $usewhoami -ne 0 ] then user=`whoami` else user=$LOGNAME fi if [ $usehostname -ne 0 ] then host=`hostname` else host=`uname -n` fi -echo '#####' built by $user@$host on `LC_ALL=C LC_TIME=C date` +echo '#####' built by $user@$host echo '#####' in `pwd` | sed 's/\/tmp_mnt//' echo '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//' echo "define(\`__HOST__', $host)dnl" Index: head/secure/lib/libcrypto/Makefile =================================================================== --- head/secure/lib/libcrypto/Makefile (revision 195625) +++ head/secure/lib/libcrypto/Makefile (revision 195626) @@ -1,455 +1,454 @@ # $FreeBSD$ SHLIBDIR?= /lib SUBDIR= engines .include LIB= crypto SHLIB_MAJOR= 5 NO_LINT= .if exists(Makefile.man) .include "Makefile.man" .endif .if defined(NOTYET) MAN+= config.5 des_modes.7 .endif .include "Makefile.inc" # base sources SRCS= cpt_err.c cryptlib.c cversion.c ebcdic.c ex_data.c mem.c mem_clr.c \ mem_dbg.c o_dir.c o_str.c o_time.c tmdiff.c uid.c dyn_lck.c \ o_init.c fips_err.c INCS= crypto.h ebcdic.h opensslv.h ossl_typ.h symhacks.h tmdiff.h \ ../e_os.h ../e_os2.h # aes SRCS+= aes_cbc.c aes_cfb.c aes_core.c aes_ctr.c aes_ecb.c aes_ige.c \ aes_misc.c aes_ofb.c aes_wrap.c INCS+= aes.h aes_locl.h # asn1 SRCS+= a_bitstr.c a_bool.c a_bytes.c a_d2i_fp.c a_digest.c a_dup.c \ a_enum.c a_gentm.c a_hdr.c a_i2d_fp.c a_int.c a_mbstr.c \ a_meth.c a_object.c a_octet.c a_print.c a_set.c a_sign.c \ a_strex.c a_strnid.c a_time.c a_type.c a_utctm.c a_utf8.c \ a_verify.c asn1_err.c asn1_gen.c asn1_lib.c asn1_par.c \ asn_moid.c asn_mime.c asn_pack.c d2i_pr.c d2i_pu.c evp_asn1.c f_enum.c \ f_int.c f_string.c i2d_pr.c i2d_pu.c n_pkey.c nsseq.c p5_pbe.c \ p5_pbev2.c p8_pkey.c t_bitst.c t_crl.c t_pkey.c t_req.c \ t_spki.c t_x509.c t_x509a.c tasn_dec.c tasn_enc.c tasn_fre.c \ tasn_new.c tasn_typ.c tasn_utl.c x_algor.c x_attrib.c \ x_bignum.c x_crl.c x_exten.c x_info.c x_long.c x_name.c \ x_pkey.c x_pubkey.c x_req.c x_sig.c x_spki.c x_val.c x_x509.c \ x_x509a.c INCS+= asn1.h asn1_mac.h asn1t.h # bf SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c .if ${MACHINE_ARCH} == "i386" .if ${MACHINE_CPU:Mi686} SRCS+= bf-686.s .else SRCS+= bf-586.s .endif .else SRCS+= bf_enc.c .endif INCS+= blowfish.h # bio SRCS+= b_dump.c b_print.c b_sock.c bf_buff.c bf_lbuf.c bf_nbio.c \ bf_null.c bio_cb.c bio_err.c bio_lib.c bss_acpt.c bss_bio.c \ bss_conn.c bss_dgram.c bss_fd.c bss_file.c bss_log.c bss_mem.c \ bss_null.c bss_sock.c INCS+= bio.h bio_lcl.h # bn SRCS+= bn_add.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c bn_div.c \ bn_err.c bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c \ bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_opt.c \ bn_prime.c bn_print.c bn_rand.c bn_recp.c bn_shift.c bn_sqr.c \ bn_sqrt.c bn_word.c bn_x931p.c .if ${MACHINE_ARCH} == "i386" SRCS+= bn-586.s co-586.s .elif ${MACHINE_ARCH} == "amd64" SRCS+= x86_64-gcc.c .else SRCS+= bn_asm.c .endif INCS+= bn.h # buffer SRCS+= buf_err.c buf_str.c buffer.c INCS+= buffer.h # cast SRCS+= c_cfb64.c c_ecb.c c_ofb64.c c_skey.c .if ${MACHINE_ARCH} == "i386" SRCS+= cast-586.s .else SRCS+= c_enc.c .endif INCS+= cast.h # camellia .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" SRCS+= camellia.c cmll_cbc.c cmll_cfb.c cmll_ctr.c cmll_ecb.c \ cmll_misc.c cmll_ofb.c INCS+= camellia.h .endif # comp SRCS+= c_rle.c c_zlib.c comp_err.c comp_lib.c INCS+= comp.h # conf SRCS+= conf_api.c conf_def.c conf_err.c conf_lib.c conf_mall.c conf_mod.c conf_sap.c INCS+= conf.h conf_api.h # des SRCS+= cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \ des_lib.c des_old.c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c \ enc_read.c enc_writ.c fcrypt.c ofb64ede.c ofb64enc.c \ ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \ rpc_enc.c set_key.c str2key.c xcbc_enc.c .if ${MACHINE_ARCH} == "i386" SRCS+= des-586.s crypt586.s .else SRCS+= des_enc.c fcrypt_b.c .endif INCS+= des.h des_old.h # dh SRCS+= dh_asn1.c dh_check.c dh_err.c dh_depr.c dh_gen.c dh_key.c dh_lib.c INCS+= dh.h # dsa SRCS+= dsa_asn1.c dsa_err.c dsa_depr.c dsa_gen.c dsa_key.c dsa_lib.c \ dsa_ossl.c dsa_sign.c dsa_vrf.c dsa_utl.c INCS+= dsa.h # dso SRCS+= dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c dso_openssl.c INCS+= dso.h # ec SRCS+= ec_asn1.c ec_check.c ec_curve.c ec_cvt.c ec_err.c ec_key.c \ ec_lib.c ec_mult.c ec_print.c ecp_mont.c ecp_nist.c \ ecp_smpl.c ec2_mult.c ec2_smpl.c INCS+= ec.h # ecdh SRCS+= ech_err.c ech_key.c ech_lib.c ech_ossl.c INCS+= ecdh.h # ecdsa SRCS+= ecs_asn1.c ecs_err.c ecs_lib.c ecs_ossl.c ecs_sign.c ecs_vrf.c INCS+= ecdsa.h # engine SRCS+= eng_all.c eng_cnf.c eng_cryptodev.c eng_ctrl.c eng_dyn.c \ eng_err.c eng_fat.c eng_init.c eng_lib.c eng_list.c \ eng_openssl.c eng_padlock.c eng_pkey.c eng_table.c tb_cipher.c \ tb_dh.c tb_digest.c tb_dsa.c tb_ecdh.c tb_ecdsa.c tb_rand.c \ tb_rsa.c tb_store.c INCS+= engine.h # err SRCS+= err.c err_all.c err_prn.c err_def.c err_str.c err_bio.c INCS+= err.h # evp SRCS+= bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \ dig_eng.c digest.c e_aes.c e_bf.c e_cast.c e_des.c e_des3.c e_idea.c \ e_null.c e_old.c e_rc2.c e_rc4.c e_rc5.c e_xcbc_d.c encode.c \ evp_acnf.c evp_cnf.c evp_enc.c evp_err.c evp_key.c evp_lib.c evp_pbe.c \ evp_pkey.c e_seed.c enc_min.c m_dss.c m_dss1.c m_ecdsa.c m_md2.c m_md4.c m_md5.c \ m_mdc2.c m_null.c m_ripemd.c m_sha.c m_sha1.c names.c \ openbsd_hw.c p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c \ p_open.c p_seal.c p_sign.c p_verify.c .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" SRCS+= e_camellia.c .endif INCS+= evp.h # fips INCS+= fips.h fips_rand.h # hmac SRCS+= hmac.c INCS+= hmac.h # idea .if ${MK_IDEA} != "no" SRCS+= i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c INCS+= idea.h .endif # krb5 #SRCS+= krb5_asn.c INCS+= krb5_asn.h # lhash SRCS+= lh_stats.c lhash.c INCS+= lhash.h # md2 SRCS+= md2_dgst.c md2_one.c INCS+= md2.h # md4 SRCS+= md4_dgst.c md4_one.c INCS+= md4.h # md5 SRCS+= md5_dgst.c md5_one.c .if ${MACHINE_ARCH} == "i386" SRCS+= md5-586.s .endif INCS+= md5.h # mdc2 SRCS+= mdc2_one.c mdc2dgst.c INCS+= mdc2.h # objects SRCS+= o_names.c obj_dat.c obj_err.c obj_lib.c INCS+= objects.h obj_mac.h # ocsp SRCS+= ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_ht.c \ ocsp_lib.c ocsp_prn.c ocsp_srv.c ocsp_vfy.c INCS+= ocsp.h # pem SRCS+= pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c \ pem_pkey.c pem_seal.c pem_sign.c pem_x509.c pem_xaux.c INCS+= pem.h pem2.h # pkcs12 SRCS+= p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c \ p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c \ p12_npas.c p12_p8d.c p12_p8e.c p12_utl.c pk12err.c INCS+= pkcs12.h pkcs7.h # pkcs7 SRCS+= example.c pk7_asn1.c pk7_attr.c pk7_dgst.c pk7_doit.c \ pk7_lib.c pk7_mime.c pk7_smime.c pkcs7err.c # pqueue SRCS+= pqueue.c INCS+= pqueue.h pq_compat.h # rand SRCS+= md_rand.c rand_egd.c rand_err.c rand_lib.c rand_unix.c randfile.c rand_eng.c INCS+= rand.h # rc2 SRCS+= rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c INCS+= rc2.h # rc4 SRCS+= rc4_skey.c rc4_fblk.c .if ${MACHINE_ARCH} == "i386" SRCS+= rc4-586.s .else SRCS+= rc4_enc.c .endif INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c .if ${MACHINE_ARCH} == "i386" SRCS+= rc5-586.s .else SRCS+= rc5_enc.c .endif INCS+= rc5.h # ripemd SRCS+= rmd_dgst.c rmd_one.c INCS+= ripemd.h # rsa SRCS+= rsa_asn1.c rsa_chk.c rsa_eay.c rsa_err.c rsa_gen.c rsa_lib.c \ rsa_none.c rsa_null.c rsa_oaep.c rsa_pk1.c rsa_saos.c \ rsa_sign.c rsa_ssl.c rsa_depr.c rsa_pss.c rsa_x931.c rsa_x931g.c \ rsa_eng.c INCS+= rsa.h # sha SRCS+= sha1_one.c sha1dgst.c sha_dgst.c sha_one.c sha256.c sha512.c .if ${MACHINE_ARCH} == "i386" SRCS+= sha1-586.s .endif INCS+= sha.h # stack SRCS+= stack.c INCS+= stack.h safestack.h # store SRCS+= str_err.c str_lib.c str_meth.c str_mem.c INCS+= store.h # threads SRCS+= th-lock.c # txt_db SRCS+= txt_db.c INCS+= txt_db.h # ui SRCS+= ui_compat.c ui_err.c ui_lib.c ui_openssl.c ui_util.c INCS+= ui.h ui_compat.h ui_locl.h # x509 SRCS+= by_dir.c by_file.c x509_att.c x509_cmp.c x509_d2.c \ x509_def.c x509_err.c x509_ext.c x509_lu.c x509_obj.c \ x509_r2x.c x509_req.c x509_set.c x509_trs.c x509_txt.c \ x509_v3.c x509_vfy.c x509cset.c x509name.c x509rset.c \ x509spki.c x509type.c x_all.c x509_vpm.c INCS+= x509.h x509_vfy.h # x509v3 SRCS+= pcy_cache.c pcy_data.c pcy_lib.c pcy_map.c pcy_node.c \ pcy_tree.c v3_addr.c v3_akey.c v3_akeya.c v3_alt.c v3_asid.c \ v3_bcons.c v3_bitst.c \ v3_conf.c v3_cpols.c v3_crld.c v3_enum.c v3_extku.c v3_genn.c \ v3_ia5.c v3_info.c v3_int.c v3_lib.c v3_ncons.c v3_ocsp.c \ v3_pci.c v3_pcia.c v3_pcons.c v3_pku.c v3_pmaps.c v3_prn.c \ v3_purp.c v3_skey.c v3_sxnet.c v3_utl.c v3err.c INCS+= x509v3.h # cms #SRCS+= cms_lib.c cms_asn1.c cms_att.c cms_io.c cms_smime.c cms_err.c \ # cms_sd.c cms_dd.c cms_cd.c cms_env.c cms_enc.c cms_ess.c #INCS+= cms.h # jpake - is marked experimental #SRCS+= jpake.c jpake_err.c #INCS+= jpake.h # seed #SRCS+= seed.c seed_ecb.c seed_cbc.c seed_cfb.c seed_ofb.c #INCS+= seed.h SRCS+= buildinf.h INCS+= opensslconf.h evp.h INCSDIR= ${INCLUDEDIR}/openssl CSTD= gnu89 CLEANFILES= buildinf.h opensslconf.h evp.h buildinf.h: ${.CURDIR}/Makefile ( echo "#ifndef MK1MF_BUILD"; \ echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \ echo " #define CFLAGS \"$(CC)\""; \ echo " #define PLATFORM \"FreeBSD-${MACHINE_ARCH}\""; \ - echo " #define DATE \"`LC_ALL=C date`\""; \ echo "#endif" ) > ${.TARGET} opensslconf.h: opensslconf-${MACHINE_ARCH}.h cp ${.ALLSRC} ${.TARGET} evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h .if ${MK_IDEA} == "no" sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC} > ${.TARGET} .else cp ${.ALLSRC} ${.TARGET} .endif # No FIPS support for now fips.h: echo '/* dummy fips.h */' > ${.TARGET} fips_rand.h: echo '/* dummy fips_rand.h */' > ${.TARGET} CLEANFILES+= fips.h fips_rand.h OLDSYMLINKS+= libdes.a libdes.so libdes.so.3 libdes_p.a afterinstall: @${ECHO} "Removing stale symlinks." rm -f ${DESTDIR}${INCLUDEDIR}/des.h .for symlink in ${OLDSYMLINKS} rm -f ${DESTDIR}${LIBDIR}/${symlink} .endfor .include .if ${MACHINE_ARCH} == "i386" .PATH: ${.CURDIR}/i386 .endif .if ${MACHINE_ARCH} == "amd64" _bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm .endif .if ${MK_IDEA} != "no" _ideapath= ${LCRYPTO_SRC}/crypto/idea .endif .PATH: \ ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes \ ${LCRYPTO_SRC}/crypto/asn1 \ ${LCRYPTO_SRC}/crypto/bf \ ${LCRYPTO_SRC}/crypto/bio \ ${_bn_asmpath} \ ${LCRYPTO_SRC}/crypto/bn \ ${LCRYPTO_SRC}/crypto/buffer \ ${LCRYPTO_SRC}/crypto/cast \ ${LCRYPTO_SRC}/crypto/camellia \ ${LCRYPTO_SRC}/crypto/cms \ ${LCRYPTO_SRC}/crypto/comp \ ${LCRYPTO_SRC}/crypto/conf \ ${LCRYPTO_SRC}/crypto/des \ ${LCRYPTO_SRC}/crypto/dh \ ${LCRYPTO_SRC}/crypto/dsa \ ${LCRYPTO_SRC}/crypto/dso \ ${LCRYPTO_SRC}/crypto/ec \ ${LCRYPTO_SRC}/crypto/ecdh \ ${LCRYPTO_SRC}/crypto/ecdsa \ ${LCRYPTO_SRC}/crypto/engine \ ${LCRYPTO_SRC}/crypto/err \ ${LCRYPTO_SRC}/crypto/evp \ ${LCRYPTO_SRC}/crypto/hmac \ ${_ideapath} \ ${LCRYPTO_SRC}/crypto/jpake \ ${LCRYPTO_SRC}/crypto/krb5 \ ${LCRYPTO_SRC}/crypto/lhash \ ${LCRYPTO_SRC}/crypto/md2 \ ${LCRYPTO_SRC}/crypto/md4 \ ${LCRYPTO_SRC}/crypto/md5 \ ${LCRYPTO_SRC}/crypto/mdc2 \ ${LCRYPTO_SRC}/crypto/objects \ ${LCRYPTO_SRC}/crypto/ocsp \ ${LCRYPTO_SRC}/crypto/pem \ ${LCRYPTO_SRC}/crypto/pkcs12 \ ${LCRYPTO_SRC}/crypto/pkcs7 \ ${LCRYPTO_SRC}/crypto/pqueue \ ${LCRYPTO_SRC}/crypto/rand \ ${LCRYPTO_SRC}/crypto/rc2 \ ${LCRYPTO_SRC}/crypto/rc4 \ ${LCRYPTO_SRC}/crypto/rc5 \ ${LCRYPTO_SRC}/crypto/ripemd \ ${LCRYPTO_SRC}/crypto/rsa \ ${LCRYPTO_SRC}/crypto/seed \ ${LCRYPTO_SRC}/crypto/sha \ ${LCRYPTO_SRC}/crypto/stack \ ${LCRYPTO_SRC}/crypto/store \ ${LCRYPTO_SRC}/crypto/threads \ ${LCRYPTO_SRC}/crypto/txt_db \ ${LCRYPTO_SRC}/crypto/ui \ ${LCRYPTO_SRC}/crypto/x509 \ ${LCRYPTO_SRC}/crypto/x509v3 \ ${LCRYPTO_SRC}/engines \ ${LCRYPTO_SRC} \ ${.CURDIR}/man Index: head/sys/contrib/dev/acpica/compiler/aslcompile.c =================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c (revision 195625) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c (revision 195626) @@ -1,928 +1,928 @@ /****************************************************************************** * * Module Name: aslcompile - top level compile module * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * *****************************************************************************/ #include #include #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcompile") /* Local prototypes */ static void CmFlushSourceCode ( void); static ACPI_STATUS FlCheckForAscii ( ASL_FILE_INFO *FileInfo); void FlConsumeAnsiComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status); void FlConsumeNewComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status); /******************************************************************************* * * FUNCTION: AslCompilerSignon * * PARAMETERS: FileId - ID of the output file * * RETURN: None * * DESCRIPTION: Display compiler signon * ******************************************************************************/ void AslCompilerSignon ( UINT32 FileId) { char *Prefix = ""; /* Set line prefix depending on the destination file type */ switch (FileId) { case ASL_FILE_ASM_SOURCE_OUTPUT: case ASL_FILE_ASM_INCLUDE_OUTPUT: Prefix = "; "; break; case ASL_FILE_HEX_OUTPUT: if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM) { Prefix = "; "; } else if (Gbl_HexOutputFlag == HEX_OUTPUT_C) { FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n"); Prefix = " * "; } break; case ASL_FILE_C_SOURCE_OUTPUT: case ASL_FILE_C_INCLUDE_OUTPUT: Prefix = " * "; break; default: /* No other output types supported */ break; } /* * Compiler signon with copyright */ FlPrintFile (FileId, "%s\n%s%s\n%s", Prefix, Prefix, IntelAcpiCA, Prefix); /* Running compiler or disassembler? */ if (Gbl_DisasmFlag) { FlPrintFile (FileId, "%s", DisassemblerId); } else { FlPrintFile (FileId, "%s", CompilerId); } - /* Version, build date, copyright, compliance */ + /* Version, copyright, compliance */ FlPrintFile (FileId, - " version %X [%s]\n%s%s\n%s%s\n%s\n", - (UINT32) ACPI_CA_VERSION, __DATE__, + " version %X\n%s%s\n%s%s\n%s\n", + (UINT32) ACPI_CA_VERSION, Prefix, CompilerCopyright, Prefix, CompilerCompliance, Prefix); } /******************************************************************************* * * FUNCTION: AslCompilerFileHeader * * PARAMETERS: FileId - ID of the output file * * RETURN: None * * DESCRIPTION: Header used at the beginning of output files * ******************************************************************************/ void AslCompilerFileHeader ( UINT32 FileId) { struct tm *NewTime; time_t Aclock; char *Prefix = ""; /* Set line prefix depending on the destination file type */ switch (FileId) { case ASL_FILE_ASM_SOURCE_OUTPUT: case ASL_FILE_ASM_INCLUDE_OUTPUT: Prefix = "; "; break; case ASL_FILE_HEX_OUTPUT: if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM) { Prefix = "; "; } else if (Gbl_HexOutputFlag == HEX_OUTPUT_C) { Prefix = " * "; } break; case ASL_FILE_C_SOURCE_OUTPUT: case ASL_FILE_C_INCLUDE_OUTPUT: Prefix = " * "; break; default: /* No other output types supported */ break; } /* Compilation header with timestamp */ (void) time (&Aclock); NewTime = localtime (&Aclock); FlPrintFile (FileId, "%sCompilation of \"%s\" - %s%s\n", Prefix, Gbl_Files[ASL_FILE_INPUT].Filename, asctime (NewTime), Prefix); switch (FileId) { case ASL_FILE_C_SOURCE_OUTPUT: case ASL_FILE_C_INCLUDE_OUTPUT: FlPrintFile (FileId, " */\n"); break; default: /* Nothing to do for other output types */ break; } } /******************************************************************************* * * FUNCTION: CmFlushSourceCode * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Read in any remaining source code after the parse tree * has been constructed. * ******************************************************************************/ static void CmFlushSourceCode ( void) { char Buffer; while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR) { InsertLineBuffer ((int) Buffer); } ResetCurrentLineBuffer (); } /******************************************************************************* * * FUNCTION: FlConsume* * * PARAMETERS: FileInfo - Points to an open input file * * RETURN: Number of lines consumed * * DESCRIPTION: Step over both types of comment during check for ascii chars * ******************************************************************************/ void FlConsumeAnsiComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status) { UINT8 Byte; BOOLEAN ClosingComment = FALSE; while (fread (&Byte, 1, 1, FileInfo->Handle)) { /* Scan until comment close is found */ if (ClosingComment) { if (Byte == '/') { return; } if (Byte != '*') { /* Reset */ ClosingComment = FALSE; } } else if (Byte == '*') { ClosingComment = TRUE; } /* Maintain line count */ if (Byte == 0x0A) { Status->Line++; } Status->Offset++; } } void FlConsumeNewComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status) { UINT8 Byte; while (fread (&Byte, 1, 1, FileInfo->Handle)) { Status->Offset++; /* Comment ends at newline */ if (Byte == 0x0A) { Status->Line++; return; } } } /******************************************************************************* * * FUNCTION: FlCheckForAscii * * PARAMETERS: FileInfo - Points to an open input file * * RETURN: Status * * DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters * within comments. Note: does not handle nested comments and does * not handle comment delimiters within string literals. However, * on the rare chance this happens and an invalid character is * missed, the parser will catch the error by failing in some * spectactular manner. * ******************************************************************************/ static ACPI_STATUS FlCheckForAscii ( ASL_FILE_INFO *FileInfo) { UINT8 Byte; ACPI_SIZE BadBytes = 0; BOOLEAN OpeningComment = FALSE; ASL_FILE_STATUS Status; Status.Line = 1; Status.Offset = 0; /* Read the entire file */ while (fread (&Byte, 1, 1, FileInfo->Handle)) { /* Ignore comment fields (allow non-ascii within) */ if (OpeningComment) { /* Check for second comment open delimiter */ if (Byte == '*') { FlConsumeAnsiComment (FileInfo, &Status); } if (Byte == '/') { FlConsumeNewComment (FileInfo, &Status); } /* Reset */ OpeningComment = FALSE; } else if (Byte == '/') { OpeningComment = TRUE; } /* Check for an ASCII character */ if (!ACPI_IS_ASCII (Byte)) { if (BadBytes < 10) { AcpiOsPrintf ( "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n", Byte, Status.Line, Status.Offset); } BadBytes++; } /* Update line counter */ else if (Byte == 0x0A) { Status.Line++; } Status.Offset++; } /* Seek back to the beginning of the source file */ fseek (FileInfo->Handle, 0, SEEK_SET); /* Were there any non-ASCII characters in the file? */ if (BadBytes) { AcpiOsPrintf ( "%u non-ASCII characters found in input source text, could be a binary file\n", BadBytes); AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, FileInfo->Filename); return (AE_BAD_CHARACTER); } /* File is OK */ return (AE_OK); } /******************************************************************************* * * FUNCTION: CmDoCompile * * PARAMETERS: None * * RETURN: Status (0 = OK) * * DESCRIPTION: This procedure performs the entire compile * ******************************************************************************/ int CmDoCompile ( void) { ACPI_STATUS Status; UINT8 FullCompile; UINT8 Event; FullCompile = UtBeginEvent ("*** Total Compile time ***"); Event = UtBeginEvent ("Open input and output files"); /* Open the required input and output files */ Status = FlOpenInputFile (Gbl_Files[ASL_FILE_INPUT].Filename); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return -1; } /* Check for 100% ASCII source file (comments are ignored) */ Status = FlCheckForAscii (&Gbl_Files[ASL_FILE_INPUT]); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return -1; } Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return -1; } UtEndEvent (Event); /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); AslCompilerparse(); UtEndEvent (Event); /* Flush out any remaining source after parse tree is complete */ Event = UtBeginEvent ("Flush source input"); CmFlushSourceCode (); /* Did the parse tree get successfully constructed? */ if (!RootNode) { CmCleanupAndExit (); return -1; } /* Optional parse tree dump, compiler debug output only */ LsDumpParseTree (); OpcGetIntegerWidth (RootNode); UtEndEvent (Event); /* Pre-process parse tree for any operator transforms */ Event = UtBeginEvent ("Parse tree transforms"); DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, TrAmlTransformWalk, NULL, NULL); UtEndEvent (Event); /* Generate AML opcodes corresponding to the parse tokens */ Event = UtBeginEvent ("Generate AML opcodes"); DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeWalk, NULL); UtEndEvent (Event); /* * Now that the input is parsed, we can open the AML output file. * Note: by default, the name of this file comes from the table descriptor * within the input file. */ Event = UtBeginEvent ("Open AML output file"); Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return -1; } UtEndEvent (Event); /* Interpret and generate all compile-time constants */ Event = UtBeginEvent ("Constant folding via AML interpreter"); DbgPrint (ASL_DEBUG_OUTPUT, "\nInterpreting compile-time constant expressions\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, OpcAmlConstantWalk, NULL, NULL); UtEndEvent (Event); /* Update AML opcodes if necessary, after constant folding */ Event = UtBeginEvent ("Updating AML opcodes after constant folding"); DbgPrint (ASL_DEBUG_OUTPUT, "\nUpdating AML opcodes after constant folding\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeUpdateWalk, NULL); UtEndEvent (Event); /* Calculate all AML package lengths */ Event = UtBeginEvent ("Generate AML package lengths"); DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); if (Gbl_ParseOnlyFlag) { AePrintErrorLog (ASL_FILE_STDOUT); UtDisplaySummary (ASL_FILE_STDOUT); if (Gbl_DebugFlag) { /* Print error summary to the debug file */ AePrintErrorLog (ASL_FILE_STDERR); UtDisplaySummary (ASL_FILE_STDERR); } return 0; } /* * Create an internal namespace and use it as a symbol table */ /* Namespace loading */ Event = UtBeginEvent ("Create ACPI Namespace"); Status = LdLoadNamespace (RootNode); UtEndEvent (Event); if (ACPI_FAILURE (Status)) { return -1; } /* Namespace cross-reference */ AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace"); Status = LkCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { return -1; } /* Namespace - Check for non-referenced objects */ LkFindUnreferencedObjects (); UtEndEvent (AslGbl_NamespaceEvent); /* * Semantic analysis. This can happen only after the * namespace has been loaded and cross-referenced. * * part one - check control methods */ Event = UtBeginEvent ("Analyze control method return types"); AnalysisWalkInfo.MethodStack = NULL; DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, AnMethodAnalysisWalkBegin, AnMethodAnalysisWalkEnd, &AnalysisWalkInfo); UtEndEvent (Event); /* Semantic error checking part two - typing of method returns */ Event = UtBeginEvent ("Determine object types returned by methods"); DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, AnMethodTypingWalkBegin, AnMethodTypingWalkEnd, NULL); UtEndEvent (Event); /* Semantic error checking part three - operand type checking */ Event = UtBeginEvent ("Analyze AML operand types"); DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, AnOperandTypecheckWalkBegin, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); UtEndEvent (Event); /* Semantic error checking part four - other miscellaneous checks */ Event = UtBeginEvent ("Miscellaneous analysis"); DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, AnOtherSemanticAnalysisWalkBegin, AnOtherSemanticAnalysisWalkEnd, &AnalysisWalkInfo); UtEndEvent (Event); /* Calculate all AML package lengths */ Event = UtBeginEvent ("Finish AML package length generation"); DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n"); TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, LnInitLengthsWalk, NULL); TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); /* Code generation - emit the AML */ Event = UtBeginEvent ("Generate AML code and write output files"); CgGenerateAmlOutput (); UtEndEvent (Event); Event = UtBeginEvent ("Write optional output files"); CmDoOutputFiles (); UtEndEvent (Event); UtEndEvent (FullCompile); CmCleanupAndExit (); return 0; } /******************************************************************************* * * FUNCTION: CmDoOutputFiles * * PARAMETERS: None * * RETURN: None. * * DESCRIPTION: Create all "listing" type files * ******************************************************************************/ void CmDoOutputFiles ( void) { /* Create listings and hex files */ LsDoListings (); LsDoHexOutput (); /* Dump the namespace to the .nsp file if requested */ (void) LsDisplayNamespace (); } /******************************************************************************* * * FUNCTION: CmDumpEvent * * PARAMETERS: Event - A compiler event struct * * RETURN: None. * * DESCRIPTION: Dump a compiler event struct * ******************************************************************************/ static void CmDumpEvent ( ASL_EVENT_INFO *Event) { UINT32 Delta; UINT32 USec; UINT32 MSec; if (!Event->Valid) { return; } /* Delta will be in 100-nanosecond units */ Delta = (UINT32) (Event->EndTime - Event->StartTime); USec = Delta / 10; MSec = Delta / 10000; /* Round milliseconds up */ if ((USec - (MSec * 1000)) >= 500) { MSec++; } DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n", USec, MSec, Event->EventName); } /******************************************************************************* * * FUNCTION: CmCleanupAndExit * * PARAMETERS: None * * RETURN: None. * * DESCRIPTION: Close all open files and exit the compiler * ******************************************************************************/ void CmCleanupAndExit ( void) { UINT32 i; AePrintErrorLog (ASL_FILE_STDOUT); if (Gbl_DebugFlag) { /* Print error summary to the debug file */ AePrintErrorLog (ASL_FILE_STDERR); } DbgPrint (ASL_DEBUG_OUTPUT, "\n\nElapsed time for major events\n\n"); for (i = 0; i < AslGbl_NextEvent; i++) { CmDumpEvent (&AslGbl_Events[i]); } if (Gbl_CompileTimesFlag) { printf ("\nElapsed time for major events\n\n"); for (i = 0; i < AslGbl_NextEvent; i++) { CmDumpEvent (&AslGbl_Events[i]); } printf ("\nMiscellaneous compile statistics\n\n"); printf ("%11u : %s\n", TotalParseNodes, "Parse nodes"); printf ("%11u : %s\n", Gbl_NsLookupCount, "Namespace searches"); printf ("%11u : %s\n", TotalNamedObjects, "Named objects"); printf ("%11u : %s\n", TotalMethods, "Control methods"); printf ("%11u : %s\n", TotalAllocations, "Memory Allocations"); printf ("%11u : %s\n", TotalAllocated, "Total allocated memory"); printf ("%11u : %s\n", TotalFolds, "Constant subtrees folded"); printf ("\n"); } if (Gbl_NsLookupCount) { DbgPrint (ASL_DEBUG_OUTPUT, "\n\nMiscellaneous compile statistics\n\n"); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d\n", "Total Namespace searches", Gbl_NsLookupCount); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d usec\n", "Time per search", ((UINT32) (AslGbl_Events[AslGbl_NamespaceEvent].EndTime - AslGbl_Events[AslGbl_NamespaceEvent].StartTime) / 10) / Gbl_NsLookupCount); } /* Close all open files */ for (i = 2; i < ASL_MAX_FILE_TYPE; i++) { FlCloseFile (i); } /* * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ if (!Gbl_SourceOutputFlag) { remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } /* Delete AML file if there are errors */ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) { remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); } if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); } UtDisplaySummary (ASL_FILE_STDOUT); } Index: head/sys/contrib/dev/acpica/compiler/aslutils.c =================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c (revision 195625) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c (revision 195626) @@ -1,1060 +1,1060 @@ /****************************************************************************** * * Module Name: aslutils -- compiler utilities * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * *****************************************************************************/ #include #include "aslcompiler.y.h" #include #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslutils") #ifdef _USE_BERKELEY_YACC extern const char * const AslCompilername[]; static const char * const *yytname = &AslCompilername[254]; #else extern const char * const yytname[]; #endif char HexLookup[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; /* Local prototypes */ static ACPI_STATUS UtStrtoul64 ( char *String, UINT32 Base, ACPI_INTEGER *RetInteger); static void UtPadNameWithUnderscores ( char *NameSeg, char *PaddedNameSeg); static void UtAttachNameseg ( ACPI_PARSE_OBJECT *Op, char *Name); /******************************************************************************* * * FUNCTION: AcpiPsDisplayConstantOpcodes * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Print AML opcodes that can be used in constant expressions. * ******************************************************************************/ void UtDisplayConstantOpcodes ( void) { UINT32 i; printf ("Constant expression opcode information\n\n"); for (i = 0; i < sizeof (AcpiGbl_AmlOpInfo) / sizeof (ACPI_OPCODE_INFO); i++) { if (AcpiGbl_AmlOpInfo[i].Flags & AML_CONSTANT) { printf ("%s\n", AcpiGbl_AmlOpInfo[i].Name); } } } /******************************************************************************* * * FUNCTION: UtLocalCalloc * * PARAMETERS: Size - Bytes to be allocated * * RETURN: Pointer to the allocated memory. Guaranteed to be valid. * * DESCRIPTION: Allocate zero-initialized memory. Aborts the compile on an * allocation failure, on the assumption that nothing more can be * accomplished. * ******************************************************************************/ void * UtLocalCalloc ( UINT32 Size) { void *Allocated; Allocated = ACPI_ALLOCATE_ZEROED (Size); if (!Allocated) { AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION, Gbl_CurrentLineNumber, Gbl_LogicalLineNumber, Gbl_InputByteCount, Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, NULL); exit (1); } TotalAllocations++; TotalAllocated += Size; return (Allocated); } /******************************************************************************* * * FUNCTION: UtBeginEvent * * PARAMETERS: Name - Ascii name of this event * * RETURN: Event - Event number (integer index) * * DESCRIPTION: Saves the current time with this event * ******************************************************************************/ UINT8 UtBeginEvent ( char *Name) { if (AslGbl_NextEvent >= ASL_NUM_EVENTS) { AcpiOsPrintf ("Ran out of compiler event structs!\n"); return (AslGbl_NextEvent); } /* Init event with current (start) time */ AslGbl_Events[AslGbl_NextEvent].StartTime = AcpiOsGetTimer (); AslGbl_Events[AslGbl_NextEvent].EventName = Name; AslGbl_Events[AslGbl_NextEvent].Valid = TRUE; return (AslGbl_NextEvent++); } /******************************************************************************* * * FUNCTION: UtEndEvent * * PARAMETERS: Event - Event number (integer index) * * RETURN: None * * DESCRIPTION: Saves the current time (end time) with this event * ******************************************************************************/ void UtEndEvent ( UINT8 Event) { if (Event >= ASL_NUM_EVENTS) { return; } /* Insert end time for event */ AslGbl_Events[Event].EndTime = AcpiOsGetTimer (); } /******************************************************************************* * * FUNCTION: UtHexCharToValue * * PARAMETERS: HexChar - Hex character in Ascii * * RETURN: The binary value of the hex character * * DESCRIPTION: Perform ascii-to-hex translation * ******************************************************************************/ UINT8 UtHexCharToValue ( int HexChar) { if (HexChar <= 0x39) { return ((UINT8) (HexChar - 0x30)); } if (HexChar <= 0x46) { return ((UINT8) (HexChar - 0x37)); } return ((UINT8) (HexChar - 0x57)); } /******************************************************************************* * * FUNCTION: UtConvertByteToHex * * PARAMETERS: RawByte - Binary data * Buffer - Pointer to where the hex bytes will be stored * * RETURN: Ascii hex byte is stored in Buffer. * * DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed * with "0x" * ******************************************************************************/ void UtConvertByteToHex ( UINT8 RawByte, UINT8 *Buffer) { Buffer[0] = '0'; Buffer[1] = 'x'; Buffer[2] = (UINT8) HexLookup[(RawByte >> 4) & 0xF]; Buffer[3] = (UINT8) HexLookup[RawByte & 0xF]; } /******************************************************************************* * * FUNCTION: UtConvertByteToAsmHex * * PARAMETERS: RawByte - Binary data * Buffer - Pointer to where the hex bytes will be stored * * RETURN: Ascii hex byte is stored in Buffer. * * DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed * with "0x" * ******************************************************************************/ void UtConvertByteToAsmHex ( UINT8 RawByte, UINT8 *Buffer) { Buffer[0] = '0'; Buffer[1] = (UINT8) HexLookup[(RawByte >> 4) & 0xF]; Buffer[2] = (UINT8) HexLookup[RawByte & 0xF]; Buffer[3] = 'h'; } /******************************************************************************* * * FUNCTION: DbgPrint * * PARAMETERS: Type - Type of output * Fmt - Printf format string * ... - variable printf list * * RETURN: None * * DESCRIPTION: Conditional print statement. Prints to stderr only if the * debug flag is set. * ******************************************************************************/ void DbgPrint ( UINT32 Type, char *Fmt, ...) { va_list Args; va_start (Args, Fmt); if (!Gbl_DebugFlag) { return; } if ((Type == ASL_PARSE_OUTPUT) && (!(AslCompilerdebug))) { return; } (void) vfprintf (stderr, Fmt, Args); va_end (Args); return; } /******************************************************************************* * * FUNCTION: UtPrintFormattedName * * PARAMETERS: ParseOpcode - Parser keyword ID * Level - Indentation level * * RETURN: None * * DESCRIPTION: Print the ascii name of the parse opcode. * ******************************************************************************/ #define TEXT_OFFSET 10 void UtPrintFormattedName ( UINT16 ParseOpcode, UINT32 Level) { if (Level) { DbgPrint (ASL_TREE_OUTPUT, "%*s", (3 * Level), " "); } DbgPrint (ASL_TREE_OUTPUT, " %-20.20s", UtGetOpName (ParseOpcode)); if (Level < TEXT_OFFSET) { DbgPrint (ASL_TREE_OUTPUT, "%*s", (TEXT_OFFSET - Level) * 3, " "); } } /******************************************************************************* * * FUNCTION: UtSetParseOpName * * PARAMETERS: Op * * RETURN: None * * DESCRIPTION: Insert the ascii name of the parse opcode * ******************************************************************************/ void UtSetParseOpName ( ACPI_PARSE_OBJECT *Op) { strncpy (Op->Asl.ParseOpName, UtGetOpName (Op->Asl.ParseOpcode), ACPI_MAX_PARSEOP_NAME); } /******************************************************************************* * * FUNCTION: UtGetOpName * * PARAMETERS: ParseOpcode - Parser keyword ID * * RETURN: Pointer to the opcode name * * DESCRIPTION: Get the ascii name of the parse opcode * ******************************************************************************/ char * UtGetOpName ( UINT32 ParseOpcode) { /* * First entries (ASL_YYTNAME_START) in yytname are special reserved names. * Ignore first 8 characters of the name */ return ((char *) yytname [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8); } /******************************************************************************* * * FUNCTION: UtDisplaySummary * * PARAMETERS: FileID - ID of outpout file * * RETURN: None * * DESCRIPTION: Display compilation statistics * ******************************************************************************/ void UtDisplaySummary ( UINT32 FileId) { if (FileId != ASL_FILE_STDOUT) { /* Compiler name and version number */ - FlPrintFile (FileId, "%s version %X [%s]\n", - CompilerId, (UINT32) ACPI_CA_VERSION, __DATE__); + FlPrintFile (FileId, "%s version %X\n", + CompilerId, (UINT32) ACPI_CA_VERSION); } /* Input/Output summary */ FlPrintFile (FileId, "ASL Input: %s - %d lines, %d bytes, %d keywords\n", Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber, Gbl_InputByteCount, TotalKeywords); /* AML summary */ if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors)) { FlPrintFile (FileId, "AML Output: %s - %d bytes, %d named objects, %d executable opcodes\n\n", Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, TotalNamedObjects, TotalExecutableOpcodes); } /* Error summary */ FlPrintFile (FileId, "Compilation complete. %d Errors, %d Warnings, %d Remarks, %d Optimizations\n", Gbl_ExceptionCount[ASL_ERROR], Gbl_ExceptionCount[ASL_WARNING] + Gbl_ExceptionCount[ASL_WARNING2] + Gbl_ExceptionCount[ASL_WARNING3], Gbl_ExceptionCount[ASL_REMARK], Gbl_ExceptionCount[ASL_OPTIMIZATION]); } /******************************************************************************* * * FUNCTION: UtDisplaySummary * * PARAMETERS: Op - Integer parse node * LowValue - Smallest allowed value * HighValue - Largest allowed value * * RETURN: Op if OK, otherwise NULL * * DESCRIPTION: Check integer for an allowable range * ******************************************************************************/ ACPI_PARSE_OBJECT * UtCheckIntegerRange ( ACPI_PARSE_OBJECT *Op, UINT32 LowValue, UINT32 HighValue) { char *ParseError = NULL; char Buffer[64]; if (!Op) { return NULL; } if (Op->Asl.Value.Integer < LowValue) { ParseError = "Value below valid range"; Op->Asl.Value.Integer = LowValue; } if (Op->Asl.Value.Integer > HighValue) { ParseError = "Value above valid range"; Op->Asl.Value.Integer = HighValue; } if (ParseError) { sprintf (Buffer, "%s 0x%X-0x%X", ParseError, LowValue, HighValue); AslCompilererror (Buffer); return NULL; } return Op; } /******************************************************************************* * * FUNCTION: UtGetStringBuffer * * PARAMETERS: Length - Size of buffer requested * * RETURN: Pointer to the buffer. Aborts on allocation failure * * DESCRIPTION: Allocate a string buffer. Bypass the local * dynamic memory manager for performance reasons (This has a * major impact on the speed of the compiler.) * ******************************************************************************/ char * UtGetStringBuffer ( UINT32 Length) { char *Buffer; if ((Gbl_StringCacheNext + Length) >= Gbl_StringCacheLast) { Gbl_StringCacheNext = UtLocalCalloc (ASL_STRING_CACHE_SIZE + Length); Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE + Length; } Buffer = Gbl_StringCacheNext; Gbl_StringCacheNext += Length; return (Buffer); } /******************************************************************************* * * FUNCTION: UtInternalizeName * * PARAMETERS: ExternalName - Name to convert * ConvertedName - Where the converted name is returned * * RETURN: Status * * DESCRIPTION: Convert an external (ASL) name to an internal (AML) name * ******************************************************************************/ ACPI_STATUS UtInternalizeName ( char *ExternalName, char **ConvertedName) { ACPI_NAMESTRING_INFO Info; ACPI_STATUS Status; if (!ExternalName) { return (AE_OK); } /* Get the length of the new internal name */ Info.ExternalName = ExternalName; AcpiNsGetInternalNameLength (&Info); /* We need a segment to store the internal name */ Info.InternalName = UtGetStringBuffer (Info.Length); if (!Info.InternalName) { return (AE_NO_MEMORY); } /* Build the name */ Status = AcpiNsBuildInternalName (&Info); if (ACPI_FAILURE (Status)) { return (Status); } *ConvertedName = Info.InternalName; return (AE_OK); } /******************************************************************************* * * FUNCTION: UtPadNameWithUnderscores * * PARAMETERS: NameSeg - Input nameseg * PaddedNameSeg - Output padded nameseg * * RETURN: Padded nameseg. * * DESCRIPTION: Pads a NameSeg with underscores if necessary to form a full * ACPI_NAME. * ******************************************************************************/ static void UtPadNameWithUnderscores ( char *NameSeg, char *PaddedNameSeg) { UINT32 i; for (i = 0; (i < ACPI_NAME_SIZE); i++) { if (*NameSeg) { *PaddedNameSeg = *NameSeg; NameSeg++; } else { *PaddedNameSeg = '_'; } PaddedNameSeg++; } } /******************************************************************************* * * FUNCTION: UtAttachNameseg * * PARAMETERS: Op - Parent parse node * Name - Full ExternalName * * RETURN: None; Sets the NameSeg field in parent node * * DESCRIPTION: Extract the last nameseg of the ExternalName and store it * in the NameSeg field of the Op. * ******************************************************************************/ static void UtAttachNameseg ( ACPI_PARSE_OBJECT *Op, char *Name) { char *NameSeg; char PaddedNameSeg[4]; if (!Name) { return; } /* Look for the last dot in the namepath */ NameSeg = strrchr (Name, '.'); if (NameSeg) { /* Found last dot, we have also found the final nameseg */ NameSeg++; UtPadNameWithUnderscores (NameSeg, PaddedNameSeg); } else { /* No dots in the namepath, there is only a single nameseg. */ /* Handle prefixes */ while ((*Name == '\\') || (*Name == '^')) { Name++; } /* Remaing string should be one single nameseg */ UtPadNameWithUnderscores (Name, PaddedNameSeg); } strncpy (Op->Asl.NameSeg, PaddedNameSeg, 4); } /******************************************************************************* * * FUNCTION: UtAttachNamepathToOwner * * PARAMETERS: Op - Parent parse node * NameOp - Node that contains the name * * RETURN: Sets the ExternalName and Namepath in the parent node * * DESCRIPTION: Store the name in two forms in the parent node: The original * (external) name, and the internalized name that is used within * the ACPI namespace manager. * ******************************************************************************/ void UtAttachNamepathToOwner ( ACPI_PARSE_OBJECT *Op, ACPI_PARSE_OBJECT *NameOp) { ACPI_STATUS Status; /* Full external path */ Op->Asl.ExternalName = NameOp->Asl.Value.String; /* Save the NameOp for possible error reporting later */ Op->Asl.ParentMethod = (void *) NameOp; /* Last nameseg of the path */ UtAttachNameseg (Op, Op->Asl.ExternalName); /* Create internalized path */ Status = UtInternalizeName (NameOp->Asl.Value.String, &Op->Asl.Namepath); if (ACPI_FAILURE (Status)) { /* TBD: abort on no memory */ } } /******************************************************************************* * * FUNCTION: UtDoConstant * * PARAMETERS: String - Hex, Octal, or Decimal string * * RETURN: Converted Integer * * DESCRIPTION: Convert a string to an integer. With error checking. * ******************************************************************************/ ACPI_INTEGER UtDoConstant ( char *String) { ACPI_STATUS Status; ACPI_INTEGER Converted; char ErrBuf[64]; Status = UtStrtoul64 (String, 0, &Converted); if (ACPI_FAILURE (Status)) { sprintf (ErrBuf, "%s %s\n", "Conversion error:", AcpiFormatException (Status)); AslCompilererror (ErrBuf); } return (Converted); } /* TBD: use version in ACPI CA main code base? */ /******************************************************************************* * * FUNCTION: UtStrtoul64 * * PARAMETERS: String - Null terminated string * Terminater - Where a pointer to the terminating byte is * returned * Base - Radix of the string * * RETURN: Converted value * * DESCRIPTION: Convert a string into an unsigned value. * ******************************************************************************/ static ACPI_STATUS UtStrtoul64 ( char *String, UINT32 Base, ACPI_INTEGER *RetInteger) { UINT32 Index; UINT32 Sign; ACPI_INTEGER ReturnValue = 0; ACPI_STATUS Status = AE_OK; *RetInteger = 0; switch (Base) { case 0: case 8: case 10: case 16: break; default: /* * The specified Base parameter is not in the domain of * this function: */ return (AE_BAD_PARAMETER); } /* Skip over any white space in the buffer: */ while (isspace (*String) || *String == '\t') { ++String; } /* * The buffer may contain an optional plus or minus sign. * If it does, then skip over it but remember what is was: */ if (*String == '-') { Sign = NEGATIVE; ++String; } else if (*String == '+') { ++String; Sign = POSITIVE; } else { Sign = POSITIVE; } /* * If the input parameter Base is zero, then we need to * determine if it is octal, decimal, or hexadecimal: */ if (Base == 0) { if (*String == '0') { if (tolower (*(++String)) == 'x') { Base = 16; ++String; } else { Base = 8; } } else { Base = 10; } } /* * For octal and hexadecimal bases, skip over the leading * 0 or 0x, if they are present. */ if (Base == 8 && *String == '0') { String++; } if (Base == 16 && *String == '0' && tolower (*(++String)) == 'x') { String++; } /* Main loop: convert the string to an unsigned long */ while (*String) { if (isdigit (*String)) { Index = ((UINT8) *String) - '0'; } else { Index = (UINT8) toupper (*String); if (isupper ((char) Index)) { Index = Index - 'A' + 10; } else { goto ErrorExit; } } if (Index >= Base) { goto ErrorExit; } /* Check to see if value is out of range: */ if (ReturnValue > ((ACPI_INTEGER_MAX - (ACPI_INTEGER) Index) / (ACPI_INTEGER) Base)) { goto ErrorExit; } else { ReturnValue *= Base; ReturnValue += Index; } ++String; } /* If a minus sign was present, then "the conversion is negated": */ if (Sign == NEGATIVE) { ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1; } *RetInteger = ReturnValue; return (Status); ErrorExit: switch (Base) { case 8: Status = AE_BAD_OCTAL_CONSTANT; break; case 10: Status = AE_BAD_DECIMAL_CONSTANT; break; case 16: Status = AE_BAD_HEX_CONSTANT; break; default: /* Base validated above */ break; } return (Status); } Index: head/sys/dev/hptrr/hptrr_config.c =================================================================== --- head/sys/dev/hptrr/hptrr_config.c (revision 195625) +++ head/sys/dev/hptrr/hptrr_config.c (revision 195626) @@ -1,72 +1,72 @@ /* * Copyright (c) HighPoint Technologies, Inc. * 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. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #include /**************************************************************************** * config.c - auto-generated file ****************************************************************************/ #include extern int init_module_him_rr2310pm(void); extern int init_module_him_rr174x_rr2210pm(void); extern int init_module_him_rr2522pm(void); extern int init_module_him_rr2340(void); extern int init_module_him_rr222x_rr2240(void); extern int init_module_him_rr1720(void); extern int init_module_him_rr232x(void); extern int init_module_vdev_raw(void); extern int init_module_partition(void); extern int init_module_raid0(void); extern int init_module_raid1(void); extern int init_module_raid5(void); extern int init_module_jbod(void); int init_config(void) { init_module_him_rr2310pm(); init_module_him_rr174x_rr2210pm(); init_module_him_rr2522pm(); init_module_him_rr2340(); init_module_him_rr222x_rr2240(); init_module_him_rr1720(); init_module_him_rr232x(); init_module_vdev_raw(); init_module_partition(); init_module_raid0(); init_module_raid1(); init_module_raid5(); init_module_jbod(); return 0; } char driver_name[] = "hptrr"; char driver_name_long[] = "RocketRAID 17xx/2xxx SATA controller driver"; -char driver_ver[] = "v1.2 (" __DATE__ " " __TIME__ ")"; +char driver_ver[] = "v1.2"; int osm_max_targets = 0xff; int os_max_cache_size = 0x1000000;