message
stringlengths
6
474
diff
stringlengths
8
5.22k
fixes improper null-termination in cttp header buffers
@@ -59,8 +59,8 @@ _cttp_bod_new(c3_w len_w, c3_c* hun_c) static u3_hbod* _cttp_bod_from_hed(u3_hhed* hed_u) { - c3_w len_w = hed_u->nam_w + 2 + hed_u->val_w + 3; - u3_hbod* bod_u = c3_malloc(len_w + sizeof(*bod_u)); + c3_w len_w = hed_u->nam_w + 2 + hed_u->val_w + 2; + u3_hbod* bod_u = c3_malloc(1 + len_w + sizeof(*bod_u)); bod_u->hun_y[len_w] = 0; memcpy(bod_u->hun_y, hed_u->nam_c, hed_u->nam_w);
specload: increase timeout
@@ -18,6 +18,6 @@ if (BUILD_SHARED AND ADDTESTING_PHASE) set (TESTAPP_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/elektra-specload-testapp") configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.c.in" "${CMAKE_CURRENT_BINARY_DIR}/config.c" @ONLY) - add_plugintest (specload INSTALL_TEST_DATA INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} TIMEOUT 10) + add_plugintest (specload INSTALL_TEST_DATA INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} TIMEOUT 30) add_dependencies (testmod_specload elektra-specload-testapp) endif ()
ossl_cmp_msg_check_update(): align recipNone check with improved transactionID check
@@ -640,6 +640,28 @@ int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg) return 0; } +static int check_transactionID_or_nonce(ASN1_OCTET_STRING *expected, + ASN1_OCTET_STRING *actual, int reason) +{ + if (expected != NULL + && (actual == NULL || ASN1_OCTET_STRING_cmp(expected, actual) != 0)) { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + char *expected_str, *actual_str; + + expected_str = i2s_ASN1_OCTET_STRING(NULL, expected); + actual_str = actual == NULL ? "(none)" + : i2s_ASN1_OCTET_STRING(NULL, actual); + ERR_raise_data(ERR_LIB_CMP, CMP_R_TRANSACTIONID_UNMATCHED, + "expected = %s, actual = %s", + expected_str == NULL ? "?" : expected_str, + actual_str == NULL ? "?" : actual_str); + OPENSSL_free(expected_str); + OPENSSL_free(actual_str); + return 0; +#endif + } + return 1; +} /*- * Check received message (i.e., response by server or request from client) @@ -742,36 +764,14 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg, } /* compare received transactionID with the expected one in previous msg */ - if (ctx->transactionID != NULL - && (hdr->transactionID == NULL - || ASN1_OCTET_STRING_cmp(ctx->transactionID, - hdr->transactionID) != 0)) { -#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION - char *ctx_str, *hdr_str; - - ctx_str = i2s_ASN1_OCTET_STRING(NULL, ctx->transactionID); - hdr_str = hdr->transactionID == NULL ? "(none)" - : i2s_ASN1_OCTET_STRING(NULL, hdr->transactionID); - ERR_raise_data(ERR_LIB_CMP, CMP_R_TRANSACTIONID_UNMATCHED, - "expected = %s, actual = %s", - ctx_str == NULL ? "?" : ctx_str, - hdr_str == NULL ? "?" : hdr_str); - OPENSSL_free(ctx_str); - OPENSSL_free(hdr_str); + if (!check_transactionID_or_nonce(ctx->transactionID, hdr->transactionID, + CMP_R_TRANSACTIONID_UNMATCHED)) return 0; -#endif - } /* compare received nonce with the one we sent */ - if (ctx->senderNonce != NULL - && (msg->header->recipNonce == NULL - || ASN1_OCTET_STRING_cmp(ctx->senderNonce, - hdr->recipNonce) != 0)) { -#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION - ERR_raise(ERR_LIB_CMP, CMP_R_RECIPNONCE_UNMATCHED); + if (!check_transactionID_or_nonce(ctx->senderNonce, hdr->recipNonce, + CMP_R_RECIPNONCE_UNMATCHED)) return 0; -#endif - } /* * RFC 4210 section 5.1.1 states: the recipNonce is copied from
delete header file
#include <sensor_msgs/BatteryState.h> #include <sensor_msgs/MagneticField.h> -#include <turtlebot3_msgs/SensorState.h> - #define ACCEL_FACTOR -0.000598 // 2.0 * -9.8 / 32768 #define GYRO_FACTOR 0.000133 // pi / (131 * 180) #define MAG_FACTOR 6e-7
flash: safer frsky offset, remove old comments
@@ -11,7 +11,7 @@ extern profile_t profile; extern float accelcal[]; #define FMC_HEADER 0x12AA0001 -#define FRSKY_BIND_OFFSET 50 +#define FRSKY_BIND_OFFSET 57 float initial_pid_identifier = -10; @@ -104,7 +104,7 @@ void flash_save(void) { } #endif -#ifdef RX_FRSKY //currently starts at address 66 +#ifdef RX_FRSKY extern int rx_bind_enable; extern frsky_bind_data frsky_bind; @@ -213,7 +213,7 @@ void flash_load(void) { flash_feature_2 = fmc_read_float(54); #endif -#ifdef RX_FRSKY //currently starts at address 57 +#ifdef RX_FRSKY extern int rx_bind_enable; // only load data if we did not just overwrite it
OpenCanopy: Restore boot timeout logic after recent kb changes
@@ -1117,7 +1117,8 @@ GuiDrawLoop ( // // If detected key press then disable menu timeout // - if (TimeOutSeconds > 0) { + if (PickerKeyInfo.OcKeyCode != OC_INPUT_NO_ACTION + && TimeOutSeconds > 0) { // // Voice only unrelated key press. //
Use locale::classic
@@ -106,7 +106,7 @@ static bool try_stoull(unsigned long long& val, const std::string& str, std::siz static float parse_float(const std::string& s, std::size_t* float_len = nullptr){ std::stringstream ss(s); - ss.imbue(std::locale("C")); + ss.imbue(std::locale::classic()); float ret; ss >> ret; if(ss.fail()) throw std::invalid_argument("parse_float: Not a float");
Update Makefile Add dependency version
@@ -20,7 +20,6 @@ $(error Environment variable BOLOS_SDK is not set) endif include $(BOLOS_SDK)/Makefile.defines -APP_LOAD_FLAGS= --appFlags 0x40 --dep Ethereum DEFINES_LIB = USE_LIB_ETHEREUM APP_LOAD_PARAMS= --curve secp256k1 $(COMMON_LOAD_PARAMS) @@ -28,7 +27,7 @@ APPVERSION_M=1 APPVERSION_N=1 APPVERSION_P=4 APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) - +APP_LOAD_FLAGS= --appFlags 0x40 --dep Ethereum:$(APPVERSION) ifeq ($(CHAIN),) CHAIN=ethereum
DOC: remove PARTITION_MODE related content Update the document as the PARTITION_MODE is removed from the code.
@@ -34,11 +34,6 @@ inside the hypervisor: Control flow of I/O emulation in the hypervisor -:option:`CONFIG_PARTITION_MODE` is the only configuration option that affects the -functionality of I/O emulation. With :option:`CONFIG_PARTITION_MODE` enabled, -the hypervisor never sends I/O request to any VM. Unhandled I/O reads -get all 1's and writes are silently dropped. - I/O emulation does not rely on any calibration data. Trap Path
Cache key add arch
@@ -53,7 +53,7 @@ end -- get cflags from make function _get_cflags_from_make(target, sdkdir) - local key = sdkdir + local key = sdkdir .. target:arch() local cflags = memcache.get2("linux.driver", key, "cflags") local ldflags_o = memcache.get2("linux.driver", key, "ldflags_o") local ldflags_ko = memcache.get2("linux.driver", key, "ldflags_ko")
validate gcc version for use -fstack-protector-strong in the Makefile
@@ -21,7 +21,17 @@ INSTALL_LIBRARY_PATH = $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH) INSTALL ?= cp -a -R_CFLAGS = -fPIC -std=c89 -pedantic -Wall -Werror -Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wc++-compat -Wundef -Wswitch-default -Wconversion -fstack-protector-strong $(CFLAGS) +# validate gcc version for use fstack-protector-strong +MIN_GCC_VERSION = "4.9" +GCC_VERSION := "`gcc -dumpversion`" +IS_GCC_ABOVE_MIN_VERSION := $(shell expr "$(GCC_VERSION)" ">=" "$(MIN_GCC_VERSION)") +ifeq "$(IS_GCC_ABOVE_MIN_VERSION)" "1" + CFLAGS += -fstack-protector-strong +else + CFLAGS += -fstack-protector +endif + +R_CFLAGS = -fPIC -std=c89 -pedantic -Wall -Werror -Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wc++-compat -Wundef -Wswitch-default -Wconversion $(CFLAGS) uname := $(shell sh -c 'uname -s 2>/dev/null || echo false')
dev-tools/scipy: add bind11 build dependencies
@@ -34,7 +34,11 @@ Url: http://www.scipy.org Source0: https://github.com/scipy/scipy/archive/v%{version}.tar.gz#/%{pname}-%{version}.tar.gz %if 0%{?sles_version} || 0%{?suse_version} BuildRequires: fdupes +BuildRequires: %{python_prefix}-pybind11-devel +%else +BuildRequires: pybind11-devel %endif +BuildRequires: %{python_prefix}-pybind11 %if "%{compiler_family}" != "arm" BuildRequires: fftw-%{compiler_family}-%{mpi_family}%{PROJ_DELIM} %endif
Further simplify formatting code Remove redundant length checks before `memcpy` Coerce `sign` and `prefix` to boolean for `numLen`
@@ -166,7 +166,6 @@ void fmt_PrintString(char *buf, size_t bufLen, struct FormatSpec const *fmt, cha } else { for (size_t i = 0; i < padLen; i++) buf[i] = ' '; - if (totalLen > padLen) memcpy(buf + padLen, value, len); } @@ -256,13 +255,7 @@ void fmt_PrintNumber(char *buf, size_t bufLen, struct FormatSpec const *fmt, uin } size_t len = strlen(valueBuf); - size_t numLen = len; - - if (sign) - numLen++; - if (prefix) - numLen++; - + size_t numLen = !!sign + !!prefix + len; size_t totalLen = fmt->width > numLen ? fmt->width : numLen; if (totalLen > bufLen - 1) { /* bufLen includes terminator */ @@ -304,7 +297,6 @@ void fmt_PrintNumber(char *buf, size_t bufLen, struct FormatSpec const *fmt, uin if (prefix) buf[pos++] = prefix; } - if (totalLen > pos) memcpy(buf + pos, valueBuf, len); }
Add libomp to the LAPACK(-test) dependencies in clang/gfortran builds
@@ -268,7 +268,11 @@ ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN))) -@echo "POPTS = $(LAPACK_FPFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "FFLAGS_NOOPT = -O0 $(LAPACK_NOOPT)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "PNOOPT = $(LAPACK_FPFLAGS) -O0" >> $(NETLIB_LAPACK_DIR)/make.inc +ifeq ($(C_COMPILER)$(F_COMPILER)$(USE_OPENMP), CLANGGFORTRAN1) + -@echo "LDFLAGS = $(FFLAGS) $(EXTRALIB) -lomp" >> $(NETLIB_LAPACK_DIR)/make.inc +else -@echo "LDFLAGS = $(FFLAGS) $(EXTRALIB)" >> $(NETLIB_LAPACK_DIR)/make.inc +endif -@echo "CC = $(CC)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "override CFLAGS = $(LAPACK_CFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "AR = $(AR)" >> $(NETLIB_LAPACK_DIR)/make.inc
makefile: describe mapping from amd64 to x86_64
@@ -39,7 +39,12 @@ endif endif -# map architecture amd64 to x86_64 +# conditionally map ARCH from amd64 to x86_64 if set from the outside +# +# Some OS provide a definition for $(ARCH) through an environment +# variable. It might be set to amd64 which implies x86_64. Since e.g. +# luajit expects either i386 or x86_64, the value amd64 is transformed +# to match a directory for a platform dependent implementation. ARCH :=$(if $(findstring amd64,$(ARCH)),x86_64,$(ARCH)) xmake_dir_install :=$(prefix)/share/xmake
Fix file sealing on tmpfs unlink dynamic configuration file before creating a new one Closes
@@ -108,9 +108,16 @@ attachCmd(pid_t pid, bool attach) scope_snprintf(path, sizeof(path), "%s/%s.%d", DYN_CONFIG_CLI_DIR, DYN_CONFIG_CLI_PREFIX, pid); + /* + * Unlink a possible existing file before creating a new one + * due to a fact that scope_open will fail if the file is + * sealed (still processed on library side). + * File sealing is supported on tmpfs - /dev/shm (DYN_CONFIG_CLI_DIR). + */ + scope_unlink(path); fd = scope_open(path, O_WRONLY|O_CREAT); if (fd == -1) { - scope_perror("open() of dynamic config file"); + scope_perror("scope_open() of dynamic config file"); return EXIT_FAILURE; }
Zeroing the buffer in `createCron`
@@ -389,7 +389,7 @@ nsForkAndExec(pid_t parentPid, pid_t nsPid, char attachType) static bool createCron(const char *scopePath, const char* filterPath) { int outFd; - char buf[1024]; + char buf[1024] = {0}; char path[PATH_MAX] = {0}; // Create the script to be executed by cron
ksched: disabled cstates no longer used in recent kernels
@@ -535,7 +535,7 @@ static int __init ksched_cpuidle_hijack(void) drv = cpuidle_get_driver(); if (!drv) return -ENOENT; - if (drv->state_count <= 0 || drv->states[0].disabled) + if (drv->state_count <= 0) return -EINVAL; cpuidle_pause_and_lock();
Make os/date results more consistent.
@@ -287,9 +287,9 @@ static Janet os_date(int32_t argc, Janet *argv) { janet_struct_put(st, janet_ckeywordv("seconds"), janet_wrap_number(t_info->tm_sec)); janet_struct_put(st, janet_ckeywordv("minutes"), janet_wrap_number(t_info->tm_min)); janet_struct_put(st, janet_ckeywordv("hours"), janet_wrap_number(t_info->tm_hour)); - janet_struct_put(st, janet_ckeywordv("month-day"), janet_wrap_number(t_info->tm_mday)); + janet_struct_put(st, janet_ckeywordv("month-day"), janet_wrap_number(t_info->tm_mday - 1)); janet_struct_put(st, janet_ckeywordv("month"), janet_wrap_number(t_info->tm_mon)); - janet_struct_put(st, janet_ckeywordv("year"), janet_wrap_number(t_info->tm_year)); + janet_struct_put(st, janet_ckeywordv("year"), janet_wrap_number(t_info->tm_year + 1900)); janet_struct_put(st, janet_ckeywordv("week-day"), janet_wrap_number(t_info->tm_wday)); janet_struct_put(st, janet_ckeywordv("year-day"), janet_wrap_number(t_info->tm_yday)); janet_struct_put(st, janet_ckeywordv("dst"), janet_wrap_boolean(t_info->tm_isdst)); @@ -359,13 +359,13 @@ static const JanetReg cfuns[] = { "os/date", os_date, JDOC("(os/date [,time])\n\n" "Returns the given time as a date struct, or the current time if no time is given. " - "Returns a struct with following key values.\n\n" + "Returns a struct with following key values. Note that all numbers are 0-indexed.\n\n" "\t:seconds - number of seconds [0-61]\n" "\t:minutes - number of minutes [0-59]\n" "\t:seconds - number of hours [0-23]\n" - "\t:month-day - day of month [1-31]\n" + "\t:month-day - day of month [0-30]\n" "\t:month - month of year [0, 11]\n" - "\t:year - years since 1900\n" + "\t:year - years since year 0 (e.g. 2019)\n" "\t:week-day - day of the week [0-6]\n" "\t:year-day - day of the year [0-365]\n" "\t:dst - If Day Light Savings is in effect")
Fix ZstdDecompressor on 64-bit big-endian When parsing the python arguments, using "I" (int) in the format string but passing a pointer to size_t means that, on big endian, we're only initializing the high-order bits of the size_t. Use "n" (Py_ssize_t) format instead, which should be the right size.
@@ -68,13 +68,13 @@ static int Decompressor_init(ZstdDecompressor* self, PyObject* args, PyObject* k }; ZstdCompressionDict* dict = NULL; - size_t maxWindowSize = 0; + Py_ssize_t maxWindowSize = 0; ZSTD_format_e format = ZSTD_f_zstd1; self->dctx = NULL; self->dict = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!II:ZstdDecompressor", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!nI:ZstdDecompressor", kwlist, &ZstdCompressionDictType, &dict, &maxWindowSize, &format)) { return -1; }
No usable TLSAs counts as no (or no secure) TLSAs too
@@ -1799,6 +1799,7 @@ main(int argc, char* const* argv) if (!usable_tlsas) { fprintf(stderr, "No usable TLSA records were found.\n" "PKIX validation without DANE will be performed.\n"); + exit_success = no_tlsas_exit_status; } if (!(store_ctx = X509_STORE_CTX_new())) { ssl_err("could not SSL_new"); @@ -1904,6 +1905,8 @@ main(int argc, char* const* argv) if (!usable_tlsas) { fprintf(stderr, "No usable TLSA records were found.\n" "PKIX validation without DANE will be performed.\n"); + + exit_success = no_tlsas_exit_status; if (assume_pkix_validity) SSL_set_verify(ssl, SSL_VERIFY_PEER, _ldns_tls_verify_always_ok); }
ghost: set 1 MHz I2C buses to 400 KHz This sets all I2C buses to run at no more than 400 KHz. 1 MHz operation should only be enabled after validation. BRANCH=none TEST=image boots on brya, PD charging works
@@ -23,7 +23,8 @@ const struct i2c_port_t i2c_ports[] = { /* I2C1 */ .name = "tcpc0,2", .port = I2C_PORT_USB_C0_C2_TCPC, - .kbps = 1000, + /* TODO(b/233013680): set to 1000 when validated */ + .kbps = 400, .scl = GPIO_EC_I2C_USB_C0_C2_TCPC_SCL, .sda = GPIO_EC_I2C_USB_C0_C2_TCPC_SDA, }, @@ -31,7 +32,8 @@ const struct i2c_port_t i2c_ports[] = { /* I2C2 */ .name = "ppc0,2", .port = I2C_PORT_USB_C0_C2_PPC, - .kbps = 1000, + /* TODO(b/233013680): set to 1000 when validated */ + .kbps = 400, .scl = GPIO_EC_I2C_USB_C0_C2_PPC_BC_SCL, .sda = GPIO_EC_I2C_USB_C0_C2_PPC_BC_SDA, }, @@ -39,7 +41,8 @@ const struct i2c_port_t i2c_ports[] = { /* I2C3 */ .name = "retimer0,2", .port = I2C_PORT_USB_C0_C2_MUX, - .kbps = 1000, + /* TODO(b/233013680): set to 1000 when validated */ + .kbps = 400, .scl = GPIO_EC_I2C_USB_C0_C2_RT_SCL, .sda = GPIO_EC_I2C_USB_C0_C2_RT_SDA, },
fix issue of different behavior of dirname on mac and linux.
#include "utils.h" #include <sys/stat.h> +#include <stdlib.h> #if defined (__APPLE__)|| defined (__MACOS__) #include <unistd.h> #include <libgen.h> @@ -25,16 +26,17 @@ static char g_xdag_current_path[4096] = {0}; void xdag_init_path(char *path) { + char *pathcopy = strdup(path); #if defined (__APPLE__)|| defined (__MACOS__) - char * n = dirname(path); - if (*n != '/' && *n != '\\') { + char *prefix = dirname(pathcopy); + if (*prefix != '/' && *prefix != '\\') { char buf[PATH_MAX]; getcwd(buf, PATH_MAX); - sprintf(g_xdag_current_path, "%s/%s", buf, n); + sprintf(g_xdag_current_path, "%s/%s", buf, prefix); } else { - sprintf(g_xdag_current_path, "%s", n); + sprintf(g_xdag_current_path, "%s", prefix); } - + free(prefix); #elif _WIN32 char szPath[MAX_PATH]; char szBuffer[MAX_PATH]; @@ -46,21 +48,23 @@ void xdag_init_path(char *path) strcpy(g_xdag_current_path, szBuffer); #else - char * n = dirname(path); - if (*n != '/' && *n != '\\') { + char *prefix = dirname(pathcopy); + if (*prefix != '/' && *prefix != '\\') { char buf[PATH_MAX]; getcwd(buf, PATH_MAX); - sprintf(g_xdag_current_path, "%s/%s", buf, n); + sprintf(g_xdag_current_path, "%s/%s", buf, prefix); } else { - sprintf(g_xdag_current_path, "%s", n); + sprintf(g_xdag_current_path, "%s", prefix); } #endif - const int pathLen = strlen(g_xdag_current_path); + const size_t pathLen = strlen(g_xdag_current_path); if (pathLen == 0 || g_xdag_current_path[pathLen - 1] != *DELIMITER) { g_xdag_current_path[pathLen] = *DELIMITER; g_xdag_current_path[pathLen + 1] = 0; } + + free(pathcopy); } FILE* xdag_open_file(const char *path, const char *mode)
Indenting of examples
@@ -66,7 +66,7 @@ char buf[256]; ssize_t sz = mrecv(s, buf, sizeof(buf), -1); s = crlf_detach(s, -1); tcp_close(s); -` + `, } http_protocol = { @@ -938,6 +938,29 @@ for(i = 0; i != 1000000; ++i) { }, ] +// Trims whitespeace around the rectangular area of text. +function trimrect(t) { + // Trim empty lines at the top and the bottom. + var lns = t.split("\n") + var lines = [] + for(var i = 0; i < lns.length; i++) { + if(lns[i].trim().length > 0) lines.push(lns[i]) + } + // Determine minimal left indent. + var indent = -1 + for(var i = 0; i < lines.length; i++) { + var n = lines[i].length - lines[i].trimLeft().length + if(n < indent || indent == -1) indent = n + } + // Trim the whitespace from the left and the right. + lns = [] + for(var i = 0; i < lines.length; i++) { + lns.push(lines[i].substr(indent).trimRight()) + } + return lns.join("\n") +} + +// Generate man page for one function. function generate_man_page(fx, mem) { var t = ""; @@ -1107,7 +1130,7 @@ The function returns **EINVAL** error in case the list is malformed or if it con t += "# EXAMPLE\n\n" var example = fx.example if(example == undefined) example = fx.protocol.example - t += "```c" + example + "```\n" + t += "```c\n" + trimrect(example) + "\n```\n" } return t
dev:[tools] add default project name and project path while --dist-ide
@@ -925,14 +925,11 @@ def EndBuilding(target, program = None): project_name = GetOption('project-name') if not isinstance(project_path, str) or len(project_path) == 0 : - print("\nwarning : --project-path=your_project_path parameter is required.") - print("\nstop!") - exit(0) - + project_path = os.path.join(BSP_ROOT, 'dist_ide_project') + print("\nwarning : --project-path not specified, use default path: {0}.".format(project_path)) if not isinstance(project_name, str) or len(project_name) == 0: - print("\nwarning : --project-name=your_project_name parameter is required.") - print("\nstop!") - exit(0) + project_name = "dist_ide_project" + print("\nwarning : --project-name not specified, use default project name: {0}.".format(project_name)) rtt_ide = {'project_path' : project_path, 'project_name' : project_name} MkDist(program, BSP_ROOT, Rtt_Root, Env, rtt_ide)
Only install the ARM toolchain.
@@ -35,9 +35,9 @@ RUN apt-get -y update && \ rm -rf /var/lib/apt/lists/* ARG ZSDK_VERSION=0.11.2 -RUN wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-sdk-${ZSDK_VERSION}-setup.run" && \ - sh "zephyr-sdk-${ZSDK_VERSION}-setup.run" --quiet -- -d /opt/toolchains/zephyr-sdk-${ZSDK_VERSION} && \ - rm "zephyr-sdk-${ZSDK_VERSION}-setup.run" +RUN wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" && \ + sh "zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" --quiet -- -d /opt/toolchains/zephyr-sdk-${ZSDK_VERSION} && \ + rm "zephyr-toolchain-arm-${ZSDK_VERSION}-setup.run" ARG CMAKE_VERSION=3.16.2 RUN wget -q https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh && \
uh oh, it's magic
@@ -19,7 +19,7 @@ configuration options. These tips are highlighted via the following format: \begin{center} \begin{tcolorbox}[] \small -The dude abides. --Jeffrey Lebowski +Any sufficiently advanced technology is indistinguishable from magic. --Arthur C. Clarke \end{tcolorbox} \end{center}
Fixed parallel typo in File_location
@@ -256,7 +256,7 @@ other than ``VUSER_HOME``. These are breifly described in this section. ``<letter>.<component-name>.<mpi-rank-or-$pid>.<debug-level>.vlog`` where ``<letter>`` is one of ``A`` through ``E``, ``<component-name>`` is one of ``gui``, ``mdserver``, ``viewer``, ``engine_ser``, ``engine_par``, - ``<mpi-rank-or-$pid>`` is the MPI rank for a prallel engine (``engine_par``) + ``<mpi-rank-or-$pid>`` is the MPI rank for a parallel engine (``engine_par``) or, optionally if ``-pid`` is given as a command-line :ref:`startup option <StartupOptions>`) the component's process id, and ``<debug-level>`` is the integer argument for the ``-debug``
linux-raspberrypi: Drop ineffective code The code to determine if we need to depend on lzop-native will fail as the local defconfig file no longer exists.
@@ -129,22 +129,3 @@ do_configure_prepend() { yes '' | oe_runmake oldconfig } - -# Automatically depend on lzop-native if CONFIG_KERNEL_LZO is enabled -python () { - try: - defconfig = bb.fetch2.localpath('file://defconfig', d) - except bb.fetch2.FetchError: - return - - try: - configfile = open(defconfig) - except IOError: - return - - if 'CONFIG_KERNEL_LZO=y\n' in configfile.readlines(): - depends = d.getVar('DEPENDS', False) - d.setVar('DEPENDS', depends + ' lzop-native') - - configfile.close() -}
zephyr: Fix kconfig license header BRANCH=none TEST=none
- -# Copyright 2020 Google LLC -# SPDX-License-Identifier: Apache-2.0 +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. # TODO(b/176828988): enable by default once the code can compile menuconfig CROS_FLASH_NPCX
Fix finished message decryption fail issue
@@ -1328,6 +1328,7 @@ static int ssl_tls13_finalize_server_hello( mbedtls_ssl_context *ssl ) handshake->transform_handshake = transform_handshake; mbedtls_ssl_set_inbound_transform( ssl, transform_handshake ); + mbedtls_ssl_set_outbound_transform( ssl, ssl->handshake->transform_handshake ); MBEDTLS_SSL_DEBUG_MSG( 1, ( "Switch to handshake keys for inbound traffic" ) ); ssl->session_in = ssl->session_negotiate;
Declare data module constructors consistently;
@@ -39,6 +39,31 @@ static int l_lovrDataNewBlob(lua_State* L) { return 1; } +static int l_lovrDataNewImage(lua_State* L) { + Image* image = NULL; + if (lua_type(L, 1) == LUA_TNUMBER) { + int width = luaL_checkinteger(L, 1); + int height = luaL_checkinteger(L, 2); + TextureFormat format = luax_checkenum(L, 3, TextureFormat, "rgba"); + Blob* blob = lua_isnoneornil(L, 4) ? NULL : luax_checktype(L, 4, Blob); + image = lovrImageCreate(width, height, blob, 0x0, format); + } else { + Image* source = luax_totype(L, 1, Image); + if (source) { + image = lovrImageCreate(source->width, source->height, source->blob, 0x0, source->format); + } else { + Blob* blob = luax_readblob(L, 1, "Texture"); + bool flip = lua_isnoneornil(L, 2) ? true : lua_toboolean(L, 2); + image = lovrImageCreateFromBlob(blob, flip); + lovrRelease(blob, lovrBlobDestroy); + } + } + + luax_pushtype(L, Image, image); + lovrRelease(image, lovrImageDestroy); + return 1; +} + static int l_lovrDataNewModelData(lua_State* L) { Blob* blob = luax_readblob(L, 1, "Model"); ModelData* modelData = lovrModelDataCreate(blob, luax_readfile); @@ -95,31 +120,6 @@ static int l_lovrDataNewSound(lua_State* L) { return 1; } -static int l_lovrDataNewImage(lua_State* L) { - Image* image = NULL; - if (lua_type(L, 1) == LUA_TNUMBER) { - int width = luaL_checkinteger(L, 1); - int height = luaL_checkinteger(L, 2); - TextureFormat format = luax_checkenum(L, 3, TextureFormat, "rgba"); - Blob* blob = lua_isnoneornil(L, 4) ? NULL : luax_checktype(L, 4, Blob); - image = lovrImageCreate(width, height, blob, 0x0, format); - } else { - Image* source = luax_totype(L, 1, Image); - if (source) { - image = lovrImageCreate(source->width, source->height, source->blob, 0x0, source->format); - } else { - Blob* blob = luax_readblob(L, 1, "Texture"); - bool flip = lua_isnoneornil(L, 2) ? true : lua_toboolean(L, 2); - image = lovrImageCreateFromBlob(blob, flip); - lovrRelease(blob, lovrBlobDestroy); - } - } - - luax_pushtype(L, Image, image); - lovrRelease(image, lovrImageDestroy); - return 1; -} - static const luaL_Reg lovrData[] = { { "newBlob", l_lovrDataNewBlob }, { "newImage", l_lovrDataNewImage },
Add more UDP documentation, contributes to
@@ -451,6 +451,35 @@ The syntax and functional similar to [`net.socket:on()`](#netsocketon). However, Sends data to specific remote peer. +#### Syntax +`send(port, ip, data)` + +#### Parameters +- `port` remote socket port +- `ip` remote socket IP +- `data` the payload to send + +#### Returns +`nil` + +#### Example +```lua +udpSocket = net.createUDPSocket() +udpSocket:listen(5000) +udpSocket:on("receive", function(s, data, port, ip) + print(string.format("received '%s' from %s:%d", data, ip, port)) + s:send(port, ip, "echo: " .. data) +end) +port, ip = udpSocket:getaddr() +print(string.format("local UDP socket address / port: %s:%d", ip, port)) +``` +On *nix systems that can then be tested by issuing + +``` +echo -n "foo" | nc -w1 -u <device-IP-address> 5000 +``` + + ## net.udpsocket:dns() Provides DNS resolution for a hostname.
Fix sixtop example
@@ -91,7 +91,7 @@ PROCESS_THREAD(node_process, ev, data) /* Get time-source neighbor */ n = tsch_queue_get_time_source(); - if(node_id != 1) { + if(!is_coordinator) { if((added_num_of_links == 1) || (added_num_of_links == 3)) { printf("App : Add a link\n"); sf_simple_add_links(&n->addr, 1);
webp-container-spec.txt: make reserved 0 values a MUST these were intended as an extension point, but in this version of the spec they're not defined. if they ever were used leaving them as SHOULD could result in a source of incompatibility.
@@ -322,7 +322,7 @@ Extended WebP file header: Reserved (Rsv): 2 bits -: SHOULD be `0`. +: MUST be `0`. ICC profile (I): 1 bit @@ -348,11 +348,11 @@ Animation (A): 1 bit Reserved (R): 1 bit -: SHOULD be `0`. +: MUST be `0`. Reserved: 24 bits -: SHOULD be `0`. +: MUST be `0`. Canvas Width Minus One: 24 bits @@ -466,7 +466,7 @@ Frame Duration: 24 bits (_uint24_) Reserved: 6 bits -: SHOULD be 0. +: MUST be 0. Blending method (B): 1 bit @@ -546,7 +546,7 @@ _padded_ chunks as described by the [RIFF file format](#riff-file-format). Reserved (Rsv): 2 bits -: SHOULD be `0`. +: MUST be `0`. Pre-processing (P): 2 bits
use USBD_MemCopy.
@@ -101,6 +101,11 @@ static void usb_detach(void) USBD->SE0 |= USBD_SE0_SE0_Msk; } +static void usb_memcpy(uint8_t *dest, uint8_t *src, uint16_t size) +{ + while(size--) *dest++ = *src++; +} + static void usb_control_send_zlp(void) { USBD->EP[PERIPH_EP0].CFG |= USBD_CFG_DSQSYNC_Msk; @@ -153,7 +158,7 @@ static void dcd_in_xfer(struct xfer_ctl_t *xfer, USBD_EP_T *ep) else #endif { - memcpy((uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), xfer->data_ptr, bytes_now); + usb_memcpy((uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), xfer->data_ptr, bytes_now); } ep->MXPLD = bytes_now; @@ -252,7 +257,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc) /* mine the data for the information we need */ int const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress); int const size = p_endpoint_desc->wMaxPacketSize.size; - tusb_xfer_type_t const type = p_endpoint_desc->bmAttributes.xfer; + tusb_xfer_type_t const type = (tusb_xfer_type_t)p_endpoint_desc->bmAttributes.xfer; struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP]; /* allocate buffer from USB RAM */ @@ -450,7 +455,7 @@ void dcd_int_handler(uint8_t rhport) else #endif { - memcpy(xfer->data_ptr, (uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), available_bytes); + usb_memcpy(xfer->data_ptr, (uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), available_bytes); xfer->data_ptr += available_bytes; }
OcMachoLib: Prefer Index over Walkers when available.
@@ -95,11 +95,8 @@ InternalGetExternalRelocationByOffset ( ASSERT (Context->DySymtab != NULL); ASSERT (Context->ExternRelocations != NULL); - for ( - Index = 0, Relocation = &Context->ExternRelocations[0]; - Index < Context->DySymtab->NumExternalRelocations; - ++Index, ++Relocation - ) { + for (Index = 0; Index < Context->DySymtab->NumExternalRelocations; ++Index) { + Relocation = &Context->ExternRelocations[Index]; // // A section-based relocation entry can be skipped for absolute // symbols. @@ -125,7 +122,6 @@ InternalGetExternalRelocationByOffset ( // if (MachoRelocationIsPairIntel64 (Relocation->Type)) { ++Index; - ++Relocation; } }
Net1.inp have 0 MinorLoss / GUI accepts values zero for MINORLOSS. Similar to the parameter Power of pumps
@@ -3862,7 +3862,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu case EN_MINORLOSS: if (Link[index].Type != PUMP) { - if (value <= 0.0) return 211; + if (value < 0.0) return 211; Link[index].Km = 0.02517 * value / SQR(Link[index].Diam) / SQR(Link[index].Diam); } @@ -3953,7 +3953,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu case EN_PUMP_POWER: if (Link[index].Type == PUMP) { - if (value <= 0.0) return 211; + if (value < 0.0) return 211; pumpIndex = findpump(&p->network, index); net->Pump[pumpIndex].Ptype = CONST_HP; net->Pump[pumpIndex].Hcurve = 0;
OpenCorePlatform: Properly copy SMBIOS product name
@@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Guid/AppleVariable.h> -STATIC CONST CHAR8 *mCurrentSmbiosProductName; +STATIC CHAR8 mCurrentSmbiosProductName[48]; STATIC VOID @@ -356,7 +356,10 @@ OcPlatformUpdateSmbios ( if (Data.SystemProductName != NULL) { DEBUG ((DEBUG_INFO, "OC: New SMBIOS: %a model %a\n", Data.SystemManufacturer, Data.SystemProductName)); - mCurrentSmbiosProductName = Data.SystemProductName; + Status = AsciiStrCpyS (mCurrentSmbiosProductName, sizeof (mCurrentSmbiosProductName), Data.SystemProductName); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "OC: Failed to copy new SMBIOS product name %a\n", Data.SystemProductName)); + } } Status = OcSmbiosCreate (SmbiosTable, &Data, UpdateMode, CpuInfo); @@ -568,6 +571,7 @@ OcLoadPlatformSupport ( EFI_STATUS Status; OC_SMBIOS_TABLE SmbiosTable; BOOLEAN ExposeOem; + CONST CHAR8 *SmbiosProductName; if (Config->PlatformInfo.Automatic) { GetMacInfo (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemProductName), &InfoData); @@ -589,8 +593,12 @@ OcLoadPlatformSupport ( OcSmbiosExposeOemInfo (&SmbiosTable); } - mCurrentSmbiosProductName = OcSmbiosGetProductName (&SmbiosTable); - DEBUG ((DEBUG_INFO, "OC: Current SMBIOS: %a model %a\n", OcSmbiosGetManufacturer (&SmbiosTable), mCurrentSmbiosProductName)); + SmbiosProductName = OcSmbiosGetProductName (&SmbiosTable); + DEBUG ((DEBUG_INFO, "OC: Current SMBIOS: %a model %a\n", OcSmbiosGetManufacturer (&SmbiosTable), SmbiosProductName)); + Status = AsciiStrCpyS (mCurrentSmbiosProductName, sizeof (mCurrentSmbiosProductName), SmbiosProductName); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "OC: Failed to copy SMBIOS product name %a\n", SmbiosProductName)); + } if (Config->PlatformInfo.UpdateSmbios) { SmbiosUpdateStr = OC_BLOB_GET (&Config->PlatformInfo.UpdateSmbiosMode);
More tweaks to dependency generation.
@@ -59,7 +59,7 @@ distclean: clean # Update dependencies depend: - $(CC) -MM $(CFLAGS) $(OBJS:.o=.c) | sed -e '1,$$s/\/usr\/local\/include\/[^ ]+//g' >Dependencies + $(CC) -MM $(CFLAGS) $(OBJS:.o=.c) | sed -e '1,$$s/\/usr\/include\/[^ ]+//g' -e '1,$$s/\/usr\/local\/include\/[^ ]+//g' >Dependencies # Install everything
Fix ipv4_from_asc behavior on invalid Ip addresses sscanf() call in ipv4_from_asc does not check that the string is terminated immediately after the last digit.
@@ -1096,13 +1096,17 @@ int ossl_a2i_ipadd(unsigned char *ipout, const char *ipasc) static int ipv4_from_asc(unsigned char *v4, const char *in) { - int a0, a1, a2, a3; + const char *p; + int a0, a1, a2, a3, n; - if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4) + if (sscanf(in, "%d.%d.%d.%d%n", &a0, &a1, &a2, &a3, &n) != 4) return 0; if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255) || (a2 < 0) || (a2 > 255) || (a3 < 0) || (a3 > 255)) return 0; + p = in + n; + if (!(*p == '\0' || ossl_isspace(*p))) + return 0; v4[0] = a0; v4[1] = a1; v4[2] = a2;
options/posix/in: define IN6_ARE_ADDR_EQUAL
@@ -82,6 +82,12 @@ struct ipv6_mreq { !_a[1] && \ _a[2] == htonl(0xffff); \ }) +#define __ARE_4_BYTE_EQUAL(a, b) \ + ((a)[0] == (b)[0] && (a)[1] == (b)[1] && (a)[2] == (b)[2] && \ + (a)[3] == (b)[3] && (a)[4] == (b)[4]) +#define IN6_ARE_ADDR_EQUAL(a, b) \ + __ARE_4_BYTE_EQUAL((const uint32_t *)(a), (const uint32_t *)(b)) + #define IN6_IS_ADDR_V4COMPAT 7 #define IN6_IS_ADDR_MC_NODELOCAL 8 #define IN6_IS_ADDR_MC_LINKLOCAL 9
py/dynruntime.h: Make mp_obj_str_get_str raise if arg not a str/bytes.
@@ -114,7 +114,7 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) { #define mp_obj_cast_to_native_base(o, t) (mp_obj_cast_to_native_base_dyn((o), (t))) #define mp_obj_get_int(o) (mp_fun_table.native_from_obj(o, MP_NATIVE_TYPE_INT)) #define mp_obj_get_int_truncated(o) (mp_fun_table.native_from_obj(o, MP_NATIVE_TYPE_UINT)) -#define mp_obj_str_get_str(s) ((void *)mp_fun_table.native_from_obj(s, MP_NATIVE_TYPE_PTR)) +#define mp_obj_str_get_str(s) (mp_obj_str_get_data_dyn((s), NULL)) #define mp_obj_str_get_data(o, len) (mp_obj_str_get_data_dyn((o), (len))) #define mp_get_buffer_raise(o, bufinfo, fl) (mp_fun_table.get_buffer_raise((o), (bufinfo), (fl))) #define mp_get_stream_raise(s, flags) (mp_fun_table.get_stream_raise((s), (flags))) @@ -149,7 +149,9 @@ static inline mp_obj_t mp_obj_cast_to_native_base_dyn(mp_obj_t self_in, mp_const static inline void *mp_obj_str_get_data_dyn(mp_obj_t o, size_t *l) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(o, &bufinfo, MP_BUFFER_READ); + if (l != NULL) { *l = bufinfo.len; + } return bufinfo.buf; }
intr_alloc: Fixed missing portEXIT_CRITICAL_SAFE Closes Updated commit message]
@@ -801,6 +801,7 @@ esp_err_t IRAM_ATTR esp_intr_enable(intr_handle_t handle) } else { //Re-enable using cpu int ena reg if (handle->vector_desc->cpu != esp_cpu_get_core_id()) { + portEXIT_CRITICAL_SAFE(&spinlock); return ESP_ERR_INVALID_ARG; //Can only enable these ints on this cpu } ESP_INTR_ENABLE(handle->vector_desc->intno);
npu2: Fix typo in message Correct "procuedure" -> "procedure".
@@ -687,7 +687,7 @@ static int64_t npu_dev_procedure_write(struct npu2_dev *dev, uint32_t offset, name = npu_procedures[data]->name; if (dev->procedure_number == data && !(dev->procedure_status & PROCEDURE_COMPLETE)) - NPU2DEVINF(dev, "Restarting procuedure %s\n", name); + NPU2DEVINF(dev, "Restarting procedure %s\n", name); else NPU2DEVINF(dev, "Starting procedure %s\n", name);
sdl: syswm.go: Add missing SYSWM_WINRT, SYSWM_ANDROID, and SYSWM_VIVANTE subsystem flags
@@ -13,6 +13,21 @@ package sdl #define SDL_SYSWM_WAYLAND SDL_SYSWM_UNKNOWN #define SDL_SYSWM_MIR SDL_SYSWM_UNKNOWN #endif + +#if !(SDL_VERSION_ATLEAST(2,0,3)) +#pragma message("SDL_SYSWM_WINRT is not supported before SDL 2.0.3") +#define SDL_SYSWM_WINRT (0) +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,4)) +#pragma message("SDL_SYSWM_ANDROID is not supported before SDL 2.0.4") +#define SDL_SYSWM_ANDROID (0) +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,5)) +#pragma message("SDL_SYSWM_VIVANTE is not supported before SDL 2.0.5") +#define SDL_SYSWM_VIVANTE (0) +#endif */ import "C" import "unsafe" @@ -27,6 +42,9 @@ const ( SYSWM_UIKIT = C.SDL_SYSWM_UIKIT // Apple iOS SYSWM_WAYLAND = C.SDL_SYSWM_WAYLAND // Wayland (>= SDL 2.0.2) SYSWM_MIR = C.SDL_SYSWM_MIR // Mir (>= SDL 2.0.2) + SYSWM_WINRT = C.SDL_SYSWM_WINRT // WinRT (>= SDL 2.0.3) + SYSWM_ANDROID = C.SDL_SYSWM_ANDROID // Android (>= SDL 2.0.4) + SYSWM_VIVANTE = C.SDL_SYSWM_VIVANTE // Vivante (>= SDL 2.0.5) ) // SysWMInfo contains system-dependent information about a window.
generate_spir_wrapper.py: update documentation
#!/usr/bin/python3 # -# A script to generate functions (SPIR-mangled with SPIR AS) that will call -# target-specific kernel library functions (with OpenCL-mangled names and AS). +# A script to generate wrapping functions (SPIR-mangled with SPIR AS) that will wrap +# calls to target-specific kernel library functions (with OpenCL-mangled names and AS). # -# e.g. _Z5frexpfPU3AS3i(float %x, i32 addrspace(1)* %y) +# e.g. with x86-64 CPU target, +# _Z5frexpfPU3AS3i(float %x, i32 addrspace(1)* %y) # would call # _Z9_cl_frexpfPU7CLlocali(float %x, i32 * %1) # -# output is LLVM IR text format +# output is LLVM IR text format. # -# Usage: python3 generate_spir_wrapper.py >POCL_DIR/lib/kernel/spir_wrapper.ll +# Usage: python3 generate_spir_wrapper.py >spir_wrapper.ll +# ... rename & place the file in the target-specific lib/kernel subdirectory. # # Notes for CPU SPIR wrapper: # 1) this expects the target kernel library to have a single AS (the default); # it inserts addrspace casts. -# 2) almost all vector variants of OpenCL functions are ignored -# 3) some library functions are missing (geometric) -# 4) target kernel library is expected to prefix functions. This is required +# 2) the X86-64 ABI complicates things by coercing arguments and byval passing, +# which means we need different wrappers for different CPU groups +# (depending on largest register size available) +# 3) target kernel library is expected to prefix functions. This is required # even if the mangled names are the same, because the calling conv # is different for SPIR and some LLVM pass will remove the calls # with mismatched calling conv. # 2) address space casting is not required for CUDA # 3) prefixing and SPIR calling convention are still required # -# set the boolean variables below to correct values before calling +# set the boolean variables below to correct values before calling this script import sys
matched filter example: "hM3" -> "hm3"
@@ -17,7 +17,7 @@ void usage() { printf("matched_filter_example options:\n"); printf(" u/h : print usage/help\n"); - printf(" t : filter type: [rrcos], rkaiser, arkaiser, hM3, gmsk, fexp, fsech, farcsech\n"); + printf(" t : filter type: [rrcos], rkaiser, arkaiser, hm3, gmsk, fexp, fsech, farcsech\n"); printf(" k : filter samples/symbol, k >= 2, default: 2\n"); printf(" m : filter delay (symbols), m >= 1, default: 3\n"); printf(" b : filter excess bandwidth factor, 0 < b < 1, default: 0.5\n");
Python: typo fixed in string processing shortcut.
@@ -437,8 +437,8 @@ nxt_python_run(nxt_task_t *task, nxt_app_rmsg_t *rmsg, nxt_app_wmsg_t *wmsg) /* Shortcut: avoid iterate over result string symbols. */ if (PyBytes_Check(result) != 0) { - size = PyBytes_GET_SIZE(item); - buf = (u_char *) PyBytes_AS_STRING(item); + size = PyBytes_GET_SIZE(result); + buf = (u_char *) PyBytes_AS_STRING(result); nxt_python_write(&run_ctx, buf, size, 1, 1);
Fix pointer incorrect pointer manipulation that happened to work on a x86-64
#include "state.h" #include "vector.h" #include "gc.h" +#include "fiber.h" typedef struct { jmp_buf err; @@ -261,9 +262,9 @@ static void marshal_one_fiber(MarshalState *st, JanetFiber *fiber, int flags) { while (i > 0) { JanetStackFrame *frame = (JanetStackFrame *)(fiber->data + i - JANET_FRAME_SIZE); if (frame->env) frame->flags |= JANET_STACKFRAME_HASENV; + if (!frame->func) longjmp(st->err, MR_C_STACKFRAME); pushint(st, frame->flags); pushint(st, frame->prevframe); - if (!frame->func) longjmp(st->err, MR_C_STACKFRAME); int32_t pcdiff = frame->pc - frame->func->def->bytecode; pushint(st, pcdiff); marshal_one(st, janet_wrap_function(frame->func), flags + 1); @@ -769,6 +770,8 @@ static const uint8_t *unmarshal_one_fiber( fiber->stackstart = 0; fiber->stacktop = 0; fiber->capacity = 0; + fiber->maxstack = 0; + fiber->data = NULL; fiber->child = NULL; /* Set frame later so fiber can be GCed at anytime if unmarshaling fails */ @@ -802,8 +805,8 @@ static const uint8_t *unmarshal_one_fiber( stack = frame; stacktop = fiber->stackstart - JANET_FRAME_SIZE; while (stack > 0) { - JanetFunction *func; - JanetFuncDef *def; + JanetFunction *func = NULL; + JanetFuncDef *def = NULL; JanetFuncEnv *env = NULL; int32_t frameflags = readint(st, &data); int32_t prevframe = readint(st, &data); @@ -811,7 +814,7 @@ static const uint8_t *unmarshal_one_fiber( /* Get frame items */ Janet *framestack = fiber->data + stack; - JanetStackFrame *framep = (JanetStackFrame *)framestack - 1; + JanetStackFrame *framep = janet_stack_frame(framestack); /* Get function */ Janet funcv;
clay: allow numbers in +segments
|= suffix=@tas ^- (list path) =/ parser - (most hep (cook crip ;~(plug low (star ;~(pose low nud))))) + (most hep (cook crip ;~(plug ;~(pose low nud) (star ;~(pose low nud))))) =/ torn=(list @tas) (fall (rush suffix parser) ~[suffix]) %- flop |- ^- (list (list @tas))
Add timeout to udp multicast join tests This is one way to close With the default settings of firewalld (used by Fedora, RHEL, etc), incoming messages from multicast IPs are dropped, meaning that the multicast test will hang forever. This introduces a 1 second timeout, after which the test will fail.
@@ -174,6 +174,8 @@ return require('lib/tap')(function (test) local function multicast_join_test(bind_addr, multicast_addr, interface_addr) return function(print, p, expect, uv) local uvVersionGEQ = require('lib/utils').uvVersionGEQ + local timeout = uv.new_timer() + local TIMEOUT_TIME = 1000 local server = assert(uv.new_udp()) assert(uv.udp_bind(server, bind_addr, TEST_PORT)) @@ -181,6 +183,7 @@ return require('lib/tap')(function (test) if errname == "ENODEV" then print("no multicast route, skipping") server:close() + timeout:close() return elseif errname == "EADDRNOTAVAIL" and multicast_addr == "ff02::1" then -- OSX, BSDs, and some other platforms need %lo in their multicast/interface addr @@ -212,6 +215,7 @@ return require('lib/tap')(function (test) -- note: because of this conditional close, the test will fail with an unclosed handle if recv_cb_called -- doesn't hit 2, so we don't need to expect(recv_cb) or assert recv_cb_called == 2 server:close() + timeout:close() else -- udp_set_source_membership added in 1.32.0 if uvVersionGEQ("1.32.0") then @@ -247,10 +251,20 @@ return require('lib/tap')(function (test) print("send to multicast ip was likely denied by firewall, skipping") client:close() server:close() + timeout:close() return end assert(not err, err) end))) + + -- some firewalls might reject incoming messages from multicast IPs, + -- so we need a timeout to avoid hanging forever in that scenario + timeout:start(TIMEOUT_TIME, 0, expect(function() + print("timeout (could be caused by firewall settings)") + client:close() + server:close() + timeout:close() + end, 0)) end end
Aligned GIC examples in documentation
@@ -636,8 +636,12 @@ For ARM GIC the default implementation looks like the following example: int32_t IRQ_SetPriorityGroupBits (uint32_t bits) { int32_t status; + if (bits == IRQ_PRIORITY_Msk) { + bits = 7U; + } + if (bits < 8U) { - GIC_SetBinaryPoint (bits); + GIC_SetBinaryPoint (7U - bits); status = 0; } else { status = -1; @@ -660,7 +664,11 @@ For ARM GIC the default implementation looks like the following example: \code uint32_t IRQ_GetPriorityGroupBits (void) { - return (GIC_GetBinaryPoint() & 0x07U); + uint32_t bp; + + bp = GIC_GetBinaryPoint() & 0x07U; + + return (7U - bp); } \endcode */
Fixed possible crash when decoding invalid data When trying to decode invalid data, it frees the buffer but doesn't nil it so the caller gets a junk memory pointer which they could potentially double free.
@@ -299,6 +299,7 @@ libssh2_base64_decode(LIBSSH2_SESSION *session, char **data, /* Invalid -- We have a byte which belongs exclusively to a partial octet */ LIBSSH2_FREE(session, *data); + *data = NULL; return _libssh2_error(session, LIBSSH2_ERROR_INVAL, "Invalid base64"); }
* Removed `JAVA_AWT_INCLUDE_PATH` from FindJNI.cmake
@@ -41,8 +41,6 @@ The following cache variables are also available to set or use: the include path to jni.h ``JAVA_INCLUDE_PATH2`` the include path to jni_md.h and jniport.h -``JAVA_AWT_INCLUDE_PATH`` - the include path to jawt.h #]=======================================================================] # Expand {libarch} occurrences to java_libarch subdirectory(-ies) and set ${_var} @@ -376,10 +374,6 @@ find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h ${JAVA_INCLUDE_PATH}/aix ) -find_path(JAVA_AWT_INCLUDE_PATH jawt.h - ${JAVA_INCLUDE_PATH} -) - # Restore CMAKE_FIND_FRAMEWORK if(DEFINED _JNI_CMAKE_FIND_FRAMEWORK) set(CMAKE_FIND_FRAMEWORK ${_JNI_CMAKE_FIND_FRAMEWORK}) @@ -398,7 +392,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY mark_as_advanced( JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY - JAVA_AWT_INCLUDE_PATH JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 ) @@ -411,5 +404,4 @@ set(JNI_LIBRARIES set(JNI_INCLUDE_DIRS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} - ${JAVA_AWT_INCLUDE_PATH} )
Remove third argument passed to run_client in compat.sh The argument passed to translate_ciphers.py is calculated from $1 in run_client instead of passed as third argument.
@@ -800,8 +800,11 @@ run_client() { LEN=$(( 72 - `echo "$TITLE" | wc -c` )) for i in `seq 1 $LEN`; do printf '.'; done; printf ' ' + # Calculate the argument $c to pass to translate_ciphers.py + client=$(echo $1 | head -c1) + c=$(echo $client | tr '[:upper:]' '[:lower:]') # Translate ciphersuite names based on client's naming convention - t_cipher=$(./scripts/translate_ciphers.py $3 $2) + t_cipher=$(./scripts/translate_ciphers.py $c $2) check_translation $? "$t_cipher" # should we skip? @@ -1027,7 +1030,7 @@ for VERIFY in $VERIFIES; do start_server "OpenSSL" for i in $M_CIPHERS; do check_openssl_server_bug $i - run_client mbedTLS $i m + run_client mbedTLS $i done stop_server fi @@ -1035,7 +1038,7 @@ for VERIFY in $VERIFIES; do if [ "X" != "X$O_CIPHERS" ]; then start_server "mbedTLS" for i in $O_CIPHERS; do - run_client OpenSSL $i o + run_client OpenSSL $i done stop_server fi @@ -1052,7 +1055,7 @@ for VERIFY in $VERIFIES; do if [ "X" != "X$M_CIPHERS" ]; then start_server "GnuTLS" for i in $M_CIPHERS; do - run_client mbedTLS $i m + run_client mbedTLS $i done stop_server fi @@ -1060,7 +1063,7 @@ for VERIFY in $VERIFIES; do if [ "X" != "X$G_CIPHERS" ]; then start_server "mbedTLS" for i in $G_CIPHERS; do - run_client GnuTLS $i g + run_client GnuTLS $i done stop_server fi @@ -1079,7 +1082,7 @@ for VERIFY in $VERIFIES; do if [ "X" != "X$M_CIPHERS" ]; then start_server "mbedTLS" for i in $M_CIPHERS; do - run_client mbedTLS $i m + run_client mbedTLS $i done stop_server fi
docs: update wear levelling cn trans
@@ -5,6 +5,7 @@ Wear Levelling API Overview -------- + Most of flash memory and especially SPI flash that is used in {IDF_TARGET_NAME} has a sector-based organization and also has a limited number of erase/modification cycles per memory sector. The wear levelling component helps to distribute wear and tear among sectors more evenly without requiring any attention from the user. The wear levelling component provides API functions related to reading, writing, erasing, and memory mapping of data in external SPI flash through the partition component. The component also has higher-level API functions which work with the FAT filesystem defined in :doc:`FAT filesystem </api-reference/storage/fatfs>`. @@ -17,12 +18,12 @@ To save internal memory, the component has two additional modes which both use s - **Safety mode.** The data is first saved to flash memory, and after the sector is erased, the data is saved back. If a device is powered off, the data can be recovered as soon as the device boots up. The default settings are as follows: + - Sector size is 512 bytes - Performance mode You can change the settings through the configuration menu. - The wear levelling component does not cache data in RAM. The write and erase functions modify flash directly, and flash contents are consistent when the function returns. @@ -46,4 +47,3 @@ Memory Size ----------- The memory size is calculated in the wear levelling module based on partition parameters. The module uses some sectors of flash for internal data. -
examples/nxflat: fixed an issue with the symbol table creation (#3737#issuecomment-844574935)
@@ -90,7 +90,7 @@ $(DIRLIST_SRC): install # Create the exported symbol table list from the derived *-thunk.S files $(SYMTAB_SRC): install - $(Q) $(APPDIR)/tools/mksymtab.sh $(ROMFS_DIR) g_nxflat >[email protected] + $(Q) $(APPDIR)/tools/mksymtab.sh $(TESTS_DIR) g_nxflat >[email protected] $(Q) $(call TESTANDREPLACEFILE, [email protected], $@) # Clean each subdirectory
Remove TLSv1.3 specific write transition for ClientHello Since we no longer do version negotiation during the processing of an HRR we do not need the TLSv1.3 specific write transition for ClientHello
@@ -391,10 +391,6 @@ static WRITE_TRAN ossl_statem_client13_write_transition(SSL *s) ERR_R_INTERNAL_ERROR); return WRITE_TRAN_ERROR; - case TLS_ST_CW_CLNT_HELLO: - /* We only hit this in the case of HelloRetryRequest */ - return WRITE_TRAN_FINISHED; - case TLS_ST_CR_FINISHED: if (s->early_data_state == SSL_EARLY_DATA_WRITE_RETRY || s->early_data_state == SSL_EARLY_DATA_FINISHED_WRITING)
Utilities: Set 3GB allocation pool limit for TestDiskImage
#include <Library/DebugLib.h> #include <UserFile.h> +#include <UserMemory.h> #define NUM_EXTENTS 20 @@ -35,6 +36,11 @@ ENTRY_POINT ( UINT32 Index2; OC_APPLE_CHUNKLIST_CONTEXT ChunklistContext; + // + // Limit pool allocation size to 3072 MB + // + SetPoolAllocationSizeLimit (BASE_1GB | BASE_2GB); + if (argc < 2) { DEBUG ((DEBUG_ERROR, "Please provide a valid Disk Image path\n")); return -1;
Ignore `REX.X` for `RM`-encoded `BND` registers
@@ -4457,7 +4457,7 @@ static ZyanStatus ZydisCheckErrorConditions(ZydisDecoderContext* context, case ZYDIS_REG_CONSTRAINTS_MASK: break; case ZYDIS_REG_CONSTRAINTS_BND: - if (context->cache.B || context->cache.X || instruction->raw.modrm.rm > 3) + if (context->cache.B || instruction->raw.modrm.rm > 3) { return ZYDIS_STATUS_BAD_REGISTER; }
[catboost/java] use `sys.executable` when launching `ya` as subprocess
@@ -85,10 +85,8 @@ def _main(): print('building dynamic library with `ya`', file=sys.stderr) sys.stderr.flush() - # TODO(yazevnul): maybe replace `python` with `sys.executable`? - ya_tool = [ya_path] if _get_platform() != 'win32' else ['python', ya_path] with _tempdir(prefix='catboost_build-') as build_output_dir: - ya_make = ya_tool + ['make'] + sys.argv[1:] + [native_lib_dir, '--output', build_output_dir] + ya_make = [sys.executable, ya_path, 'make'] + sys.argv[1:] + [native_lib_dir, '--output', build_output_dir] subprocess.check_call( ya_make, env=env,
ds json UPDATE do not set user/group of backups The process performing the back up may not have permissions to use the original owner/group. Setting the original permissions should be secure enough. Fixes
@@ -84,22 +84,14 @@ srpds_json_store_(const struct lys_module *mod, sr_datastore_t ds, const struct goto cleanup; } - /* create backup file with same owner/group/perm */ + /* create backup file with same permissions (not owner/group because it may be different and this process + * not has permissions to use that owner/group) */ if ((fd = srpjson_open(bck_path, O_WRONLY | O_CREAT | O_EXCL, st.st_mode)) == -1) { SRPLG_LOG_ERR(srpds_name, "Opening \"%s\" failed (%s).", bck_path, strerror(errno)); rc = SR_ERR_SYS; goto cleanup; } backup = 1; - if (fchown(fd, st.st_uid, st.st_gid) == -1) { - SRPLG_LOG_ERR(srpds_name, "Changing owner of \"%s\" failed (%s).", bck_path, strerror(errno)); - if ((errno == EACCES) || (errno == EPERM)) { - rc = SR_ERR_UNAUTHORIZED; - } else { - rc = SR_ERR_INTERNAL; - } - goto cleanup; - } /* close */ close(fd);
pkg/gadgets/test: Add TestEventEnrichmentRaceCondition Add a test to verify that the events are enriched even if the container is removed right after the event is generated.
@@ -176,3 +176,74 @@ func TestContainerRemovalRaceCondition(t *testing.T) { t.Fatalf("failed generating events: %s", err) } } + +// TestEventEnrichmentRaceCondition checks that an event is properly enriched when the generating +// container is removed soon after it generates the event. +// https://github.com/inspektor-gadget/inspektor-gadget/issues/1178 +func TestEventEnrichmentRaceCondition(t *testing.T) { + t.Parallel() + + utilstest.RequireRoot(t) + + const ( + traceName = "trace_exec" + containerName = "foo" + command = "cat" + ) + + eventCallback := func(event *types.Event) { + if event.Container == "" { + t.Fatal("event not enriched") + } + } + + cc := createTestEnv(t, traceName, containerName, eventCallback) + + const n = 1000 + + errs, _ := errgroup.WithContext(context.TODO()) + + runContainerTest := func( + cc *containercollection.ContainerCollection, + name string, + f func() error, + iterations int, + ) error { + for i := 0; i < iterations; i++ { + r, err := utilstest.NewRunner(&utilstest.RunnerConfig{}) + if err != nil { + return fmt.Errorf("failed to create runner: %w", err) + } + + container := &containercollection.Container{ + ID: uuid.New().String(), + Name: name, + Mntns: r.Info.MountNsID, + Pid: uint32(r.Info.Tid), + } + + cc.AddContainer(container) + // Remove the container right after it generates the command. Running this + // after r.Run() will be too late, so let's do in a different goroutine to + // have some time. + go func() { cc.RemoveContainer(container.ID) }() + + if err := r.Run(f); err != nil { + return fmt.Errorf("failed to run command: %w", err) + } + + r.Close() + } + + return nil + } + + errs.Go(func() error { + catDevNull := func() error { return generateEvent(command) } + return runContainerTest(cc, containerName, catDevNull, n) + }) + + if err := errs.Wait(); err != nil { + t.Fatalf("failed generating events: %s", err) + } +}
Support 30MiB payloads - VCU118 FPGA
#define DEBUG #include "kprintf.h" -#define MAX_CORES 8 - -// A sector is 512 bytes, so ((1 << 11) * 512) = 1 MiB -#define PAYLOAD_SIZE (16 << 11) +// Total payload in B +#define PAYLOAD_SIZE_B (30 << 20) // default: 30MiB +// A sector is 512 bytes, so (1 << 11) * 512B = 1 MiB +#define SECTOR_SIZE_B 512 +// Payload size in # of sectors +#define PAYLOAD_SIZE (PAYLOAD_SIZE_B / SECTOR_SIZE_B) // The sector at which the BBL partition starts #define BBL_PARTITION_START_SECTOR 34 @@ -168,9 +170,12 @@ static int copy(void) int rc = 0; dputs("CMD18"); + + kprintf("LOADING 0x%lxB PAYLOAD\r\n", PAYLOAD_SIZE_B); kprintf("LOADING "); - // John: Let's go slow until we get this working + // TODO: Can this be sped up? + // John Wright: Let's go slow until we get this working //REG32(spi, SPI_REG_SCKDIV) = (F_CLK / 16666666UL); REG32(spi, SPI_REG_SCKDIV) = (F_CLK / 5000000UL); if (sd_cmd(0x52, BBL_PARTITION_START_SECTOR, 0xE1) != 0x00) { @@ -182,7 +187,7 @@ static int copy(void) long n; crc = 0; - n = 512; + n = SECTOR_SIZE_B; while (sd_dummy() != 0xFE); do { uint8_t x = sd_dummy();
ECDSA_* is deprecated. EC_KEY_* is used instead CLA: trivial
@@ -11,7 +11,7 @@ X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, X509_STORE_CTX_get_ DH_get_ex_new_index, DH_set_ex_data, DH_get_ex_data, DSA_get_ex_new_index, DSA_set_ex_data, DSA_get_ex_data, ECDH_get_ex_new_index, ECDH_set_ex_data, ECDH_get_ex_data, -ECDSA_get_ex_new_index, ECDSA_set_ex_data, ECDSA_get_ex_data, +EC_KEY_get_ex_new_index, EC_KEY_set_ex_data, EC_KEY_get_ex_data, RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - application-specific data
Temporary scrypt hashrate hack
@@ -404,6 +404,9 @@ namespace MiningCore.Blockchain.Bitcoin if ((poolConfig.Coin.Type == CoinType.XVG && poolConfig.Coin.Algorithm.ToLower() == "x17")) result *= 2.55; + if ((poolConfig.Coin.Algorithm.ToLower() == "scrypt")) + result *= 1.5; + return result; }
feat(specs-gen): improve flexibility by add -i opt for including N amount of dependency headers
static void print_usage(char *prog) { fprintf(stderr, - "Usage: %s [-h|-c|-d|-f] -o output-file input-file\n" + "Usage: %s [-h|-c|-d|-f] -o output-file -i include-headers input-file \n" " -h generate header\n" " -c generate data and function definitions\n" " -d generate data and function declarations\n" @@ -35,9 +35,10 @@ int main(int argc, char **argv) }; char *open_mode = "w"; + NTL_T(name_t) incl_headers = NULL; int opt; - while (-1 != (opt = getopt(argc, argv, "ahcdfSEFOo:"))) { + while (-1 != (opt = getopt(argc, argv, "ahcdfSEFOo:i:"))) { switch (opt) { case 'a': open_mode = "a"; @@ -45,6 +46,9 @@ int main(int argc, char **argv) case 'o': config_file = strdup(optarg); break; + case 'i': + ntl_append2((ntl_t*)&incl_headers, sizeof(name_t), optarg); + break; case 'h': eo.type = FILE_HEADER; break; @@ -87,6 +91,7 @@ int main(int argc, char **argv) memset(&d, 0, sizeof(d)); definition_from_json(s, len, &d); d.spec_name = file; + d.incl_headers = incl_headers; gen_definition(config_file, open_mode, &eo, &d); return EXIT_SUCCESS;
[snitch] Remove FPU traces generation from MemPool CC
@@ -255,8 +255,8 @@ module mempool_cc #( "acc_pid": i_snitch.acc_pid_i, "acc_pdata_32": i_snitch.acc_pdata_i[31:0], // FPU offload - "fpu_offload": (i_snitch.acc_qready_i && i_snitch.acc_qvalid_o && !snitch_pkg::shared_offload(i_snitch.acc_qdata_op_o)), - "is_seq_insn": (i_snitch.inst_data_i ==? riscv_instr::FREP) + "fpu_offload": 1'b0, + "is_seq_insn": 1'b0 }; task fmt_extras (
Fix GROUP/IN-GROUP tag error handling (-1 is not the value returned by ippTagValue for an unknown tag...)
@@ -1618,7 +1618,7 @@ do_tests(cups_file_t *outfile, /* I - Output file */ goto test_exit; } - if ((value = ippTagValue(token)) < 0) + if ((value = ippTagValue(token)) == IPP_TAG_ZERO || value >= IPP_TAG_UNSUPPORTED_VALUE) { print_fatal_error(outfile, "Bad GROUP tag \"%s\" on line %d.", token, linenum); pass = 0; @@ -2214,7 +2214,7 @@ do_tests(cups_file_t *outfile, /* I - Output file */ goto test_exit; } - if ((in_group = ippTagValue(token)) == (ipp_tag_t)-1 || in_group >= IPP_TAG_UNSUPPORTED_VALUE) + if ((in_group = ippTagValue(token)) == IPP_TAG_ZERO || in_group >= IPP_TAG_UNSUPPORTED_VALUE) { print_fatal_error(outfile, "Bad IN-GROUP group tag \"%s\" on line %d.", token, linenum); pass = 0;
bump hdf5 to v1.8.18
@@ -63,7 +63,7 @@ BuildRequires: intel_licenses Summary: A general purpose library and file format for storing scientific data Name: %{pname}-%{compiler_family}%{PROJ_DELIM} -Version: 1.8.17 +Version: 1.8.18 Release: 1 License: Hierarchical Data Format (HDF) Software Library and Utilities License Group: %{PROJ_NAME}/io-libs
[core] avoid freeaddrinfo() on NULL ptr (fixes getaddrinfo() should return non-empty result list (res) or else should return EAI_NONAME or some other error (musl C library does not check for NULL argument to freeaddrinfo()) x-ref: "Segmentation fault in mod_extforward with libmusl"
@@ -594,11 +594,12 @@ int sock_addr_from_str_numeric(server *srv, sock_addr *saddr, const char *str) log_error_write(srv, __FILE__, __LINE__, "SSSs(S)", "could not parse ip address ", str, " because ", gai_strerror(result), strerror(errno)); + return result; } else if (addrlist == NULL) { log_error_write(srv, __FILE__, __LINE__, "SSS", "Problem in parsing ip address ", str, ": succeeded, but no information returned"); - result = -1; + return -1; } else switch (addrlist->ai_family) { case AF_INET: memcpy(&saddr->ipv4, addrlist->ai_addr, sizeof(saddr->ipv4));
overlay shows on all tags and doesn't trigger indicators
@@ -447,7 +447,7 @@ void showoverlay(){ selmon->overlaystatus = 1; Client *c = selmon->overlay; - selmon->overlay->tags = selmon->tagset[selmon->seltags]; + selmon->overlay->tags = ~0 & TAGMASK; focus(c); if (!c->isfloating) { @@ -1208,6 +1208,8 @@ drawbar(Monitor *m) resizebarwin(m); for (c = m->clients; c; c = c->next) { + if (c == selmon->overlay) + continue; if (ISVISIBLE(c)) n++; occ |= c->tags == 255 ? 0 : c->tags;
Add missing separator to package builds
@@ -215,7 +215,7 @@ if(PACKAGE) set(PKG_VER ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}) - set(CPACK_PACKAGE_FILE_NAME "astcenc-${PKG_VER}-${PKG_OS}${PACKAGE}") + set(CPACK_PACKAGE_FILE_NAME "astcenc-${PKG_VER}-${PKG_OS}-${PACKAGE}") set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE) set(CPACK_PACKAGE_CHECKSUM SHA256) set(CPACK_GENERATOR ZIP)
Work CD-CI Update step to process only files in the push commit. ***NO_CI***
-name: "Auto clang-format" +name: "Auto format source code" on: push: + branches: + - "develop" + - "master" + - "release/*" + paths-ignore: - '*.md' - '*/*.md' @@ -13,7 +18,7 @@ on: jobs: format: - name: "Auto clang-format" + name: "Format source code files" runs-on: ubuntu-latest @@ -29,8 +34,10 @@ jobs: - name: "Format source files" run: | - SRC=$(git ls-tree --full-tree -r HEAD | grep -e "\.\(c\|h\|hpp\|cpp\)\$" | cut -f 2) + SRC=$(git diff --name-only --diff-filter=d $(git merge-base HEAD HEAD~1) | grep -e "\.\(c\|h\|hpp\|cpp\)\$" | cut -f 2) + if [ -n "$SRC" ]; then clang-format-10 -i -style=file $SRC + fi - name: Commit files run: |
Avoid using sleep_for on Windows
@@ -608,6 +608,7 @@ void StressUploadLockMultiThreaded(ILogConfiguration& config) while (numIterations--) { + ILogger *result = LogManager::Initialize(TEST_TOKEN, config); // Keep spawning UploadNow threads while the main thread is trying to perform Initialize and Teardown while (threadCount++ < MAX_THREADS) { @@ -615,13 +616,16 @@ void StressUploadLockMultiThreaded(ILogConfiguration& config) { std::this_thread::yield(); LogManager::UploadNow(); - const auto randTimeSub2ms = std::chrono::milliseconds(std::rand() % 2); - std::this_thread::sleep_for(randTimeSub2ms); + const auto randTimeSub2ms = std::rand() % 2; + // I believe we might be hitting an issue with std::this_thread::sleep_for on Windows with msvc++ runtime + // Ref.: + // https://developercommunity.visualstudio.com/content/problem/58530/bogus-stdthis-threadsleep-for-implementation.html + // The solution for Win32 is that PAL::sleep uses Win32 API instead of C++11 sleep. + PAL::sleep(randTimeSub2ms); threadCount--; }); t.detach(); }; - ILogger *result = LogManager::Initialize(TEST_TOKEN, config); EventProperties props = CreateSampleEvent("event_name", EventPriority_Normal); result->LogEvent(props); LogManager::FlushAndTeardown();
perfserver: Allow incoming unidirectional streams
@@ -549,7 +549,7 @@ int Handler::init(const Endpoint &ep, const sockaddr *sa, socklen_t salen, params.initial_max_stream_data_uni = config.max_stream_data_uni; params.initial_max_data = config.max_data; params.initial_max_streams_bidi = config.max_streams_bidi; - params.initial_max_streams_uni = 0; + params.initial_max_streams_uni = config.max_streams_uni; params.max_idle_timeout = config.timeout; params.stateless_reset_token_present = 1; params.active_connection_id_limit = 7; @@ -970,7 +970,8 @@ int Handler::recv_stream_data(uint32_t flags, int64_t stream_id, } auto it = streams_.find(stream_id); - assert(it != std::end(streams_)); + if (it != std::end(streams_)) { + assert(ngtcp2_is_bidi_stream(stream_id)); auto &stream = (*it).second; if (stream->datalen != stream->data.size()) { @@ -993,6 +994,9 @@ int Handler::recv_stream_data(uint32_t flags, int64_t stream_id, stream->start_response(); } } + } else { + assert(!ngtcp2_is_bidi_stream(stream_id)); + } ngtcp2_conn_extend_max_stream_offset(conn_, stream_id, datalen); ngtcp2_conn_extend_max_offset(conn_, datalen); @@ -1050,16 +1054,23 @@ int Handler::on_stream_close(int64_t stream_id, uint64_t app_error_code) { } auto it = streams_.find(stream_id); - assert(it != std::end(streams_)); + if (it != std::end(streams_)) { + assert(ngtcp2_is_bidi_stream(stream_id)); auto &stream = (*it).second; sendq_.erase(stream.get()); streams_.erase(it); + } else { + assert(!ngtcp2_is_bidi_stream(stream_id)); + } - if (ngtcp2_is_bidi_stream(stream_id)) { assert(!ngtcp2_conn_is_local_stream(conn_, stream_id)); + + if (ngtcp2_is_bidi_stream(stream_id)) { ngtcp2_conn_extend_max_streams_bidi(conn_, 1); + } else { + ngtcp2_conn_extend_max_streams_uni(conn_, 1); } return 0; @@ -2247,7 +2258,7 @@ void config_set_default(Config &config) { config.max_stream_data_bidi_remote = 256_k; config.max_stream_data_uni = 256_k; config.max_streams_bidi = 100; - config.max_streams_uni = 3; + config.max_streams_uni = 100; config.max_dyn_length = 20_m; config.cc = "cubic"sv; config.initial_rtt = NGTCP2_DEFAULT_INITIAL_RTT;
Added macOS Catalina to the list of OSX codenames. Closes
@@ -205,7 +205,9 @@ get_real_win (const char *win) static char * get_real_mac_osx (const char *osx) { - if (strstr (osx, "10.14")) + if (strstr (osx, "10.15")) + return alloc_string ("macOS 10.14 Catalina"); + else if (strstr (osx, "10.14")) return alloc_string ("macOS 10.14 Mojave"); else if (strstr (osx, "10.13")) return alloc_string ("macOS 10.13 High Sierra");
Add ksceSysconCtrlDolceLED
@@ -22,6 +22,7 @@ modules: ksceSysconCommitConfigstorageTransaction: 0x7B9B3617 ksceSysconCtrlAccPower: 0x8D1D97E8 ksceSysconCtrlDeviceReset: 0x40FF3898 + ksceSysconCtrlDolceLED: 0x727F985A ksceSysconCtrlHdmiCecPower: 0x62155962 ksceSysconCtrlHostOutputViaDongle: 0xDECCB2B4 ksceSysconCtrlLED: 0x04EC7579
Tests: leave unit.log in case of error or failure.
@@ -25,11 +25,31 @@ class TestUnit(unittest.TestCase): def tearDown(self): self.stop() + # detect errors and failures for current test + + def list2reason(exc_list): + if exc_list and exc_list[-1][0] is self: + return exc_list[-1][1] + + if hasattr(self, '_outcome'): + result = self.defaultTestResult() + self._feedErrorsToResult(result, self._outcome.errors) + else: + result = getattr(self, '_outcomeForDoCleanups', + self._resultForDoCleanups) + + success = not list2reason(result.errors) \ + and not list2reason(result.failures) + + # check unit.log for alerts + with open(self.testdir + '/unit.log', 'r', encoding='utf-8', errors='ignore') as f: self._check_alerts(f.read()) - if '--leave' not in sys.argv: + # remove unit.log + + if '--leave' not in sys.argv and success: shutil.rmtree(self.testdir) def check_modules(self, *modules):
looks like some APs do not transmit channel information - detect them, now
@@ -6211,6 +6211,11 @@ for(zeiger = scanlist; zeiger < scanlist +SCANLIST_MAX -1; zeiger++) zeiger->frequency = ptrfscanlist->frequency; zeiger->channel = tags.channel; } + else if(tags.channel == 0) + { + zeiger->frequency = ptrfscanlist->frequency; + zeiger->channel = ptrfscanlist->channel; + } zeiger->timestamp = timestamp; zeiger->count +=1; zeiger->proberesponse +=1; @@ -6231,6 +6236,11 @@ if(tags.channel == ptrfscanlist->channel) zeiger->frequency = ptrfscanlist->frequency; zeiger->channel = tags.channel; } +else if(tags.channel == 0) + { + zeiger->frequency = ptrfscanlist->frequency; + zeiger->channel = ptrfscanlist->channel; + } zeiger->timestamp = timestamp; zeiger->count = 1; zeiger->proberesponse =1; @@ -6271,6 +6281,11 @@ for(zeiger = scanlist; zeiger < scanlist +SCANLIST_MAX -1; zeiger++) zeiger->frequency = ptrfscanlist->frequency; zeiger->channel = tags.channel; } + else if(tags.channel == 0) + { + zeiger->frequency = ptrfscanlist->frequency; + zeiger->channel = ptrfscanlist->channel; + } zeiger->timestamp = timestamp; zeiger->count += 1; zeiger->beacon += 1; @@ -6292,6 +6307,11 @@ if(tags.channel == ptrfscanlist->channel) zeiger->frequency = ptrfscanlist->frequency; zeiger->channel = tags.channel; } +else if(tags.channel == 0) + { + zeiger->frequency = ptrfscanlist->frequency; + zeiger->channel = ptrfscanlist->channel; + } zeiger->timestamp = timestamp; zeiger->count = 1; zeiger->beacon = 1;
invoke-error-key-fix: keyDel doesn't actually decrease refcount, so do it differently
@@ -85,17 +85,17 @@ ElektraInvokeHandle * elektraInvokeOpen (const char * elektraPluginName, KeySet config = ksDup (config); } - if (!errorKey) + int errorKeyMissing = !errorKey; + if (errorKeyMissing) { errorKey = keyNew (0, KEY_END); } - else - { - keyIncRef (errorKey); - } Plugin * plugin = elektraPluginOpen (elektraPluginName, modules, config, errorKey); + if (errorKeyMissing) + { keyDel (errorKey); + } if (!plugin) { elektraModulesClose (modules, NULL); @@ -291,16 +291,16 @@ void elektraInvokeClose (ElektraInvokeHandle * handle, Key * errorKey) { return; } - if (!errorKey) + int errorKeyMissing = !errorKey; + if (errorKeyMissing) { errorKey = keyNew (0, KEY_END); } - else - { - keyIncRef (errorKey); - } elektraPluginClose (handle->plugin, errorKey); + if (errorKeyMissing) + { keyDel (errorKey); + } elektraModulesClose (handle->modules, NULL); ksDel (handle->modules); ksDel (handle->exports);
Improved menu on windows
@@ -133,18 +133,12 @@ const template = [ notifyListeners("section", "build"); } } - - // { type: "separator" }, - // { role: "togglefullscreen" } ] }, { role: "window", submenu: [ - { role: "minimize" }, - { role: "resetzoom" }, - { role: "zoomin" }, - { role: "zoomout" } + { role: "minimize" } ] }, {
DM sample: update uos launch script for virtio rpmb Added virtio-rpmb for launch android Acked-by: Eddie Dong
@@ -274,6 +274,7 @@ fi -s 3,virtio-blk$boot_dev_flag,/data/$5/$5.img \ -s 7,passthru,0/15/0 \ -s 8,passthru,0/15/1 \ + -s 13,virtio-rpmb \ -s 10,virtio-hyper_dmabuf \ -s 11,wdt-i6300esb \ -s 14,passthru,0/e/0 \
Add average functions for fix16 and fix32
@@ -134,7 +134,11 @@ extern const fix16 sqrttab16[0x10000]; * WARNING: result can easily overflow so its recommended to stick with fix16 type for mul and div operations. */ #define fix32Div(val1, val2) (((val1) << (FIX32_FRAC_BITS / 2)) / ((val2) >> (FIX32_FRAC_BITS / 2))) - +/** + * \brief + * Compute and return the result of the average of val1 by val2 (fix32). + */ +#define fix32Avg(val1, val2) (((val1) >> 1) + ((val2) >> 1)) #define FIX16_INT_BITS 10 #define FIX16_FRAC_BITS (16 - FIX16_INT_BITS) @@ -213,7 +217,11 @@ extern const fix16 sqrttab16[0x10000]; * Compute and return the result of the division of val1 by val2 (fix16). */ #define fix16Div(val1, val2) (((val1) << FIX16_FRAC_BITS) / (val2)) - +/** + * \brief + * Compute and return the result of the average of val1 by val2 (fix16). + */ +#define fix16Avg(val1, val2) (((val1) >> 1) + ((val2) >> 1)) /** * \brief
cadillac safety: enforcing index not going outside array size
+#define CADILLAC_TORQUE_MSG_N 4 // 4 torque messages: 0x151, 0x152, 0x153, 0x154 + const int CADILLAC_MAX_STEER = 150; // 1s // real time torque limit to prevent controls spamming // the real time limit is 1500/sec @@ -11,13 +13,14 @@ const int CADILLAC_DRIVER_TORQUE_FACTOR = 4; int cadillac_ign = 0; int cadillac_cruise_engaged_last = 0; int cadillac_rt_torque_last = 0; -int cadillac_desired_torque_last[4] = {0}; // 4 torque messages +const int cadillac_torque_msgs_n = 4; +int cadillac_desired_torque_last[CADILLAC_TORQUE_MSG_N] = {0}; uint32_t cadillac_ts_last = 0; int cadillac_supercruise_on = 0; struct sample_t cadillac_torque_driver; // last few driver torques measured -int cadillac_get_torque_idx(uint32_t addr) { - return addr - 0x151; // 0x151 is id 0, 0x152 is id 1 and so on... +int cadillac_get_torque_idx(uint32_t addr, int array_size) { + return min(max(addr - 0x151, 0), array_size); // 0x151 is id 0, 0x152 is id 1 and so on... } static void cadillac_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) { @@ -62,7 +65,7 @@ static int cadillac_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) { int desired_torque = ((to_send->RDLR & 0x3f) << 8) + ((to_send->RDLR & 0xff00) >> 8); int violation = 0; uint32_t ts = TIM2->CNT; - int idx = cadillac_get_torque_idx(addr); + int idx = cadillac_get_torque_idx(addr, CADILLAC_TORQUE_MSG_N); desired_torque = to_signed(desired_torque, 14); if (controls_allowed) {
use 03 optimization
@@ -1365,7 +1365,7 @@ class GnuCompiler(Compiler): if self.build.is_release: self.c_flags.append('$OPTIMIZE') - self.optimize = '-O2' + self.optimize = '-O3' if self.build.with_ndebug: self.c_defines.append('-DNDEBUG')
Ensure CCS sent before early_data has the correct record version
&& (s)->method->version != TLS_ANY_VERSION) # define SSL_TREAT_AS_TLS13(s) \ - (SSL_IS_TLS13(s) || (s)->early_data_state == SSL_EARLY_DATA_WRITING \ + (SSL_IS_TLS13(s) || (s)->early_data_state == SSL_EARLY_DATA_CONNECTING \ + || (s)->early_data_state == SSL_EARLY_DATA_CONNECT_RETRY \ + || (s)->early_data_state == SSL_EARLY_DATA_WRITING \ || (s)->early_data_state == SSL_EARLY_DATA_WRITE_RETRY) # define SSL_IS_FIRST_HANDSHAKE(S) ((s)->s3->tmp.finish_md_len == 0 \
Found dtor funcs that were in the vtbl
@@ -561,6 +561,7 @@ factory.register(0x141695E88, "Client::Graphics::Scene::CharacterBase", ["Client 0x1406E3470: "Create", }) factory.register(0x141696198, "Client::Graphics::Scene::Human", ["Client::Graphics::Scene::CharacterBase"], { + 0: "dtor", 1: "CleanupRender", 4: "UpdateRender", 67: "FlagSlotForUpdate", @@ -570,7 +571,6 @@ factory.register(0x141696198, "Client::Graphics::Scene::Human", ["Client::Graphi 86: "GetDyeForSlot", 0x140443E40: "ctor", 0x140444080: "SetupFromCharacterData", - 0x140460BB0: "dtor", }) factory.register(0x141697860, "Client::Graphics::Scene::ResidentResourceManager::ResourceList", [], {}) factory.register(0x141697870, "Client::Graphics::Scene::ResidentResourceManager", ["Client::Graphics::Singleton"], { @@ -801,10 +801,10 @@ factory.register(0x1416AEFE8, "Client::UI::Misc::PronounModule", ["Component::Te 0x140629590: "ctor", }) factory.register(0x1416AFAC0, "Client::UI::Misc::CharaView", [], { + 0: "dtor", 1: "Initialize", 2: "Finalize", 0x14064FB80: "ctor", - 0x14065F700: "dtor", }) factory.register(0x1416B0EC0, "Client::Game::Object::GameObject", [], { 0x1406C5270: "Initialize", @@ -879,8 +879,8 @@ factory.register(0x1417DEC90, "Client::UI::AddonNamePlate", ["Component::GUI::At }) factory.register(0x1417C9520, "Client::UI::AddonRecipeNote", ["Component::GUI::AtkUnitBase"], {}) factory.register(0x14179BAD0, "Client::UI::AddonHudSelectYesno", ["Component::GUI::AtkUnitBase"], { + 0: "dtor", 0x140CD9150: "ctor", - 0x140DD2610: "dtor", }) factory.register(0x141810480, "Client::UI::AddonHudLayoutWindow", ["Component::GUI::AtkUnitBase"], { 0x14101D810: "ctor",
Small improvements to mininet topo start and shutdown
@@ -7,6 +7,7 @@ from mininet.log import setLogLevel from mininet.net import Mininet from mininet.topo import Topo +from mininet.clean import cleanup as net_cleanup class LinuxRouter(Node): "A Node with IP forwarding enabled." @@ -140,7 +141,7 @@ def setup_net(net, ip_tun=True, quic_tun=True, gdb=False, tcpdump=False): if gdb: net['vpn'].cmd('gdb -batch -ex run -ex bt --args picoquicvpn -P plugins/datagram/datagram.plugin -p 4443 2>&1 > log_server.log &') else: - net['vpn'].cmd('xterm -e ./picoquicvpn -P plugins/datagram/datagram.plugin -p 4443 2>&1 > log_server.log &') + net['vpn'].cmd('xterm -e "./picoquicvpn -P plugins/datagram/datagram.plugin -p 4443 2>&1 > log_server.log" &') sleep(1) if tcpdump: @@ -151,19 +152,36 @@ def setup_net(net, ip_tun=True, quic_tun=True, gdb=False, tcpdump=False): if gdb: net['cl'].cmd('gdb -batch -ex run -ex bt --args picoquicvpn -P plugins/datagram/datagram.plugin 10.2.0.2 4443 2>&1 > log_client.log &') else: - net['cl'].cmd('xterm -e ./picoquicvpn -P plugins/datagram/datagram.plugin 10.2.0.2 4443 2>&1 > log_client.log &') + net['cl'].cmd('xterm -e "./picoquicvpn -P plugins/datagram/datagram.plugin 10.2.0.2 4443 2>&1 > log_client.log" &') net['web'].cmd('python3 -m http.server 80 &') sleep(1) +def teardown_net(net): + net['vpn'].cmd('pkill tcpdump') + net['vpn'].cmd('pkill picoquicpvn') + net['vpn'].cmd('pkill gdb') + net['vpn'].cmd('pkill xterm') + + net['cl'].cmd('pkill tcpdump') + net['cl'].cmd('pkill picoquicpvn') + net['cl'].cmd('pkill gdb') + net['cl'].cmd('pkill xterm') + + net['web'].cmd('pkill python3') + + def run(): + net_cleanup() net = Mininet(KiteTopo(bw_a=10, bw_b=10, delay_ms_a=5, delay_ms_b=5, loss_a=0.1, loss_b=0.1), link=TCLink, host=CPULimitedHost) net.start() setup_net(net, ip_tun=True, quic_tun=True, gdb=False, tcpdump=True) CLI(net) + teardown_net(net) net.stop() + net_cleanup() if __name__ == '__main__':
Docker: Install `shfmt` directly
@@ -58,7 +58,6 @@ RUN apt-get update && apt-get -y install \ icheck \ valgrind \ moreutils \ - golang-go \ && rm -rf /var/lib/apt/lists/* RUN cabal update && cabal install hspec QuickCheck @@ -100,9 +99,13 @@ RUN useradd \ USER ${JENKINS_USERID} # shfmt -ENV GOPATH=/home/jenkins/go -ENV PATH="${GOPATH}/bin:${PATH}" -RUN go get -u github.com/mvdan/sh/cmd/shfmt +ENV SHFMT_PATH=/home/jenkins/bin +ENV SHFMT_VERSION=v2.5.1 +ENV PATH="${SHFMT_PATH}:${PATH}" +RUN mkdir -p "${SHFMT_PATH}" \ + && cd "${SHFMT_PATH}" \ + && curl -L "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64" -o shfmt \ + && chmod a+x shfmt # Handle Haskell dependencies ENV HASKELL_SHARED_SANDBOX /home/jenkins/elektra-cabal-sandbox
Add SceSysclib nids
@@ -9227,6 +9227,13 @@ modules: kernel: true nid: 0x7EE45391 functions: + __aeabi_idiv: 0x2518CD9E + __aeabi_lcmp: 0x709077A1 + __aeabi_ldivmod: 0x7554AB04 + __aeabi_lmul: 0xFEE5E751 + __aeabi_uidiv: 0xA9FF1205 + __aeabi_uidivmod: 0xA46CB7DE + __aeabi_ulcmp: 0xFE900DE8 __memcpy_chk: 0x8A0B0815 __memmove_chk: 0x35DBB110 __memset_chk: 0x1A30BB28
dooly: update thermal parameter This patch update prochot trigger/release point. trigger at 75C release at 65C BRANCH=puff TEST=verify prochot setting as intended.
@@ -629,12 +629,12 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); const static struct ec_thermal_config thermal_a = { .temp_host = { [EC_TEMP_THRESH_WARN] = 0, - [EC_TEMP_THRESH_HIGH] = C_TO_K(68), + [EC_TEMP_THRESH_HIGH] = C_TO_K(75), [EC_TEMP_THRESH_HALT] = C_TO_K(78), }, .temp_host_release = { [EC_TEMP_THRESH_WARN] = 0, - [EC_TEMP_THRESH_HIGH] = C_TO_K(58), + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), [EC_TEMP_THRESH_HALT] = 0, }, .temp_fan_off = C_TO_K(41),
Fixed fix16ToStr(..) and fix32ToStr(..) methods
@@ -296,7 +296,7 @@ void fix32ToStr(fix32 value, char *str, u16 numdec) // get fractional part const u16 frac = (((u16) fix32Frac(v)) * (u16) 1000) / ((u16) 1 << FIX32_FRAC_BITS); - u16 len = uint16ToStr(frac, dst, 1); + u16 len = uint16ToStr(frac, dst, 3); if (len < numdec) { @@ -325,7 +325,7 @@ void fix16ToStr(fix16 value, char *str, u16 numdec) // get fractional part const u16 frac = (((u16) fix16Frac(v)) * (u16) 1000) / ((u16) 1 << FIX16_FRAC_BITS); - u16 len = uint16ToStr(frac, dst, 1); + u16 len = uint16ToStr(frac, dst, 3); if (len < numdec) {
libbarrelfish: armv8: pmap: implement alignment in determine_addr
@@ -701,27 +701,53 @@ static errval_t determine_addr(struct pmap *pmap, struct memobj *memobj, size_t alignment, - genvaddr_t *vaddr) + genvaddr_t *retvaddr) { assert(pmap->vspace->head); + struct pmap_aarch64* pmap_aarch64 = (struct pmap_aarch64*)pmap; + genvaddr_t vaddr; - assert(alignment <= BASE_PAGE_SIZE); // NYI + if (alignment == 0) { + alignment = BASE_PAGE_SIZE; + } else { + alignment = ROUND_UP(alignment, BASE_PAGE_SIZE); + } + size_t size = ROUND_UP(memobj->size, alignment); struct vregion *walk = pmap->vspace->head; while (walk->next) { // Try to insert between existing mappings genvaddr_t walk_base = vregion_get_base_addr(walk); - genvaddr_t walk_size = vregion_get_size(walk); + genvaddr_t walk_size = ROUND_UP(vregion_get_size(walk), BASE_PAGE_SIZE); + genvaddr_t walk_end = ROUND_UP(walk_base + walk_size, alignment); genvaddr_t next_base = vregion_get_base_addr(walk->next); - if (next_base > walk_base + walk_size + memobj->size && - walk_base + walk_size > VSPACE_BEGIN) { // Ensure mappings are larger than VSPACE_BEGIN - *vaddr = walk_base + walk_size; - return SYS_ERR_OK; + // sanity-check for page alignment + assert(walk_base % BASE_PAGE_SIZE == 0); + assert(next_base % BASE_PAGE_SIZE == 0); + + if (next_base > walk_end + size && walk_end > VSPACE_BEGIN) { + vaddr = walk_end; + goto out; } + walk = walk->next; } - *vaddr = vregion_get_base_addr(walk) + vregion_get_size(walk); + // place beyond last mapping with alignment + vaddr = ROUND_UP((vregion_get_base_addr(walk) + + ROUND_UP(vregion_get_size(walk), BASE_PAGE_SIZE)), + alignment); + + + +out: + // ensure that we haven't run out of the valid part of the address space + if (vaddr + memobj->size > pmap_aarch64->max_mappable_va) { + return LIB_ERR_OUT_OF_VIRTUAL_ADDR; + } + assert(retvaddr != NULL); + *retvaddr = vaddr; + return SYS_ERR_OK; }
Bootstrap.bat: Change default behaviour to bootstrap with latest Visual Studio available
SETLOCAL SETLOCAL ENABLEDELAYEDEXPANSION +REM =========================================================================== + +SET SelfPath="%0" +SET VsWherePath="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" + +REM =========================================================================== + SET vsversion=%1 IF "%vsversion%" == "" ( - SET vsversion=vs2015 + CALL :BootstrapLatest + EXIT /B %ERRORLEVEL% ) IF "%vsversion%" == "vs2010" ( @@ -74,14 +82,12 @@ SET "VsVersionMax=%~3" REM ref: https://github.com/Microsoft/vswhere/wiki/Start-Developer-Command-Prompt -SET VsWherePath="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" - IF NOT EXIST %VsWherePath% ( ECHO Could not find vswhere.exe EXIT /B 2 ) -SET VsWhereCmdLine="%VsWherePath% -nologo -latest -version [%VsVersionMin%,%VsVersionMax%) -property installationPath" +SET VsWhereCmdLine="!VsWherePath! -nologo -latest -version [%VsVersionMin%,%VsVersionMax%) -property installationPath" FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO ( @@ -98,6 +104,58 @@ REM :VsWhereVisualBootstrap REM =========================================================================== +:BootstrapLatest + +IF EXIST %VsWherePath% ( + + REM First try for not legacy Visual Studios ( >vs2017 ) + + SET VsWhereCmdLine="!VsWherePath! -nologo -latest -property catalog.productLineVersion" + + FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO ( + + CALL %SelfPath% vs%%i + + EXIT /B %ERRORLEVEL% + ) + +) + +SET LegacyVSVersions= + +REM Get latest Visual Studio legacy version + +REM For all env var starting with VS +FOR /F "usebackq delims==" %%i in (`SET VS`) DO ( + + REM Check if env var match pattern VS*COMNTOOLS (ie: VS140COMNTOOLS) + ECHO "%%i" | FINDSTR /R /C:VS.*COMNTOOLS >nul && ( + + SET "LegacyVSVersions=%%i" + ) +) + +REM Strip VS +SET LegacyVSVersions=%LegacyVSVersions:VS=% +REM Strip COMNTOOLS +SET LegacyVSVersions=%LegacyVSVersions:COMNTOOLS=% + +SET "VsVersionMap=140-vs2015;120-vs2013;110-vs2012;100-vs2010" +CALL SET PremakeVsVersion=%%VsVersionMap:*%LegacyVSVersions%-=%% +SET PremakeVsVersion=%PremakeVsVersion:;=&REM.% + +IF NOT "%PremakeVsVersion%" == "" ( + CALL %SelfPath% %PremakeVsVersion% + EXIT /B %ERRORLEVEL% +) + +ECHO Could not find a Visual Studio installation +EXIT /B 2 + +REM :BootstrapLatest + +REM =========================================================================== + REM SETLOCAL ENABLEDELAYEDEXPANSION ENDLOCAL REM SETLOCAL
fskmodem/example: fixing typo in help with bits/symbol
@@ -22,7 +22,7 @@ void usage() printf("fskmodem_example -- frequency-shift keying example\n"); printf("options:\n"); printf(" h : print help\n"); - printf(" m : bits/symbol, default: 1\n"); + printf(" m : bits/symbol, default: 3\n"); printf(" k : samples/symbol, default: 2*2^m\n"); printf(" b : signal bandwidth default: 0.2\n"); printf(" n : number of data symbols, default: 80\n");
appveyor: specify Release configuration properly;
@@ -12,7 +12,9 @@ before_build: - git submodule update --init - md build - cd build - - cmake -DCMAKE_BUILD_TYPE=Release .. + - cmake -DCMAKE_BUILD_TYPE=%configuration% .. + +configuration: Release build: project: build\lovr.sln
Prevent sending add scene command too early
@@ -5569,6 +5569,7 @@ void DeRestPluginPrivate::processGroupTasks() { i->modifyScenesRetries++; + bool needRead = false; Scene *scene = getSceneForId(i->id, i->modifyScenes[0]); if (scene) @@ -5586,6 +5587,7 @@ void DeRestPluginPrivate::processGroupTasks() if (ls->lid() == task.lightNode->id()) { + needRead = true; if (readSceneAttributes(task.lightNode, i->id, scene->id)) { return; @@ -5595,7 +5597,7 @@ void DeRestPluginPrivate::processGroupTasks() } - if (addTaskAddScene(task, i->id, i->modifyScenes[0], task.lightNode->id())) + if (!needRead && addTaskAddScene(task, i->id, i->modifyScenes[0], task.lightNode->id())) { processTasks(); return;
Fix Coverity & integer overflow Both are the same issue and both as false positives. Annotate the line so that this is ignored.
@@ -586,9 +586,15 @@ static int recode_wnaf(struct smvt_control *control, int32_t delta = odd & mask; assert(position >= 0); - assert(pos < 32); /* can't fail since current & 0xFFFF != 0 */ if (odd & (1 << (table_bits + 1))) delta -= (1 << (table_bits + 1)); + /* + * Coverity gets confused by the value of pos, thinking it might be + * 32. This would require current & 0xFFFF to be zero which isn't + * possible. Suppress this false positive, since adding a check + * isn't desirable. + */ + /* coverity[overflow_before_widen] */ current -= delta * (1 << pos); control[position].power = pos + 16 * (w - 1); control[position].addend = delta;