message
stringlengths
6
474
diff
stringlengths
8
5.22k
Modify description on Kconfig This patch modifies description of STDIO_BUFFER_SIZE config.
@@ -9,8 +9,10 @@ config STDIO_BUFFER_SIZE int "C STDIO buffer size" default 64 ---help--- - Size of buffers using within the C buffered I/O interfaces. - (printf, putchar, fwrite, etc.). + Size of buffers using within the C buffered I/O interfaces (printf, + putchar, fwrite, etc.). This function sets the initial I/O buffer + size. Zero disables I/O buffering. That size may be subsequently + modified using setvbuf(). config STDIO_LINEBUFFER bool "STDIO line buffering"
Replace "semicolon" with "colon" It appears that the text is referring to the colon ":" in type annotations and method calls, not the semicolon ";" which is used to separate statements on the same line in Lua.
@@ -258,8 +258,8 @@ Pallene is a statically-typed language, which means that every variable and expr Sometimes this may be the catch-all type `value`, but it is still known at compilation time. Similarly to most other statically-typed languages, Pallene allows you to add type annotations to variables, functions, and expressions. (This is one of the few syntactical differences between Lua and Pallene.) -Pallene type annotations for variables and functions are written using semicolons. -For expressions the semicolon is already used for method calls, so Pallene uses the `as` operator instead. +Pallene type annotations for variables and functions are written using colons. +For expressions the colon is already used for method calls, so Pallene uses the `as` operator instead. ``` function foo(x : value) : integer
OcCorePkg/Platform/BootLiquor: fix impossible (?) loss of data (UINT64 -> UINT32)
@@ -182,11 +182,11 @@ InternalUpdateStateAbsolute ( NewX = PointerState.CurrentX - Context->AbsPointer->Mode->AbsoluteMinX; NewX *= Context->Width; - NewX = DivU64x32 (NewX, Context->AbsPointer->Mode->AbsoluteMaxX - Context->AbsPointer->Mode->AbsoluteMinX); + NewX = DivU64x32 (NewX, (UINT32) (Context->AbsPointer->Mode->AbsoluteMaxX - Context->AbsPointer->Mode->AbsoluteMinX)); NewY = PointerState.CurrentY - Context->AbsPointer->Mode->AbsoluteMinY; NewY *= Context->Height; - NewY = DivU64x32 (NewY, Context->AbsPointer->Mode->AbsoluteMaxY - Context->AbsPointer->Mode->AbsoluteMinY); + NewY = DivU64x32 (NewY, (UINT32) (Context->AbsPointer->Mode->AbsoluteMaxY - Context->AbsPointer->Mode->AbsoluteMinY)); State->X = (UINT32)NewX; State->Y = (UINT32)NewY;
Timestamp: set line-height
@@ -23,6 +23,7 @@ const Timestamp = (props: TimestampProps): ReactElement | null => { relative, dateNotRelative, fontSize, + lineHeight, ...rest } = { time: true, @@ -62,7 +63,7 @@ const Timestamp = (props: TimestampProps): ReactElement | null => { title={stamp.format(DateFormat + ' ' + TimeFormat)} > {time && ( - <Text flexShrink={0} color={color} fontSize={fontSize}> + <Text lineHeight={lineHeight} flexShrink={0} color={color} fontSize={fontSize}> {timestamp} </Text> )} @@ -70,6 +71,7 @@ const Timestamp = (props: TimestampProps): ReactElement | null => { <Text flexShrink={0} color={color} + lineHeight={lineHeight} fontSize={fontSize} display={time ? ['none', hovering ? 'block' : 'none'] : 'block'} >
yorp: remove old comment Bug is already closed BRANCH=none TEST=none
@@ -206,7 +206,6 @@ static struct stprivate_data lsm6dsm_g_data; static struct stprivate_data lsm6dsm_a_data; /* Drivers */ -/* TODO(b/74602071): Tune sensor cfg after the board is received */ struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { .name = "Lid Accel",
Cascading: Fix minor spelling mistakes in ReadMe
@@ -113,14 +113,14 @@ makes them really powerful. Consider the following example: -First, we create a target key to demostrate the override link mechanism: +First, we create a target key to demonstrate the override link mechanism: ```sh sudo kdb set system/overrides/test "hello override" #> Create a new key system/overrides/test with string "hello override" ``` -Override links can be defined by adding them to the `override/#` metadata array key of the correspoding `spec-key`: +Override links can be defined by adding them to the `override/#` metadata array key of the corresponding `spec-key`: ```sh sudo kdb setmeta spec/sw/tutorial/cascading/#0/current/test override/#0 /overrides/test
Fixes Infinite loading wheel when solr is not responding
@@ -279,6 +279,40 @@ public class SearchAggregator extends HttpServlet { } else { searchResponse = SearchAPI.search(request); } + + // Check if the searchResponse is OK + if (searchResponse.isEmpty()) { + response.setStatus(500); + response.setCharacterEncoding("utf-8"); + response.setContentType("text/json;charset=utf-8"); + response.setHeader("Content-Type", "application/json;charset=UTF-8 "); + final JSONObject error = new JSONObject(); + error.put("code", 500); + error.put("status", "Unkown error"); + response.getWriter().write(error.toJSONString()); + return; + } else { + // Check if the response is not an error + // If it is then get the error code and usr it for the final response + try { + final JSONParser parser = new JSONParser(); + final JSONObject jSearchResponse = (JSONObject) parser.parse(searchResponse); + if (jSearchResponse.containsKey("error")) { + final JSONObject errorObj = (JSONObject) jSearchResponse.get("error"); + final int errorCode = Integer.parseInt(errorObj.get("code").toString()); + response.setStatus(errorCode); + response.setCharacterEncoding("utf-8"); + response.setContentType("text/json;charset=utf-8"); + response.setHeader("Content-Type", "application/json;charset=UTF-8 "); + response.getWriter().write(errorObj.toJSONString()); + return; + + } + } catch (final Exception e) { + // Do nothing + } + } + final String wrapperFunction = request.getParameter("json.wrf"); if (wrapperFunction != null) { searchResponse = wrapperFunction + "(" + searchResponse + ")";
Fix error message for CVE-2021-23222
@@ -193,8 +193,8 @@ int od_tls_backend_connect(od_server_t *server, od_logger_t *logger, od_debug(logger, "tls", NULL, server, "supported"); if (od_readahead_unread(&server->io.readahead) > 0) { od_error(logger, "tls", NULL, server, - "extraneous data from client"); - return -1; // prevent possible buffer, protecting against CVE-2021-23214-like attacks + "extraneous data from server"); + return -1; // prevent possible buffer, protecting against CVE-2021-23222-like attacks } rc = machine_set_tls(server->io.io, server->tls, UINT32_MAX);
Use ++pit:nu:crub:crypto for network keypair generation
=+ manage-seed=(child-seed transfer-seed "manage" 0 shh) :- manage=(wallet-from-seed manage-seed) =+ urbit-seed=(child-seed manage-seed "urbit" 0 shh) - ~ ::TODO networking keypairs from seed + =+ urbit=(pit:nu:crub:crypto (mul 8 wid.urbit-seed) dat.urbit-seed) + =+ pub=pub:ex:urbit + =+ sec=sec:ex:urbit + :- ^= auth + :- public=`@ux`(rsh 3 1 (end 3 33 pub)) + secret=`@ux`(rsh 3 1 (end 3 33 sec)) + ^= crypt + :- public=`@ux`(rsh 3 33 pub) + secret=`@ux`(rsh 3 33 sec) --
Rename reference data
@@ -3,7 +3,7 @@ ecmf 166 10v m s**-1 10 metre V wind component ecmf 59 cape J kg**-1 Convective available potential energy ecmf 156 gh gpm Geopotential height ecmf 151 msl Pa Mean sea level pressure -ecmf 179 ttr J m**-2 Top net long-wave radiation +ecmf 179 ttr J m**-2 Top net long-wave (thermal) radiation ecmf 3 pt K Potential temperature ecmf 60 pv K m**2 kg**-1 s**-1 Potential vorticity ecmf 235 skt K Skin temperature @@ -18,15 +18,15 @@ ecmf 121 mx2t6 K Maximum temperature at 2 metres in the last 6 hours ecmf 122 mn2t6 K Minimum temperature at 2 metres in the last 6 hours ecmf 167 2t K 2 metre temperature ecmf 147 slhf J m**-2 Surface latent heat flux -ecmf 176 ssr J m**-2 Surface net short-wave radiation -ecmf 177 str J m**-2 Surface net long-wave radiation +ecmf 176 ssr J m**-2 Surface net short-wave (solar) radiation +ecmf 177 str J m**-2 Surface net long-wave (thermal) radiation ecmf 134 sp Pa Surface pressure ecmf 146 sshf J m**-2 Surface sensible heat flux ecmf 130 t K Temperature -ecmf 179 ttr J m**-2 Top net long-wave radiation +ecmf 179 ttr J m**-2 Top net long-wave (thermal) radiation ecmf 147 slhf J m**-2 Surface latent heat flux -ecmf 176 ssr J m**-2 Surface net short-wave radiation -ecmf 177 str J m**-2 Surface net long-wave radiation +ecmf 176 ssr J m**-2 Surface net short-wave (solar) radiation +ecmf 177 str J m**-2 Surface net long-wave (thermal) radiation ecmf 146 sshf J m**-2 Surface sensible heat flux ecmf 228164 tcc % Total Cloud Cover ecmf 136 tcw kg m**-2 Total column water
Add Cipher Key Policy check one-shot cases
@@ -1230,8 +1230,20 @@ void cipher_key_policy( int policy_usage_arg, psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; psa_key_usage_t policy_usage = policy_usage_arg; + size_t output_buffer_size = 0; + size_t input_buffer_size = 0; + size_t output_length = 0; + uint8_t *output = NULL; + uint8_t *input = NULL; psa_status_t status; + input_buffer_size = PSA_BLOCK_CIPHER_BLOCK_LENGTH( exercise_alg ); + output_buffer_size = PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, exercise_alg, + input_buffer_size ); + + ASSERT_ALLOC( input, input_buffer_size ); + ASSERT_ALLOC( output, output_buffer_size ); + PSA_ASSERT( psa_crypto_init( ) ); psa_set_key_usage_flags( &attributes, policy_usage ); @@ -1245,6 +1257,17 @@ void cipher_key_policy( int policy_usage_arg, TEST_EQUAL( policy_usage, mbedtls_test_update_key_usage_flags( policy_usage ) ); + /* Encrypt check, one-shot */ + status = psa_cipher_encrypt( key, exercise_alg, input, input_buffer_size, + output, output_buffer_size, + &output_length); + if( policy_alg == exercise_alg && + ( policy_usage & PSA_KEY_USAGE_ENCRYPT ) != 0 ) + PSA_ASSERT( status ); + else + TEST_EQUAL( status, PSA_ERROR_NOT_PERMITTED ); + + /* Encrypt check, multi-part */ status = psa_cipher_encrypt_setup( &operation, key, exercise_alg ); if( policy_alg == exercise_alg && ( policy_usage & PSA_KEY_USAGE_ENCRYPT ) != 0 ) @@ -1253,6 +1276,17 @@ void cipher_key_policy( int policy_usage_arg, TEST_EQUAL( status, PSA_ERROR_NOT_PERMITTED ); psa_cipher_abort( &operation ); + /* Decrypt check, one-shot */ + status = psa_cipher_decrypt( key, exercise_alg, output, output_buffer_size, + input, input_buffer_size, + &output_length); + if( policy_alg == exercise_alg && + ( policy_usage & PSA_KEY_USAGE_DECRYPT ) != 0 ) + PSA_ASSERT( status ); + else + TEST_EQUAL( status, PSA_ERROR_NOT_PERMITTED ); + + /* Decrypt check, multi-part */ status = psa_cipher_decrypt_setup( &operation, key, exercise_alg ); if( policy_alg == exercise_alg && ( policy_usage & PSA_KEY_USAGE_DECRYPT ) != 0 ) @@ -1262,6 +1296,8 @@ void cipher_key_policy( int policy_usage_arg, exit: psa_cipher_abort( &operation ); + mbedtls_free( input ); + mbedtls_free( output ); psa_destroy_key( key ); PSA_DONE( ); }
Add an LP-GOP test
set -eu source util.bash -common_args='--gop=8 -p0 --threads=2 --wpp --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3' -valgrind_test 264x130 10 $common_args --owf=1 -valgrind_test 264x130 10 $common_args --owf=4 -valgrind_test 264x130 20 $common_args --owf=0 +common_args='-p0 --threads=2 --wpp --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3' +valgrind_test 264x130 10 $common_args --gop=8 -p0 --owf=1 +valgrind_test 264x130 10 $common_args --gop=8 -p0 --owf=4 +valgrind_test 264x130 20 $common_args --gop=8 -p16 --owf=0 +valgrind_test 264x130 10 $common_args --gop=lp-g4d3t1 -p5 --owf=4
tests CHANGE extend tests for identityref type
@@ -1199,6 +1199,14 @@ test_type_identityref(void **state) assert_int_equal(LY_EVALID, lys_compile(mod, 0)); logbuf_assert("Multiple bases in identityref type are allowed only in YANG 1.1 modules."); + assert_non_null(mod = lys_parse_mem(ctx, "module ff {namespace urn:ff;prefix ff; identity i;leaf l {type identityref {base j;}}}", LYS_IN_YANG)); + assert_int_equal(LY_EVALID, lys_compile(mod, 0)); + logbuf_assert("Unable to find base (j) of identityref."); + + assert_non_null(mod = lys_parse_mem(ctx, "module gg {namespace urn:gg;prefix gg;leaf l {type identityref {base x:j;}}}", LYS_IN_YANG)); + assert_int_equal(LY_EVALID, lys_compile(mod, 0)); + logbuf_assert("Invalid prefix used for base (x:j) of identityref."); + *state = NULL; ly_ctx_destroy(ctx, NULL); }
Don't specify arch/platform/zoul as a directory twice
@@ -24,7 +24,7 @@ CFLAGS += -DDATE="\"`date +"%02u %02d %02m %02y %02H %02M %02S"`\"" ### Configure the build for the board and pull in board-specific sources CONTIKI_TARGET_DIRS += . dev -CONTIKI_TARGET_DIRS += . $(BOARD) +CONTIKI_TARGET_DIRS += $(BOARD) PLATFORM_ROOT_DIR = $(ARCH_PATH)/platform/$(TARGET) ### Include the board dir if one exists
host/mesh: Verify that all stored mesh entries removed This ensures that all mesh settings were removed from persistent storage after node reset. This is port of
@@ -1161,6 +1161,7 @@ void bt_mesh_net_pending_seq_store(void) struct seq_val seq; int err; + if (atomic_test_bit(bt_mesh.flags, BT_MESH_VALID)) { sys_put_le24(bt_mesh.seq, seq.val); str = settings_str_from_bytes(&seq, sizeof(seq), buf, sizeof(buf)); @@ -1176,6 +1177,14 @@ void bt_mesh_net_pending_seq_store(void) } else { BT_DBG("Stored Seq value"); } + } else { + err = settings_save_one("bt_mesh/Seq", NULL); + if (err) { + BT_ERR("Failed to clear Seq value"); + } else { + BT_DBG("Cleared Seq value"); + } + } } void bt_mesh_net_clear(void) @@ -1183,6 +1192,7 @@ void bt_mesh_net_clear(void) bt_mesh_settings_store_schedule(BT_MESH_SETTINGS_NET_PENDING); bt_mesh_settings_store_schedule(BT_MESH_SETTINGS_IV_PENDING); bt_mesh_settings_store_schedule(BT_MESH_SETTINGS_CFG_PENDING); + bt_mesh_settings_store_schedule(BT_MESH_SETTINGS_SEQ_PENDING); } void bt_mesh_net_settings_commit(void)
missing ; after defer
@@ -318,7 +318,7 @@ bool files_parseDictionary(honggfuzz_t * hfuzz) size_t n = 0; defer { free(lineptr); - } + }; for (;;) { ssize_t len = getdelim(&lineptr, &n, '\n', fDict); if (len == -1) {
plugin types BUGFIX avoid checking unresolved when ... for leafref validation. The data tree may be non-validated. Fixes sysrepo/sysrepo#2528
@@ -790,7 +790,7 @@ lyplg_type_resolve_leafref(const struct lysc_type_leafref *lref, const struct ly /* find all target data instances */ ret = lyxp_eval(LYD_CTX(node), lref->path, node->schema->module, LY_VALUE_SCHEMA_RESOLVED, lref->prefixes, - node, tree, &set, 0); + node, tree, &set, LYXP_IGNORE_WHEN); if (ret) { ret = LY_ENOTFOUND; val_str = lref->plugin->print(LYD_CTX(node), value, LY_VALUE_CANON, NULL, NULL, NULL);
hv: fix possible buffer overflow in 'vcpu_set_eoi_exit()' 'vector' should be no greater than 0xff,else 'eoi_exit_bitmap[]' will overflow. Acked-by: Eddie Dong
@@ -145,7 +145,7 @@ void vcpu_set_eoi_exit(struct acrn_vcpu *vcpu, uint32_t vector) pr_dbg("%s", __func__); if (bitmap_test_and_set_nolock((uint16_t)(vector & 0x3fU), - &(vcpu->arch.eoi_exit_bitmap[vector >> 6U]))) { + &(vcpu->arch.eoi_exit_bitmap[(vector & 0xffU) >> 6U]))) { pr_warn("Duplicated vector %u vcpu%u", vector, vcpu->vcpu_id); } }
new version yp_cli
}, "yp-util": { "formula": { - "sandbox_id": [314258866], + "sandbox_id": [326474135], "match": "yp_cli" }, "executable": {
Add missing MBEDTLS_PRIVATE
@@ -157,7 +157,7 @@ struct psa_aead_operation_s * ID values are auto-generated in psa_crypto_driver_wrappers.h * ID value zero means the context is not valid or not assigned to * any driver (i.e. none of the driver contexts are active). */ - unsigned int id; + unsigned int MBEDTLS_PRIVATE(id); psa_algorithm_t MBEDTLS_PRIVATE(alg); psa_key_type_t MBEDTLS_PRIVATE(key_type);
chat-cli: print messages only if chat is viewed
%remove-graph (~(notice-remove se i.sez) +.q.upd) :: %add-nodes + ?. (~(has in viewing.session.i.sez) resource.q.upd) + [~ session.i.sez] %+ ~(read-posts se i.sez) resource.q.upd (sort ~(tap by nodes.q.upd) ior)
in_storage_backlog: lookup chunk event type and use it when mapping the chunk
* limitations under the License. */ -#include <fluent-bit/flb_output_plugin.h> +#include <fluent-bit/flb_output.h> #include <fluent-bit/flb_input_plugin.h> #include <fluent-bit/flb_input_chunk.h> #include <fluent-bit/flb_storage.h> @@ -468,10 +468,12 @@ static int cb_queue_chunks(struct flb_input_instance *in, struct sb_out_chunk *chunk_instance; struct flb_sb *ctx; struct flb_input_chunk *ic; + struct flb_input_chunk tmp_ic; void *ch; size_t total = 0; ssize_t size; int ret; + int event_type; /* Get context */ ctx = (struct flb_sb *) data; @@ -526,6 +528,27 @@ static int cb_queue_chunks(struct flb_input_instance *in, } } + /* + * Map the chunk file context into a temporary buffer since the + * flb_input_chunk_get_event_type() interface needs an + * struct fb_input_chunk argument. + */ + tmp_ic.chunk = chunk_instance->chunk; + + /* Retrieve the event type: FLB_INPUT_LOGS or FLB_INPUT_METRICS */ + ret = flb_input_chunk_get_event_type(&tmp_ic); + if (ret == -1) { + flb_plg_error(ctx->ins, "removing chunk with wrong metadata " + "from the queue %s:%s", + chunk_instance->stream->name, + chunk_instance->chunk->name); + cio_chunk_close(chunk_instance->chunk, FLB_TRUE); + sb_remove_chunk_from_segregated_backlogs(chunk_instance->chunk, + ctx); + continue; + } + event_type = ret; + /* get the number of bytes being used by the chunk */ size = cio_chunk_get_content_size(chunk_instance->chunk); if (size <= 0) { @@ -543,7 +566,7 @@ static int cb_queue_chunks(struct flb_input_instance *in, ch = chunk_instance->chunk; /* Associate this backlog chunk to this instance into the engine */ - ic = flb_input_chunk_map(in, ch); + ic = flb_input_chunk_map(in, event_type, ch); if (!ic) { flb_plg_error(ctx->ins, "removing chunk %s:%s from the queue", chunk_instance->stream->name, chunk_instance->chunk->name);
docs: add more useful connection debug message
@@ -355,8 +355,10 @@ perform_request( switch (action) { case ACTION_SUCCESS: case ACTION_FAILURE: + D_PRINT("FINISHED REQUEST AT %s", url); return; case ACTION_RETRY: + D_PRINT("RETRYING TO PERFORM REQUEST AT %s", url); break; case ACTION_ABORT: default:
[docs] Make _What's Next_ more succinct
@@ -39,16 +39,16 @@ What's Next? This depends on what you are planning to do with Chipyard. -* If you want to learn about the structure of Chipyard, go to :ref:`chipyard-components`. +* To learn about the structure of Chipyard, see :ref:`chipyard-components`. -* If you intend to build one of the vanilla Chipyard examples, go to :ref:`build-a-chip` and follow the instructions. +* To build one of the vanilla Chipyard examples, see :ref:`build-a-chip`. -* If you intend to add a new accelerator, go to :ref:`adding-an-accelerator` and follow the instructions. +* To add a new accelerator, see :ref:`adding-an-accelerator`. -* If you intend to run a simulation of one of the vanilla Chipyard examples, go to :ref:`sw-rtl-sim-intro` and follow the instructions. +* To run a simulation of one of the Chipyard examples, see :ref:`sw-rtl-sim-intro`. -* If you intend to run a simulation of a custom Chipyard SoC Configuration, go to <> and follow the instructions. +* To run a simulation of a custom Chipyard SoC Configuration, see <>. -* If you intend to run a full-system FireSim simulation, go to :ref:`firesim-sim-intro` and follow the instructions. +* To run a FPGA-accelerated simulation using FireSim, see :ref:`firesim-sim-intro`. -* If you intend to run a VLSI flow using one of the vanilla Chipyard examples, go to <> and follow the instructions. +* To run a VLSI flow using one of the vanilla Chipyard examples, see <>.
chip/host/config_chip: Fix TASK_STACK_SIZE of the host board. Define TASK_STACK_SIZE as standard value 512 for the host board. BRANCH=none TEST=make runtests
@@ -32,6 +32,9 @@ extern char __host_flash[CONFIG_FLASH_SIZE]; /* Compute the rest of the flash params from these */ #include "config_std_internal_flash.h" +/* Default task stack size */ +#define TASK_STACK_SIZE 512 + /* Interval between HOOK_TICK notifications */ #define HOOK_TICK_INTERVAL_MS 250 #define HOOK_TICK_INTERVAL (HOOK_TICK_INTERVAL_MS * MSEC)
[Compiler] Main runner will compile, assemble, and simulate
@@ -5,7 +5,7 @@ use std::env; use std::fs; use linker::{FileLayout, assembly_packer, render_elf}; -use compilation_definitions::instructions::Instr; +use compilation_definitions::instructions::{Instr, MoveImmToReg, MoveRegToReg, AddRegToReg, CompareImmWithReg}; use compilation_definitions::prelude::*; use crate::codegen::CodeGenerator; @@ -14,27 +14,35 @@ use crate::parser::Parser; use crate::simulator::MachineState; pub fn main() -> Result<(), Box<dyn error::Error>> { - println!("Starting REPL..."); - - let stdin = io::stdin(); - let mut stdin_iter = stdin.lock().lines(); + let source = "int main() { \ + if (3) { + return 5; + } + return 10; + }"; - //loop { - print!(">>> "); - io::stdout().flush(); - //let source = stdin_iter.next().unwrap().unwrap(); - let source = "int main() { return 100 + 122 + 458 + 1; }"; + // Parse the source code to an AST + println!("Parsing source code..."); let mut parser = Parser::new(&source); let func = parser.parse_function(); + + // Generate IR + println!("Generating IR..."); let codegen = CodeGenerator::new(); let instrs = codegen.codegen_function(&func); + + // Optimize IR + println!("Optimizing IR..."); let mut optimized_instrs = Optimizer::optimize(&instrs); optimized_instrs.insert(0, Instr::DirectiveSetCurrentSection(".text".to_string())); - let instrs_as_asm = CodeGenerator::render_instructions_to_assembly(&optimized_instrs); println!("Codegen instructions: "); for instr in optimized_instrs.iter() { println!("\t{instr:?}"); } + + // Render IR to assembly + println!("Rendering IR to assembly..."); + let instrs_as_asm = CodeGenerator::render_instructions_to_assembly(&optimized_instrs); println!("Rendered assembly: "); for asm_instr in instrs_as_asm.iter() { println!("\t{asm_instr}"); @@ -42,33 +50,34 @@ pub fn main() -> Result<(), Box<dyn error::Error>> { let mut asm_source = instrs_as_asm.join("\n"); // TODO(PT): Newline at end is to deal with a bug in assembler lexer asm_source.push('\n'); + + // Assemble into an ELF + println!("Assembling to an ELF..."); let layout = Rc::new(FileLayout::new(0x400000)); let (labels, equ_expressions, atoms) = assembly_packer::parse(&layout, &asm_source); + println!("Found labels {labels:?}"); let elf = render_elf(&layout, labels, equ_expressions, atoms); - println!("Finshed ELF generation. Size: {}\n", elf.len()); + let current_dir = env::current_dir().unwrap(); let output_file = current_dir.join("output_elf"); - //fs::write(output_file, elf).unwrap(); + println!("Output file {output_file:?}"); + fs::write(output_file, elf.clone()).unwrap(); + // Simulate ELF execution + println!("Simulating ELF..."); let machine = MachineState::new(); machine.load_elf(&elf); - //println!("machine {machine:?}"); loop { let instr_info = machine.step(); - if instr_info.did_return { + if let Instr::Return = instr_info.instr { break; } - //println!("Ran instruction {instr_info:?}"); + println!("Ran instruction {instr_info:?}"); } + println!("Simulation complete!"); println!("rax = {}", machine.reg(Rax).read_u64(&machine)); - /* - let machine = MachineState::new(); - machine.run_instructions(&optimized_instrs); - */ - //} - Ok(()) }
doc: update `acrn-dm` parameters documentation Update the documentation listing and describing all `acrn-dm` parameters as it has gone out of sync with the actual implementation. Some parameters are missing and others are now obsolete.
@@ -37,7 +37,7 @@ Here are descriptions for each of these ``acrn-dm`` command line parameters: - Enable guest to write io port 0xf4 to exit guest. It's mainly used by guest unit test. - * - :kbd:`-E <elf image path>` + * - :kbd:`-E, --elf_file <elf image path>` - This option is to define a static elf binary which could be loaded by DM. DM will run elf as guest of ACRN. @@ -158,13 +158,6 @@ Here are descriptions for each of these ``acrn-dm`` command line parameters: * - :kbd:`--part_info <part_info_name>` - Set guest partition info path. - * - :kbd:`--ptdev_no_reset` - - Disable reset check for pci device. - When assigning a PCI device as a passthrough device, we will reset it - first to get it to a valid device state. So if the device doesn't have - the reset capability, the passthrough will fail. The PCI device reset - can be disabled using this option. - * - :kbd:`-r, --ramdisk <ramdisk_image_path>` - Set the ramdisk (full path) for the User VM. The maximum length is 1023. The supported ramdisk format depends on your User VM kernel configuration. @@ -264,6 +257,16 @@ Here are descriptions for each of these ``acrn-dm`` command line parameters: --ovmf w,/usr/share/acrn/bios/OVMF.fd + + * - :kbd:`--cpu_affinity <list of pCPUs>` + - list of pCPUs assigned to this VM. + + Example:: + + --cpu_affinity 1,3 + + to assign physical CPUs (pCPUs) 1 and 3 to this VM. + * - :kbd:`--virtio_poll <poll_interval>` - Enable virtio poll mode with poll interval xxx ns. @@ -350,3 +353,11 @@ Here are descriptions for each of these ``acrn-dm`` command line parameters: --pm_notify_channel uart --pm_by_vuart tty,/dev/ttyS1 For different User VM, it can be configured as needed. + + * - :kbd:`--windows` + - This option is used to run Windows User VMs. It supports Oracle + ``virtio-blk``, ``virtio-net`` and ``virtio-input`` devices for Windows + guests with secure boot. + + usage:: + --windows
android: fix backward-compat
@@ -1123,7 +1123,8 @@ public class RhodesService extends Service { builder.setSmallIcon(android.R.drawable.stat_sys_download); builder.setDefaults(Notification.FLAG_ONGOING_EVENT); - builder.setCustomContentView(expandedView); + //min API = 24 + //builder.setCustomContentView(expandedView); Intent intent = new Intent(ACTION_ASK_CANCEL_DOWNLOAD); builder.setContentIntent(PendingIntent.getBroadcast(context, 0, intent, 0)); intent = new Intent(ACTION_CANCEL_DOWNLOAD);
Add install section and examples in the README.
<div align="center"> - <a href="https://metacall.io" target="_blank"><img src="https://raw.githubusercontent.com/metacall/core/master/deploy/images/logo.png" alt="METACALL" style="max-width:100%; margin: 0 auto;" width="80" height="80"> - <h1><b>MetaCall Polyglot Runtime</b></h1></a> + <a href="https://metacall.io" target="_blank"><img src="https://raw.githubusercontent.com/metacall/core/master/deploy/images/logo.png" alt="METACALL" style="max-width:100%; margin: 0 auto;" width="80" height="80"></a> + <h1><b>MetaCall Polyglot Runtime</b></h1> <a href="https://metacall.io">MetaCall.io</a> | - <a href="https://github.com/metacall/install">Install</a> | + <a href="https://github.com/metacall/core/blob/master/README.md#install">Install</a> | <a href="https://github.com/metacall/core/blob/master/docs/README.md">Docs</a> </div> <div align="center"> + <a href="#badges"></a> + <a href="https://t.me/joinchat/BMSVbBatp0Vi4s5l4VgUgg" alt="Discord"> <img src="https://img.shields.io/static/v1?label=metacall&message=join&color=blue&logo=telegram&style=flat" /></a> @@ -31,7 +33,7 @@ def sum(a, b): `main.js` ``` javascript -const { sum } = require('sum.py'); +const { sum } = require('./sum.py'); sum(3, 4); // 7 ``` @@ -41,5 +43,18 @@ sum(3, 4); // 7 metacall main.js ``` -**MetaCall** is an extensible, embeddable and interoperable polyglot runtime. It supports NodeJS, Vanilla JavaScript, TypeScript, Python, Ruby, C#, Go, C, C++, Rust, D, Cobol [and more](https://github.com/metacall/core/blob/master/docs/README.md#2-language-support). Use the [installer](https://github.com/metacall/install) and try [some examples](https://github.com/metacall/beautifulsoup-express-example). +**MetaCall** is a extensible, embeddable and interoperable cross-platform polyglot runtime. It supports NodeJS, Vanilla JavaScript, TypeScript, Python, Ruby, C#, Go, C, C++, Rust, D, Cobol [and more](https://github.com/metacall/core/blob/master/docs/README.md#2-language-support). + +## Install + +The easiest way to install **METACALL** is the following: + +``` sh +curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh +``` + +For more information about other install methodologies and platforms or Docker, check the [install documentation](https://github.com/metacall/core/blob/master/docs/README.md#41-installation). + +## Examples +You can find a complete [list of examples in the documentation](https://github.com/metacall/core/blob/master/docs/README.md#43-examples). If you are interested in submitting new examples, please [contact us in our chats](#badges).
Vectorize stdev/variance conversion
@@ -1044,11 +1044,7 @@ static float prepare_error_weight_block( variance.set_lane<1>(fvar * mixing + variance.lane<1>() * (1.0f - mixing)); variance.set_lane<2>(fvar * mixing + variance.lane<2>() * (1.0f - mixing)); - // TODO: Vectorize this ... - vfloat4 stdev = vfloat4(astc::sqrt(astc::max(variance.lane<0>(), 0.0f)), - astc::sqrt(astc::max(variance.lane<1>(), 0.0f)), - astc::sqrt(astc::max(variance.lane<2>(), 0.0f)), - astc::sqrt(astc::max(variance.lane<3>(), 0.0f))); + vfloat4 stdev = sqrt(max(variance, 0.0f)); vfloat4 scalea(ctx.config.v_rgb_mean, ctx.config.v_rgb_mean, ctx.config.v_rgb_mean, ctx.config.v_a_mean); avg = avg * scalea;
Change definition for ImGui Text Lua binding Right now, we really expose only TextUnformatted... So let's avoid extra overhead of snprintf when it is not really required in the end in current implementation.
@@ -164,7 +164,7 @@ namespace sol_ImGui // Widgets: Text inline void TextUnformatted(const std::string& text) { ImGui::TextUnformatted(text.c_str()); } - inline void Text(const std::string& text) { ImGui::Text(text.c_str()); } + inline void Text(const std::string& text) { ImGui::TextUnformatted(text.c_str()); } // TODO - make this proper call to ImGui::Text, allowing real formatting! inline void TextColored(float colR, float colG, float colB, float colA, const std::string& text) { ImGui::TextColored({ colR, colG, colB, colA }, text.c_str()); } inline void TextDisabled(const std::string& text) { ImGui::TextDisabled(text.c_str()); } inline void TextWrapped(const std::string text) { ImGui::TextWrapped(text.c_str()); }
Add DEBUG and ERROR logging to help diagnose problems when starting a Windows Service. Fix change entry.
</properties> <body> <release version="1.1.0" date="2017-MM-DD" description="Feature and bug fix release"> - <action issue="DAEMON-368" type="update" dev="ggregory" type="add"> + <action issue="DAEMON-368" type="add" dev="ggregory"> Add DEBUG and ERROR logging to help diagnose problems when starting a Windows Service. </action> <action type="update" dev="markt">
vcl:fix segfault when unshare NO_MQ session Session in LISTEN_NO_MQ state has no vpp_evt_q.This would cause a segfault when vcl try to send msg to vpp. Type: fix
@@ -710,6 +710,7 @@ vls_unshare_session (vcl_locked_session_t * vls, vcl_worker_t * wrk) * Check if we can change owner or close */ vls_shd->owner_wrk_index = vls_shd->workers_subscribed[0]; + if (s->session_state != VCL_STATE_LISTEN_NO_MQ) vcl_send_session_worker_update (wrk, s, vls_shd->owner_wrk_index); /* XXX is this still needed? */
Added copy of strings in order to avoid segmentation fault in python port.
@@ -85,7 +85,27 @@ extern "C" { } %#endif - $1[iterator] = str; + $1[iterator] = (char *)malloc(sizeof(char) * (length + 1)); + + if ($1[iterator] == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid string path allocation"); + + size_t alloc_iterator; + + for (alloc_iterator = 0; alloc_iterator < iterator; ++alloc_iterator) + { + free($1[iterator]); + } + + free($1); + + SWIG_fail; + } + + memcpy($1[iterator], str, length + 1); + + $1[iterator][length] = '\0'; } } } @@ -187,11 +207,16 @@ extern "C" { { const char * tag = (const char *)arg1; - const char ** paths = (const char **)arg2; + char ** paths = (char **)arg2; - size_t size = arg3; + size_t iterator, size = arg3; - result = metacall_load_from_file(tag, paths, size); + result = metacall_load_from_file(tag, (const char **)paths, size); + + for (iterator = 0; iterator < size; ++iterator) + { + free(paths[iterator]); + } free(paths); }
Add build section for mbedTLS config This makes it easier to choose the mbedTLS config file when multiple features share files.
@@ -35,7 +35,6 @@ fn main() { conf.define("MCUBOOT_SIGN_RSA", None); conf.define("MCUBOOT_USE_MBED_TLS", None); - conf.define("MBEDTLS_CONFIG_FILE", Some("<config-rsa.h>")); conf.include("mbedtls/include"); conf.file("mbedtls/library/sha256.c"); conf.file("csupport/keys.c"); @@ -49,7 +48,6 @@ fn main() { conf.define("MCUBOOT_SIGN_EC256", None); conf.define("MCUBOOT_USE_TINYCRYPT", None); - conf.define("MBEDTLS_CONFIG_FILE", Some("<config-asn1.h>")); conf.include("../../ext/mbedtls/include"); conf.include("../../ext/tinycrypt/lib/include"); @@ -79,7 +77,6 @@ fn main() { conf.define("MCUBOOT_ENCRYPT_RSA", None); conf.define("MCUBOOT_ENC_IMAGES", None); conf.define("MCUBOOT_USE_MBED_TLS", None); - conf.define("MBEDTLS_CONFIG_FILE", Some("<config-rsa.h>")); conf.file("../../boot/bootutil/src/encrypted.c"); conf.file("csupport/keys.c"); @@ -102,7 +99,6 @@ fn main() { conf.define("MCUBOOT_ENCRYPT_KW", None); conf.define("MCUBOOT_ENC_IMAGES", None); conf.define("MCUBOOT_USE_MBED_TLS", None); - conf.define("MBEDTLS_CONFIG_FILE", Some("<config-kw.h>")); conf.file("../../boot/bootutil/src/encrypted.c"); conf.file("csupport/keys.c"); @@ -118,6 +114,14 @@ fn main() { conf.file("mbedtls/library/aes.c"); } + if sig_rsa || enc_rsa { + conf.define("MBEDTLS_CONFIG_FILE", Some("<config-rsa.h>")); + } else if sig_ecdsa { + conf.define("MBEDTLS_CONFIG_FILE", Some("<config-asn1.h>")); + } else if enc_kw { + conf.define("MBEDTLS_CONFIG_FILE", Some("<config-kw.h>")); + } + conf.file("../../boot/bootutil/src/image_validate.c"); if sig_rsa { conf.file("../../boot/bootutil/src/image_rsa.c");
Fix typo in the documentation's example reading class The example C_IStream::read() function should return !feof(), not feof()
@@ -1462,7 +1462,7 @@ exception. If ``read(c,n)`` hits the end of the file after reading throw Iex::InputExc ("Unexpected end of file."); } - return feof (_file); + return !feof (_file); } ``tellg()`` returns the current reading position, in bytes, from the
CI: Not showing stdout nor stderr when checkout ref
@@ -68,7 +68,7 @@ if __name__ == "__main__": for candidate in candidate_branches: try: - subprocess.check_call(["git", "checkout", candidate]) + subprocess.check_call(["git", "checkout", candidate], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # not print the stdout nor stderr print("CI using ref {} for project {}".format(candidate, args.project)) break except subprocess.CalledProcessError:
btc-wallet: fix various assertions
~| "no wallet with xpub" =/ wal (~(got by walts) u.curr-xpub) ~| "wallet not scanned yet" - ?> ?!(scanned.wal) + ?> scanned.wal =/ [tb=(unit txbu) chng=(unit sats)] %~ with-change sut:bl :* wal eny.bowl ~| "no wallet with xpub" =/ wal (~(got by walts) u.curr-xpub) ~| "wallet not scanned yet" - ?> ?!(scanned.wal) + ?> scanned.wal =/ [addr=address =idx w=walt] ~(gen-address wad:bl wal %0) :_ state(walts (~(put by walts) u.curr-xpub w)) ~| "no wallet with xpub" =/ wal=walt (~(got by walts) xpub) ~| "wallet not scanned yet" - ?> ?!(scanned.wal) + ?> scanned.wal =/ [addr=address =idx w=walt] ~(gen-address wad:bl wal chyg) [addr state(walts (~(put by walts) xpub w))] :: %give-pay-address ~| "Can't pay ourselves" - ?> =(src.bowl our.bowl) + ?< =(src.bowl our.bowl) ~| "Broadcasting a transaction" - ?> is-broadcasting:hc + ?< is-broadcasting:hc ?~ curr-xpub ~|("btc-wallet-hook: no curr-xpub set" !!) ?: (is-dust:hc value.act address.act) %- (slog ~[leaf+"sending dust"]) ~| "no wallet with xpub" =/ wal (~(got by walts) xpub) ~| "wallet not scanned yet" - ?> ?!(scanned.wal) + ?> scanned.wal =/ [tb=(unit txbu) chng=(unit sats)] %~ with-change sut:bl [wal eny.bowl block.btc-state payee feyb txos]
evp_extra_test: Do not manipulate providers in default context Otherwise the with OPENSSL_TEST_RAND_ORDER following tests will be broken. There is also no real need to do that. Fixes
@@ -2418,15 +2418,13 @@ err: static int test_EVP_rsa_pss_with_keygen_bits(void) { int ret; - OSSL_PROVIDER *provider; EVP_PKEY_CTX *ctx; EVP_PKEY *pkey; const EVP_MD *md; pkey = NULL; ret = 0; - provider = OSSL_PROVIDER_load(NULL, "default"); - md = EVP_get_digestbyname("sha256"); + md = EVP_get_digestbyname("sha256"); ret = TEST_ptr((ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA_PSS, NULL))) && TEST_true(EVP_PKEY_keygen_init(ctx)) && TEST_int_gt(EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, 512), 0) @@ -2435,7 +2433,6 @@ static int test_EVP_rsa_pss_with_keygen_bits(void) EVP_PKEY_free(pkey); EVP_PKEY_CTX_free(ctx); - OSSL_PROVIDER_unload(provider); return ret; }
netlify: deploy wasm/simd128.h This actually just changes the command to use a small script which should automatically generate headers for simde/*/*.h so I don't forget to do this again in the future.
[build] publish = 'web' - command = 'mkdir -p web/amalgamated/x86 && (cd simde && for header in x86/*.h; do ../amalgamate.py "$header" > ../web/amalgamated/"$header"; done); mkdir -p web/amalgamated/arm && (cd simde/arm && ../../amalgamate.py neon.h > ../../web/amalgamated/arm/neon.h && ../../amalgamate.py sve.h > ../../web/amalgamated/arm/sve.h)' + command = ''' + for header in simde/*/*.h; do + header="$(echo "$header" | cut -b7-)" + mkdir -p web/amalgamated/$(dirname "$header"); + ./amalgamate.py "simde/$header" > web/amalgamated/"${header}"; + done + ''' [[headers]] for = "/amalgamated/*/*.h"
Add bpf_override_return() helper definition
@@ -299,6 +299,8 @@ static int (*bpf_skb_change_head)(void *ctx, u32 len, u64 flags) = (void *) BPF_FUNC_skb_change_head; static int (*bpf_xdp_adjust_head)(void *ctx, int offset) = (void *) BPF_FUNC_xdp_adjust_head; +static int (*bpf_override_return)(void *pt_regs, unsigned long rc) = + (void *) BPF_FUNC_override_return; /* llvm builtin functions that eBPF C program may use to * emit BPF_LD_ABS and BPF_LD_IND instructions
llrint -> llround to be independent of floating point environment.
@@ -187,7 +187,7 @@ namespace NCB { return NCB::TSimpleIndexRangesGenerator<TSize>( NCB::TIndexRange<TSize>(parallelizableUnitsCount), std::max( - (TSize)std::llrint( + (TSize)std::llround( double(parallelizableUnitsCount) / double(Size()) * double(approximateBlockSize)
single addr was better
@@ -268,11 +268,11 @@ _negative_response_codes = { } class CanClient(): - def __init__(self, can_send: Callable[[Tuple[int, bytes, int]], None], can_recv: Callable[[], List[Tuple[int, int, bytes, int]]], tx_addr: int, rx_addrs: int, bus: int, debug: bool=False): + def __init__(self, can_send: Callable[[Tuple[int, bytes, int]], None], can_recv: Callable[[], List[Tuple[int, int, bytes, int]]], tx_addr: int, rx_addr: int, bus: int, debug: bool=False): self.tx = can_send self.rx = can_recv self.tx_addr = tx_addr - self.rx_addrs = rx_addrs + self.rx_addr = rx_addr self.bus = bus self.debug = debug @@ -284,7 +284,7 @@ class CanClient(): if self.debug: print("CAN-RX: drain - {}".format(len(msgs))) else: for rx_addr, rx_ts, rx_data, rx_bus in msgs or []: - if rx_bus == self.bus and rx_addr in self.rx_addrs and len(rx_data) > 0: + if rx_bus == self.bus and rx_addr == self.rx_addr and len(rx_data) > 0: rx_data = bytes(rx_data) # convert bytearray to bytes if self.debug: print(f"CAN-RX: {hex(rx_addr)} - 0x{bytes.hex(rx_data)}") msg_array.append(rx_data) @@ -430,7 +430,7 @@ class UdsClient(): raise ValueError("invalid tx_addr: {}".format(tx_addr)) self.timeout = timeout self.debug = debug - self._can_client = CanClient(panda.can_send, panda.can_recv, self.tx_addr, [self.rx_addr], self.bus, debug=self.debug) + self._can_client = CanClient(panda.can_send, panda.can_recv, self.tx_addr, self.rx_addr, self.bus, debug=self.debug) # generic uds request def _uds_request(self, service_type: SERVICE_TYPE, subfunction: int=None, data: bytes=None) -> bytes:
xscom-utils: Rework getsram Allow specifying a file on the command line to read OCC SRAM data into. If no file is specified then we print it to stdout as text. This is a bit inconsistent, but it retains compatibility with the existing tool.
static void print_usage(int code) { - printf("usage: getsram [-c|--chip chip-id] addr\n"); - printf(" [--occ-channel|n <chan>]\n"); - printf(" getsram -v|--version\n"); + printf("usage: getsram [opts] addr\n"); + printf(" -c|--chip <chip-id>\n"); + printf(" -l|--length <size to read>\n"); + printf(" -n|--occ-channel <chan>\n"); + printf(" -f|--file <filename>\n"); + printf(" -v|--version\n"); exit(code); } @@ -36,10 +39,12 @@ extern const char version[]; int main(int argc, char *argv[]) { - uint64_t val, addr = -1ull; + uint64_t val, addr = -1ull, length = 8; uint32_t def_chip, chip_id = 0xffffffff; int rc; int occ_channel = 0; + char *filename = NULL; + FILE *f = stdout; while(1) { static struct option long_opts[] = { @@ -47,10 +52,12 @@ int main(int argc, char *argv[]) {"occ-channel", required_argument, NULL, 'n'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, + {"length", required_argument, NULL, 'l'}, + {"file", required_argument, NULL, 'f'}, }; int c, oidx = 0; - c = getopt_long(argc, argv, "-c:n:hlv", long_opts, &oidx); + c = getopt_long(argc, argv, "-c:n:hl:vf:", long_opts, &oidx); if (c == EOF) break; switch(c) { @@ -73,6 +80,13 @@ int main(int argc, char *argv[]) case 'v': printf("xscom utils version %s\n", version); exit(0); + case 'f': + filename = optarg; + break; + case 'l': + length = strtoul(optarg, NULL, 0); + length = (length + 7) & ~0x7; /* round up to an eight byte interval */ + break; default: exit(1); } @@ -91,11 +105,37 @@ int main(int argc, char *argv[]) if (chip_id == 0xffffffff) chip_id = def_chip; + if (filename) { + f = fopen(filename, "wb"); + if (!f) { + fprintf(stderr, "unable to open %s for writing\n", filename); + exit(1); + } + } + + rc = 0; + while (length) { rc = sram_read(chip_id, occ_channel, addr, &val); + if (rc) + break; + + if (f) { + int i; + + /* make sure we write it out big endian */ + for (i = 1; i <= 8; i++) + fputc((val >> (64 - i * 8)) & 0xff, f); + } else { + printf("OCC%d: %" PRIx64 "\n", occ_channel, val); + } + + length -= 8; + addr += 8; + } + if (rc) { fprintf(stderr,"Error %d reading XSCOM\n", rc); exit(1); } - printf("OCC%d: %" PRIx64 "\n", occ_channel, val); return 0; }
[stat_cache] fix compilation error for cmake
@@ -750,7 +750,7 @@ void stat_cache_delete_entry(server *srv, const char *name, size_t len) } } -#if HAVE_FAM_H +#ifdef HAVE_FAM_H static void stat_cache_invalidate_entry(server *srv, const char *name, size_t len) {
Memory leaks in grib_merge tool
@@ -318,6 +318,16 @@ static grib_handle* merge(grib_handle* h1, grib_handle* h2) grib_set_double_array(h, "values", v, n); + grib_context_free(h->context, v); + grib_context_free(h->context, v1); + grib_context_free(h->context, v2); + grib_context_free(h->context, lat); + grib_context_free(h->context, lat1); + grib_context_free(h->context, lat2); + grib_context_free(h->context, lon); + grib_context_free(h->context, lon1); + grib_context_free(h->context, lon2); + return h; }
improve envfile
@@ -267,7 +267,7 @@ function info(key) assert(os.isfile(os.projectfile()), "xmake.lua not found!") print("[%s]", path.filename(os.projectdir())) elseif key == "envfile" then - print("%s", os.tmpfile()) + print(os.tmpfile()) elseif key:startswith("script.") then local shell = key:match("script%.(.+)") print(_get_env_script(_package_getenvs(), shell, false))
Fix inverted condition in _Atomic declaration fixes
@@ -642,6 +642,7 @@ void gotoblas_profile_init(void); void gotoblas_profile_quit(void); #ifdef USE_OPENMP + #ifndef C_MSVC int omp_in_parallel(void); int omp_get_num_procs(void); @@ -649,12 +650,15 @@ int omp_get_num_procs(void); __declspec(dllimport) int __cdecl omp_in_parallel(void); __declspec(dllimport) int __cdecl omp_get_num_procs(void); #endif + #if (__STDC_VERSION__ >= 201112L) +#include <stdatomic.h> +#else #ifndef _Atomic #define _Atomic volatile #endif -#include <stdatomic.h> #endif + #else #ifdef __ELF__ int omp_in_parallel (void) __attribute__ ((weak));
autoload clustershell
@@ -80,6 +80,12 @@ prepend-path MANPATH %{install_path}/share/man setenv %{pname}_DIR %{install_path} +# Autoload Clustershell +if [ expr [ module-info mode load ] || [module-info mode display ] ] { + if { ![is-loaded clustershell] } { + module load clustershell + } +} EOF %clean
Changelog: Mention `devices` command update
@@ -47,6 +47,7 @@ OpenCore Changelog - Fixed CPU multiplier detection on pre-Nehalem Intel CPUs - Fixed incorrect handling of multiple processors and processor cache in SMBIOS - Matched default Apple boot picker cursor start position +- Updated OpenShell `devices` command to support misaligned device names returned by some Apple firmware #### v0.6.7 - Fixed ocvalidate return code to be non-zero when issues are found
Now checks the EIP712Domain chain ID
#include "ui_logic.h" #include "ethUtils.h" // KECCAK256_HASH_BYTESIZE #include "context.h" // contract_addr +#include "utils.h" // u64_from_BE static s_field_hashing *fh = NULL; @@ -160,9 +161,10 @@ bool field_hash(const uint8_t *data, // deallocate it mem_dealloc(len); + if (path_get_root_type() == ROOT_DOMAIN) + { // copy contract address into context - if ((path_get_root_type() == ROOT_DOMAIN) - && (strncmp(key, "verifyingContract", keylen) == 0)) + if (strncmp(key, "verifyingContract", keylen) == 0) { if (data_length != sizeof(eip712_context->contract_addr)) { @@ -171,6 +173,21 @@ bool field_hash(const uint8_t *data, } memcpy(eip712_context->contract_addr, data, data_length); } + else if (strncmp(key, "chainId", keylen) == 0) + { + uint64_t chainId = u64_from_BE(data, data_length); + + if (chainId != chainConfig->chainId) + { + PRINTF("EIP712Domain chain ID mismatch, expected 0x%.*h, got 0x%.*h !\n", + sizeof(chainConfig->chainId), + &chainConfig->chainId, + sizeof(chainId), + &chainId); + return false; + } + } + } path_advance(); fh->state = FHS_IDLE; ui_712_finalize_field();
BugID:16952646:[include] add missing headers in iot_export.h
@@ -193,6 +193,8 @@ int IOT_Ioctl(int option, void *data); #include "exports/iot_export_http.h" #include "exports/iot_export_event.h" #include "exports/iot_export_subdev.h" +#include "exports/iot_export_http2.h" +#include "exports/iot_export_file_uploader.h" #if defined(__cplusplus) }
sys/log: Make sure watermark is updated for each log after read Watermark should be updated after entries are properly encoded for each log.
@@ -454,6 +454,10 @@ log_nmgr_read(struct mgmt_cbuf *cb) goto err; } +#if MYNEWT_VAL(LOG_READ_WATERMARK_UPDATE) + log_set_watermark(log, index); +#endif + /* If a log was found, encode and break */ if (name_len > 0) { break; @@ -466,10 +470,6 @@ log_nmgr_read(struct mgmt_cbuf *cb) rc = OS_EINVAL; } -#if MYNEWT_VAL(LOG_READ_WATERMARK_UPDATE) - log_set_watermark(log, index); -#endif - err: g_err |= cbor_encoder_close_container(&cb->encoder, &logs); g_err |= cbor_encode_text_stringz(&cb->encoder, "rc");
use 'jitter' instead of 'PDV' in output
@@ -2019,18 +2019,18 @@ PrintJitterStats( switch(type){ case OWP_DELAY: - jitterdesc = stats->hdr->twoway ? "two-way PDV" : "one-way jitter"; + jitterdesc = stats->hdr->twoway ? "two-way" : "one-way"; break; case TWP_FWD_DELAY: - jitterdesc = "send PDV"; + jitterdesc = "send"; break; case TWP_BCK_DELAY: - jitterdesc = "reflect PDV"; + jitterdesc = "reflect"; break; default: return; } - fprintf(output,"%s = %s %s (P95-P50)\n", + fprintf(output,"%s jitter = %s %s (P95-P50)\n", jitterdesc,n1val,stats->scale_abrv); }
os/tools/mkheader : Add ram information support Added ram information in binary header. So the script supports add the ram information. It is used to allocate ram partition when binary manager loads binary.
@@ -23,10 +23,15 @@ import struct # # header information : # -# / header size (2byte) / binary type (2byte) / binary size (4byte) -# / Binary name (16byte) / Binary version (16byte) -# / Kernel version (8byte) / Jump address (4byte) -# header size is 52byte. +# total header size is 56bytes. +# +------------------------------------------------------------------------ +# | Header size | Binary type | Binary size | Binary name | Binary version +# | (2bytes) | (2bytes) | (4bytes) | (16bytes) | (16bytes) +# +------------------------------------------------------------------------ +# ---------------------------------------------------+ +# | Binary ram size | Kernel version | Jump address | +# | (16bytes) | (8bytes) | (4bytes) | +# ---------------------------------------------------+ # # parameter information : # @@ -35,6 +40,7 @@ import struct # argv[3] is kernel version. # argv[4] is binary name. # argv[5] is binary version. +# argv[6] is a ram size required to run this binary. # ############################################################################ @@ -43,6 +49,7 @@ binary_type = sys.argv[2] kernel_ver = sys.argv[3] binary_name = sys.argv[4] binary_ver = sys.argv[5] +binary_ram_size = sys.argv[6] # This path is only for dbuild. tinyara_path = 'root/tizenrt/build/output/bin/tinyara' @@ -53,10 +60,11 @@ BINARY_TYPE_S = 2 BINARY_SIZE_S = 4 BINARY_NAME_S = 16 BINARY_VERSION_S = 16 +BINARY_RAM_SIZE_S = 4 KERNEL_VERSION_S = 8 JUMP_ADDRESS_S = 4 -header_size = HEADER_SIZE_S + BINARY_TYPE_S + BINARY_SIZE_S + BINARY_NAME_S + BINARY_VERSION_S + KERNEL_VERSION_S + JUMP_ADDRESS_S +header_size = HEADER_SIZE_S + BINARY_TYPE_S + BINARY_SIZE_S + BINARY_NAME_S + BINARY_VERSION_S + KERNEL_VERSION_S + BINARY_RAM_SIZE_S + JUMP_ADDRESS_S ELF = 1 BIN = 2 @@ -81,6 +89,7 @@ with open(file_path, 'rb') as fp: fp.write(struct.pack('I', file_size)) fp.write('{:{}{}.{}}'.format(binary_name, '<', BINARY_NAME_S, BINARY_NAME_S - 1).replace(' ','\0')) fp.write('{:{}{}.{}}'.format(binary_ver, '<', BINARY_VERSION_S, BINARY_VERSION_S - 1).replace(' ','\0')) + fp.write(struct.pack('I', int(binary_ram_size))) fp.write('{:{}{}.{}}'.format(kernel_ver, '<', KERNEL_VERSION_S, KERNEL_VERSION_S - 1).replace(' ','\0')) # parsing _vector_start address from elf information.
jenkins: add Exception info to mail
@@ -171,6 +171,8 @@ try { } catch(Exception e) { if (isMaster()) { // If master is failing we want to know ASAP so send a mail. + + // collect changes since last build def changes = currentBuild.changeSets.collect() { it.collect() { "* ${it.getCommitId().take(7)} - ${it.getAuthor()} - ${it.getMsg().take(40)}" @@ -183,6 +185,7 @@ try { def message = """\ Build ${JOB_NAME}:${BUILD_NUMBER} failed. Url: ${RUN_DISPLAY_URL} +Reason: ${e} Changes: ${RUN_CHANGES_DISPLAY_URL} ${changes}
docs: Added FAQs for generating contracts file issue issue
@@ -891,6 +891,16 @@ E.g. : BCHAR *result_str; result_str = StoreRead_saveList(&tx_ctx, (BUINT8 *)"HelloWorld"); ``` +#### Frequently Asked Questions +**Q:The following error is reported when compiling** +``` + for abi_item in self.abi_object['abi']: +TypeError: list indices must be integers, not str +``` +A:The problem is caused by using the wrong input file. This input file should be the complete JSON file which is generated by the compiler. If just the contents of the ABI is copied and a JSON file is created, the ABI is need to add on the outermost layer. For specific format, please refer to: +https://github.com/aitos-io/BoAT-X-Framework/issues/355 + + ### Manually Construct Contract Calls If the automatic generation tool cannot generate the C call interface, you need to manually construct the transaction message. In addition, because the Fabric and hwbcs invocation itself is so convenient that there is no need to use automatically generate interface tools, all contracts need to be invoked manually.
Directory Value: Replace `typedef` statement
@@ -25,7 +25,7 @@ using CppKeySet = kdb::KeySet; constexpr ssize_t arrayValuePrefixSize = sizeof (ARRAY_VALUE_PREFIX) - 1; -typedef pair<CppKeySet, CppKeySet> KeySetPair; +using KeySetPair = pair<CppKeySet, CppKeySet>; // -- Functions ----------------------------------------------------------------------------------------------------------------------------
fix(config.h): update default termname
@@ -60,7 +60,7 @@ static int bold_font = 0; static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400"; static unsigned int xfps = 120; static unsigned int actionfps = 30; -static char *termname = "st-256color"; +static char *termname = "xst-256color"; static char *colorname[] = { "#1e1e1e", "#cf6a4c",
internal/refcount.h: allow non-atomic build Configure with -DOPENSSL_DEV_NO_ATOMICS and you get refcount without atomics. This is intended for internal development only, to check the refcounting is properly coded. It should never become a configuration option, hence the name of the macro.
# endif # endif +# ifndef OPENSSL_DEV_NO_ATOMICS # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ && !defined(__STDC_NO_ATOMICS__) # include <stdatomic.h> @@ -114,7 +115,15 @@ static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *lock) } # endif -# else +# endif +# endif /* !OPENSSL_DEV_NO_ATOMICS */ + +/* + * All the refcounting implementations above define HAVE_ATOMICS, so if it's + * still undefined here (such as when OPENSSL_DEV_NO_ATMOICS is defined), it + * means we need to implement a fallback. This fallback uses locks. + */ +# ifndef HAVE_ATOMICS typedef int CRYPTO_REF_COUNT;
Removed strange profiler-breaking code.
@@ -142,7 +142,11 @@ _t_samp_process(u3_road* rod_u) // { u3_noun laj = _t_jet_label(rod_u, bat); - if ( u3_none == laj ) { abort(); } + + if ( u3_none == laj ) { + don = u3t(don); + continue; + } // lab = u3nc(u3i_string("foobar"), u3_nul); lab = u3a_take(laj); u3a_wash(laj);
Performance: prune nearest neighbours
@@ -352,7 +352,7 @@ int grib_nearest_find_generic( double* values, double* distances, int* indexes, size_t* len) { int ret = 0, i = 0; - size_t nvalues = 0; + size_t nvalues = 0, nneighbours = 0; long iradius; double radius; grib_iterator* iter = NULL; @@ -467,9 +467,10 @@ int grib_nearest_find_generic( } ++the_index; } + nneighbours = i; /* Sort the candidate neighbours in ascending order of distance */ /* The first 4 entries will now be the closest 4 neighbours */ - qsort(neighbours, nvalues, sizeof(PointStore), &compare_points); + qsort(neighbours, nneighbours, sizeof(PointStore), &compare_points); grib_iterator_delete(iter); } @@ -477,7 +478,7 @@ int grib_nearest_find_generic( /* Sanity check for sorting */ #ifdef DEBUG - for (i = 0; i < nvalues - 1; ++i) { + for (i = 0; i < nneighbours - 1; ++i) { Assert(neighbours[i].m_dist <= neighbours[i + 1].m_dist); } #endif
py/scheduler: Add missing MICROPY_WRAP_MP_SCHED_EXCEPTION usage. This was missed in commit
#include "py/runtime.h" -void mp_sched_exception(mp_obj_t exc) { +void MICROPY_WRAP_MP_SCHED_EXCEPTION(mp_sched_exception)(mp_obj_t exc) { MP_STATE_VM(mp_pending_exception) = exc; #if MICROPY_ENABLE_SCHEDULER if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) {
Update: minigrid_ona.py: longer view distance, cone fixes, and scan fix for invisible cells
@@ -80,9 +80,8 @@ goal = "G" #Setup environment: env = gym.make('MiniGrid-Empty-6x6-v0').env env.reset(seed=1337) -viewDistance=3 #how many cells forward the agent can see -def coneForward(): +def coneForward(viewDistance=6): L=[] index = 0 StartIndexX, StartIndexY = (2,5) @@ -94,14 +93,13 @@ def coneForward(): L.append((indexX, indexY, k)) indexX += 1 index+=1 - StartIndexX -=1 + StartIndexX = max(0, StartIndexX - 1) indexX=StartIndexX indexY -=1 - width+=2 - L[0], L[1] = L[1], L[0] #make 3,5 the first element + width=min(7,width+2) return L -def coneRight(): +def coneRight(viewDistance=3): L=[] StartIndexX, StartIndexY = (3,6) indexX, indexY = (StartIndexX,StartIndexY) @@ -113,9 +111,10 @@ def coneRight(): StartIndexX+=1 indexX = StartIndexX indexY-=1 + L.insert(1, (4,5,1)) return L -def coneLeft(): +def coneLeft(viewDistance=3): L=[] StartIndexX, StartIndexY = (3,6) indexX, indexY = (StartIndexX,StartIndexY) @@ -127,21 +126,18 @@ def coneLeft(): StartIndexX-=1 indexX = StartIndexX indexY-=1 + L.insert(1, (2,5,1)) return L def scan(cone, cells, colorBlind=True, wall=False): if colorBlind: cells[3][6][1] = 0 L = cone() - k = 0 for (x,y,distance) in L: if colorBlind: cells[x][y][1] = 0 - if cells[x][y][0] != 1 and (k==0 or wall==False or cells[x][y][0] != 2): #a seen object or physical contact with a wall - if cells[x][y][0] == 0: - cells[x][y][0] = 1 #behind wall indicator, so we see nothing + if cells[x][y][0] != 0 and cells[x][y][0] != 1 and (distance==0 or wall or cells[x][y][0] != 2): #a seen object or physical contact with a wall: #a seen object or physical contact with a wall return distance, cells[x][y] #return first non-empty cell - k += 1 if not wall: return scan(cone, cells, colorBlind=colorBlind, wall=True) #nearest wall return 9999, np.array([1,0,0])
check_interfaces() leave multicast group when ifindex changes
@@ -546,7 +546,6 @@ check_interfaces(void) ifindex = if_nametoindex(ifp->name); if(ifindex != ifp->ifindex) { debugf("Noticed ifindex change for %s.\n", ifp->name); - ifp->ifindex = 0; interface_up(ifp, 0); ifp->ifindex = ifindex; ifindex_changed = 1;
Updated the translator spec to include tests for exported symbols. Since the translator generates extra code, the tests had to be hardcoded using escape sequences to deal with whitespace characters.
@@ -320,6 +320,67 @@ describe("Pallene to Lua translator", function () ]]) end) + it("Generate return statement for exported variable", function () + assert_translation( + "export i : integer = 0", + + "local i = 0\n" .. + "return {\n" .. + " i = i,\n" .. + "}\n") + end) + + it("Generate return statement for exported function", function () + assert_translation( + "export function f() end", + "local function f() end\nreturn {\n f = f,\n}\n") + end) + + it("Generate the same return statement for both exported functions and variables", function () + assert_translation( + "export i : integer = 0\n" .. + "\n" .. + "export function f()\n" .. + "end", + + "local i = 0\n" .. + "\n" .. + "local function f()\n" .. + "end\n" .. + "return {\n" .. + " i = i,\n" .. + " f = f,\n" .. + "}\n") + end) + + it("Do not include local symbols in the module return statement", function () + assert_translation( + "export i : integer = 0\n" .. + "\n" .. + "export function a()\n" .. + "end\n" .. + "\n" .. + "local function s()\n" .. + "end\n" .. + "\n" .. + "local j : { integer } = { 1, 2, 3 }", + + "local i = 0\n" .. + "\n" .. + "local function a()\n" .. + "end\n" .. + "\n" .. + "local function s()\n" .. + "end\n" .. + "\n" .. + "local j = { 1, 2, 3 }" .. + "\n" .. + "return {\n" .. + " i = i,\n" .. + " a = a,\n" .. + "}\n") + end) + pending("Mutually recursive functions (infinite)", function () assert_translation([[ local function a()
tests: internal: stream_processor: initialize config task list
@@ -584,6 +584,8 @@ static void test_select_keys() return; } mk_list_init(&config->inputs); + mk_list_init(&config->stream_processor_tasks); + config->evl = mk_event_loop_create(256); sp = flb_sp_create(config); @@ -694,6 +696,7 @@ static void test_window() return; } mk_list_init(&config->inputs); + mk_list_init(&config->stream_processor_tasks); config->evl = mk_event_loop_create(256); sp = flb_sp_create(config);
Update comments in s2n_hybrid_ecdhe_sike_fuzz_test
* permissions and limitations under the License. */ -#include <pq-crypto/sike/sike_p503_kem.h> #include "crypto/s2n_crypto.h" #include "crypto/s2n_drbg.h" #include "crypto/s2n_hash.h" #include "crypto/s2n_openssl.h" - +#include "error/s2n_errno.h" +#include "pq-crypto/sike/sike_p503_kem.h" #include "stuffer/s2n_stuffer.h" - #include "tests/s2n_test.h" - #include "tests/testlib/s2n_testlib.h" - #include "tests/unit/s2n_nist_kats.h" - #include "tls/s2n_kex.h" #include "tls/s2n_kem.h" #include "tls/s2n_tls.h" - #include "utils/s2n_random.h" #include "utils/s2n_safety.h" #include "utils/s2n_safety.h" #include "tls/s2n_cipher_suites.h" -#include "error/s2n_errno.h" - - static struct s2n_kem_keypair server_kem_keys = {.negotiated_kem = &s2n_sike_supported_params[0]}; +/* Setup the connection in a state for a fuzz test run, s2n_client_key_recv modifies the state of the connection + * along the way and gets cleaned up at the end of each fuzz test. + * - Connection needs cipher suite, curve, and kem setup + * - Connection needs a ecdhe key and a kem private key, this would normally be setup when the server calls s2n_server_send_key + * */ static int setup_connection(struct s2n_connection *server_conn) { server_conn->actual_protocol_version = S2N_TLS12; @@ -50,8 +47,8 @@ static int setup_connection(struct s2n_connection *server_conn) server_conn->secure.conn_hash_alg = S2N_HASH_SHA384; GUARD(s2n_dup(&server_kem_keys.private_key, &server_conn->secure.s2n_kem_keys.private_key)); - /* s2n_ecdhe_client_key_recv will free the server's point so it needs to be recreated every run */ GUARD(s2n_ecc_generate_ephemeral_key(&server_conn->secure.server_ecc_params)); + return 0; } @@ -85,6 +82,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) GUARD(s2n_stuffer_write_bytes(&server_conn->handshake.io, buf, len)); } + /* The missing GUARD is because s2n_client_key_recv might fail due to bad input which is okay, the connection + * must still be cleaned up. Don't return s2n_client_key_recv's result because the the test still passes as long as + * s2n_client_key_recv does not leak/contaminate any memory, the fuzz input is most likely not valid and will fail + * to be recv'd successfully. */ s2n_client_key_recv(server_conn); GUARD(s2n_connection_free(server_conn));
Add buffer_read16be() Add a function to read 16 bits in big-endian to a uint16_t.
@@ -18,6 +18,11 @@ buffer_write32be(uint8_t *buf, uint32_t value) { buf[3] = value; } +static inline uint16_t +buffer_read16be(const uint8_t *buf) { + return (buf[0] << 8) | buf[1]; +} + static inline uint32_t buffer_read32be(const uint8_t *buf) { return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
[persistence] checked checkpoint success at chkpt_recovery_redo()
@@ -423,7 +423,7 @@ int chkpt_recovery_redo(void) logger->log(EXTENSION_LOG_INFO, NULL, "There are no files needed for recovery. " "Do checkpoint to create checkpoint file set.\n"); - if (do_checkpoint(cs) == CHKPT_ERROR) { + if (do_checkpoint(cs) != CHKPT_SUCCESS) { logger->log(EXTENSION_LOG_WARNING, NULL, "Checkpoint failed in chkpt_recovery_redo().\n"); return -1;
Completions: Add plugin suggestions for `info`
@@ -126,7 +126,7 @@ function __fish_kdb_needs_namespace -d 'Check if the current command needs a nam end function __fish_kdb_needs_plugin -d 'Check if the current command needs a plugin completion' - if __fish_kdb_subcommand_includes check + if __fish_kdb_subcommand_includes check info not __input_includes (__fish_kdb_print_plugins) return $status end
Remove testing for precise LSN/reserved bytes in new TAP test Trying to ensure that a slot's restart_lsn or amount of reserved bytes exactly match some specific values seems unnecessary, and fragile as shown by failures in multiple buildfarm members. Discussion:
@@ -121,8 +121,8 @@ $node_standby->stop; advance_wal($node_master, 6); # Slot gets into 'reserved' state -$result = $node_master->safe_psql('postgres', "SELECT restart_lsn, wal_status, pg_size_pretty(restart_lsn - min_safe_lsn) as remain FROM pg_replication_slots WHERE slot_name = 'rep1'"); -is($result, "$start_lsn|reserved|216 bytes", 'check that the slot state changes to "reserved"'); +$result = $node_master->safe_psql('postgres', "SELECT wal_status FROM pg_replication_slots WHERE slot_name = 'rep1'"); +is($result, "reserved", 'check that the slot state changes to "reserved"'); # do checkpoint so that the next checkpoint runs too early $node_master->safe_psql('postgres', "CHECKPOINT;"); @@ -131,8 +131,8 @@ $node_master->safe_psql('postgres', "CHECKPOINT;"); advance_wal($node_master, 1); # Slot gets into 'lost' state -$result = $node_master->safe_psql('postgres', "SELECT restart_lsn, wal_status, min_safe_lsn is NULL FROM pg_replication_slots WHERE slot_name = 'rep1'"); -is($result, "$start_lsn|lost|t", 'check that the slot state changes to "lost"'); +$result = $node_master->safe_psql('postgres', "SELECT wal_status FROM pg_replication_slots WHERE slot_name = 'rep1'"); +is($result, "lost", 'check that the slot state changes to "lost"'); # The standby still can connect to master before a checkpoint $node_standby->start;
Fix no-ec This was missed by Travis because, although it has a no-ec build, the test that failed only runs in a debug build. The Travis job with no-ec is not a debug build and so the test was skipped.
@@ -14,8 +14,8 @@ use OpenSSL::Test::Utils; setup("test_cmp_client"); -plan skip_all => "This test is not supported in a no-cmp build" - if disabled("cmp"); +plan skip_all => "This test is not supported in a no-cmp or no-ec build" + if disabled("cmp") || disabled("ec"); plan tests => 1;
Search / find pcap.h files
@@ -151,16 +151,21 @@ IF(NOT USE_HIDAPI) endif() set(driver_vive_ADDITIONAL_LIBS ${LIBUSB_LIBRARY}) -endif() -find_library(PCAP_LIBRARY pcap) + find_library(PCAP_LIBRARY pcap) if(PCAP_LIBRARY) list(APPEND PLUGINS driver_usbmon) + find_path(PCAP_INCLUDE_PATH NAMES pcap.h) + if(PCAP_INCLUDE_PATH) + include_directories(${PCAP_INCLUDE_PATH}) + endif() set(driver_usbmon_ADDITIONAL_LIBS "${PCAP_LIBRARY};z" driver_vive) else() message("Can't build usbmon plugin -- pcap library was not found") endif() +endif() + set(poser_barycentric_svd_ADDITIONAL_SRCS barycentric_svd/barycentric_svd.c )
detect driver crash immediately
@@ -1026,24 +1026,19 @@ while(1) showstatusflag = false; } pklen = read(fd_out, &packetin[PCAPREC_SIZE], PCAP_SNAPLEN-PCAPREC_SIZE); - packetcount++; + if(pklen < (int)RTH_SIZE) + { + errorcount++; + continue; + } gettimeofday(&tv, NULL); packetsave->ts_sec = tv.tv_sec; packetsave->ts_usec = tv.tv_usec; packetsave->incl_len = pklen; packetsave->orig_len = pklen; - if(pklen == -1) - { - errorcount++; - continue; - } - if(pklen < (int)RTH_SIZE) - { - continue; - } + packetcount++; rth = (rth_t*)&packetin[PCAPREC_SIZE]; rthlen = le16toh(rth->it_len); - macf = (mac_t*)&packetin[PCAPREC_SIZE +rthlen]; maclen = MAC_SIZE_NORM; if(macf->type == IEEE80211_FTYPE_CTL)
Enable optimizations + native
@@ -4,4 +4,4 @@ do Str=$Str" ${i%.c}.c" done echo $Str -gcc -DSDR_BLOCK_TYPE=__uint128_t -pedantic -std=c11 -g3 -o3 -Wall $Str -lm -oANSNA +gcc -DSDR_BLOCK_TYPE=__uint128_t -pedantic -std=c11 -g3 -O3 -march=native -Wall $Str -lm -oANSNA
memif: fix memif_process_desc indexing The index i was incremented in the wrong place, and the check on the presence of a next buffer in the chain was actually done for the next desc_status rather than the current one. Type: fix
@@ -247,7 +247,7 @@ memif_process_desc (vlib_main_t *vm, vlib_node_runtime_t *node, u32 n_buffers = 0; u32 n_left = ptd->n_packets; u32 packet_len; - int i = 0; + int i = -1; /* construct copy and packet vector out of ring slots */ while (n_left) @@ -261,6 +261,7 @@ memif_process_desc (vlib_main_t *vm, vlib_node_runtime_t *node, dst_off = start_offset; next_slot: + i++; /* next descriptor */ n_bytes_left = desc_len[i]; packet_len += n_bytes_left; @@ -287,9 +288,6 @@ memif_process_desc (vlib_main_t *vm, vlib_node_runtime_t *node, } while (PREDICT_FALSE (n_bytes_left)); - /* next descriptor */ - i++; - if (desc_status[i].next) { src_off = 0;
Remove warning when disabling Eco mode
@@ -2246,8 +2246,8 @@ BOOLEAN PhUiSetEcoModeProcess( if (NT_SUCCESS(status)) { if (!( - powerThrottlingState.ControlMask == POWER_THROTTLING_PROCESS_EXECUTION_SPEED && - powerThrottlingState.StateMask == POWER_THROTTLING_PROCESS_EXECUTION_SPEED + powerThrottlingState.ControlMask & POWER_THROTTLING_PROCESS_EXECUTION_SPEED && + powerThrottlingState.StateMask & POWER_THROTTLING_PROCESS_EXECUTION_SPEED )) { if (!PhGetIntegerSetting(L"EnableWarnings") || PhShowConfirmMessage( @@ -2274,13 +2274,13 @@ BOOLEAN PhUiSetEcoModeProcess( } else { - if (!PhGetIntegerSetting(L"EnableWarnings") || PhShowConfirmMessage( - WindowHandle, - L"disable", - L"Eco mode for this process", - L"Eco mode will lower process priority and improve power efficiency but may cause instability in some processes.", - FALSE - )) + //if (!PhGetIntegerSetting(L"EnableWarnings") || PhShowConfirmMessage( + // WindowHandle, + // L"disable", + // L"Eco mode for this process", + // L"Eco mode will lower process priority and improve power efficiency but may cause instability in some processes.", + // FALSE + // )) { PROCESS_PRIORITY_CLASS priorityClass;
[kernel] return the correct type for newtonMaxIteration()
@@ -329,8 +329,9 @@ public: /** get the maximum number of Newton iteration * \return maximum number of Newton solver iterations */ - double newtonMaxIteration() + unsigned int newtonMaxIteration() { + return _newtonMaxIteration; };
Docs: Issue template on github removed bitcoin and updated to Ravencoin (PR RavenProject#916).
<!--- Remove sections that do not apply --> -This issue tracker is only for technical issues related to bitcoin-core. +This issue tracker is only for technical issues related to Ravencoin. -General ravencoin questions and/or support requests and are best directed to the [Ravencoin Discord](https://discord.gg/GwtXdyc). +General Ravencoin questions and/or support requests and are best directed to the [Ravencoin Discord](https://discord.gg/GwtXdyc). For reporting security issues, please direct message one of the core developers in discord.
Optimize message dropping computation using oldest_msg
@@ -432,6 +432,12 @@ static inline error_return_t MsgAlloc_ClearMsgSpace(void *from, void *to) mem_stat->msg_drop_number++; } } + // check if there is a msg in the space we need + // Start by checking if the oldest message is out of scope + if (((uint32_t)oldest_msg >= (uint32_t)from) && ((uint32_t)oldest_msg <= (uint32_t)to)) + { + // We have to drop some messages for sure + mem_stat->buffer_occupation_ratio = 100; while (((uint32_t)luos_tasks[0].msg_pt >= (uint32_t)from) && ((uint32_t)luos_tasks[0].msg_pt <= (uint32_t)to) && (luos_tasks_stack_id > 0)) { // This message is in the space we want to use, clear the task @@ -439,6 +445,7 @@ static inline error_return_t MsgAlloc_ClearMsgSpace(void *from, void *to) if (mem_stat->msg_drop_number < 0xFF) { mem_stat->msg_drop_number++; + mem_stat->buffer_occupation_ratio = 100; } } // check if there is no msg between from and to on msg_tasks @@ -449,6 +456,7 @@ static inline error_return_t MsgAlloc_ClearMsgSpace(void *from, void *to) if (mem_stat->msg_drop_number < 0xFF) { mem_stat->msg_drop_number++; + mem_stat->buffer_occupation_ratio = 100; } } // check if there is no msg between from and to on tx_tasks @@ -459,6 +467,8 @@ static inline error_return_t MsgAlloc_ClearMsgSpace(void *from, void *to) if (mem_stat->msg_drop_number < 0xFF) { mem_stat->msg_drop_number++; + mem_stat->buffer_occupation_ratio = 100; + } } } // if we go here there is no reason to continue because newest messages can't overlap the memory zone.
define WIN32
cmake_minimum_required(VERSION 3.9) set(OUT_FILE "wasm3") + if(CLANG OR CLANG_SUFFIX) set(CMAKE_C_COMPILER "clang${CLANG_SUFFIX}") set(CMAKE_CXX_COMPILER "clang++${CLANG_SUFFIX}") @@ -70,7 +71,7 @@ if(EMSCRIPTEN) elseif(WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX- /diagnostics:column") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32 /WX- /diagnostics:column") if (CMAKE_C_COMPILER_ID MATCHES "MSVC") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi /Zo /Oxs /w /fp:fast /arch:AVX2")
Added usage of PROJECT_IS_TOP_LEVEL around find_package in CMakeLists.txt See
@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.9) project(VulkanMemoryAllocator) +if(PROJECT_IS_TOP_LEVEL) find_package(Vulkan REQUIRED) +endif() include_directories(${Vulkan_INCLUDE_DIR}) # VulkanMemoryAllocator contains an sample application which is not built by default @@ -30,7 +32,9 @@ if(VMA_BUILD_SAMPLE) set(VMA_BUILD_SAMPLE_SHADERS ON) endif(VMA_BUILD_SAMPLE) +if(PROJECT_IS_TOP_LEVEL) find_package(Doxygen) +endif() option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF) if(BUILD_DOCUMENTATION)
tweak flang usm test to make it an array
program test - integer :: i - i = 0 + integer :: i(5) + i(2) = 0 !$omp requires unified_shared_memory !$omp target - i = 1 + i(2) = 1 !$omp end target - if (i .ne. 1) then + if (i(2) .ne. 1) then print *,'failed' call exit(1) endif
core: fix tagged listeners for len < 8 Was not clearing an internal variable in the loop for reading listeners, so if you used a single -l command to create several tagged listeners and the first tag was longer than the next tag, it would not properly read the tag. tag tag tag.
@@ -3659,7 +3659,6 @@ static int server_socket(const char *interface, static int server_sockets(int port, enum network_transport transport, FILE *portnumber_file) { bool ssl_enabled = false; - uint64_t conntag = 0; #ifdef TLS const char *notls = "notls"; @@ -3667,7 +3666,7 @@ static int server_sockets(int port, enum network_transport transport, #endif if (settings.inter == NULL) { - return server_socket(settings.inter, port, transport, portnumber_file, ssl_enabled, conntag, settings.binding_protocol); + return server_socket(settings.inter, port, transport, portnumber_file, ssl_enabled, 0, settings.binding_protocol); } else { // tokenize them and bind to each one of them.. char *b; @@ -3683,6 +3682,7 @@ static int server_sockets(int port, enum network_transport transport, for (char *p = strtok_r(list, ";,", &b); p != NULL; p = strtok_r(NULL, ";,", &b)) { + uint64_t conntag = 0; int the_port = port; #ifdef TLS ssl_enabled = settings.ssl_enabled;
Modify the legacy provider to use OSSL_LIB_CTX_new_child()
@@ -178,13 +178,8 @@ int OSSL_provider_init(const OSSL_CORE_HANDLE *handle, { OSSL_LIB_CTX *libctx = NULL; - /* - * We do not need to use any up-calls provided by libcrypto, so we ignore - * the "in" dispatch table. - */ - if ((*provctx = ossl_prov_ctx_new()) == NULL - || (libctx = OSSL_LIB_CTX_new()) == NULL) { + || (libctx = OSSL_LIB_CTX_new_child(handle, in)) == NULL) { OSSL_LIB_CTX_free(libctx); legacy_teardown(*provctx); *provctx = NULL;
groups: allow line breaks in description prompt
import React, { useEffect, useMemo } from "react"; import { Association } from "~/types/metadata-update"; import { Box, Text, Button, Col, Center } from "@tlon/indigo-react"; +import RichText from '~/views/components/RichText'; import { Link, useHistory } from "react-router-dom"; import GlobalApi from "~/logic/api/global"; import { useWaitForProps } from "~/logic/lib/useWaitForProps"; @@ -84,7 +85,7 @@ export function UnjoinedResource(props: UnjoinedResourceProps) { <Text>{title}</Text> </Box> <Box mb={4}> - <Text color="gray">{description}</Text> + <RichText color="gray">{description}</RichText> </Box> <StatelessAsyncButton onClick={onJoin} mx="auto" border> Join Channel
config: new struct field to keep dynamic plugins context
@@ -95,6 +95,9 @@ struct flb_config { /* Collectors */ struct mk_list collectors; + /* Dynamic (dso) plugins context */ + void *dso_plugins; + /* Plugins references */ struct mk_list in_plugins; struct mk_list parser_plugins; /* not yet implemented */
review feedback: move free'ing along with other cleanup functions
@@ -119,9 +119,9 @@ static void init_request(struct st_h2o_http1_conn_t *conn) if (conn->req_body != NULL) h2o_buffer_dispose(&conn->req_body); h2o_dispose_request(&conn->req); - } if (conn->_unconsumed_request_size) h2o_buffer_consume(&conn->sock->input, conn->_unconsumed_request_size); + } assert(conn->req_body == NULL); h2o_init_request(&conn->req, &conn->super, NULL);
apps/ca.c: only output DER with SPKAC input and when -out is chosen So say the docs Fixes
@@ -722,7 +722,7 @@ end_of_options: /*****************************************************************/ if (req || gencrl) { - if (spkac_file != NULL) { + if (spkac_file != NULL && outfile != NULL) { output_der = 1; batch = 1; }
modify license text so that github can automatically detect the license type
-Copyright (c) 2017, the LSSTDESC CCL contributors are listed in the -documentation ("research note") provided with this software. The -repository can be found at https://github.com/LSSTDESC/CCL. +Copyright (c) 2018, the LSSTDESC CCL contributors. All rights reserved. +The LSSTDESC CCL contributors are listed in the documentation +("research note") provided with this software. The repository can be +found at https://github.com/LSSTDESC/CCL. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
proc/cond: spinlock fix condWait
@@ -58,6 +58,7 @@ int proc_condWait(unsigned int c, unsigned int m, time_t timeout) proc_threadUnprotect(); + hal_spinlockSet(&lock->spinlock); _proc_lockClear(lock); if (!(err = proc_threadWait(&rc->waitq, &lock->spinlock, timeout)))
example/opengl: use high level API, sixel_encoder_encode_bytes() instead of sixel_encode()
* original source: * https://cgit.freedesktop.org/mesa/demos/tree/src/xdemos/glxpbdemo.c * - * This file is distributed under the same licence as original's one. - * * original license: * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. #include <unistd.h> #include <memory.h> #include <math.h> +#include <errno.h> #if HAVE_TERMIOS_H # include <termios.h> #endif @@ -331,46 +330,27 @@ draw_scene(void) } -static int -sixel_write(char *data, int size, void *priv) -{ - return fwrite(data, 1, size, (FILE *)priv); -} - - static SIXELSTATUS output_sixel(unsigned char *pixbuf, int width, int height, - int ncolors, int pixelformat) + int pixelformat, int ncolors) { - sixel_output_t *context = NULL; - sixel_dither_t *dither = NULL; + sixel_encoder_t *encoder; SIXELSTATUS status; + char opt[256]; -#if USE_OSMESA - pixelformat = SIXEL_PIXELFORMAT_RGBA8888; -#endif - status = sixel_output_new(&output, sixel_write, stdout, NULL); + status = sixel_encoder_new(&encoder, NULL); if (SIXEL_FAILED(status)) - goto end; - status = sixel_dither_new(&dither, ncolors, NULL); - if (SIXEL_FAILED(status)) - goto end; - status = sixel_dither_initialize(dither, pixbuf, - width, height, - pixelformat, - SIXEL_LARGE_AUTO, - SIXEL_REP_AUTO, - SIXEL_QUALITY_AUTO); + return status; + if (sprintf(opt, "%d", ncolors) <= 0) + return SIXEL_LIBC_ERROR | (errno | 0xff); + status = sixel_encoder_setopt(encoder, SIXEL_OPTFLAG_COLORS, opt); if (SIXEL_FAILED(status)) - goto end; - status = sixel_encode(pixbuf, width, height, - pixelformat, dither, output); + return status; + status = sixel_encoder_encode_bytes( + encoder, pixbuf, width, height, pixelformat, NULL, (-1)); if (SIXEL_FAILED(status)) - goto end; - -end: - sixel_output_unref(output); - sixel_dither_unref(dither); + return status; + sixel_encoder_unref(encoder); return status; } @@ -511,13 +491,20 @@ main(int argc, char** argv) break; printf("\0338"); + fflush(stdout); #if USE_OSMESA pixbuf = pbuffer; #else glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixbuf); #endif - status = output_sixel(pixbuf, width, height, ncolors, - SIXEL_PIXELFORMAT_RGB888); + status = output_sixel( + pixbuf, width, height, +#if USE_OSMESA + SIXEL_PIXELFORMAT_RGBA8888, +#else + SIXEL_PIXELFORMAT_RGB888, +#endif + ncolors); if (SIXEL_FAILED(status)) { fprintf(stderr, "%s\n%s\n", sixel_helper_format_error(status),
Version-String change.
@@ -2286,21 +2286,10 @@ void get_sdk_info(char *info, size_t infoSize) snprintf(info, infoSize, "Unspecified, UPnP/1.0, Unspecified\r\n"); #else /* UPNP_ENABLE_UNSPECIFIED_SERVER */ #ifdef _WIN32 - OSVERSIONINFO versioninfo; - versioninfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - - if (GetVersionEx(&versioninfo) != 0) snprintf(info, infoSize, - "%d.%d.%d %d/%s, UPnP/1.0, Portable SDK for UPnP " - "devices/" UPNP_VERSION_STRING "\r\n", - versioninfo.dwMajorVersion, - versioninfo.dwMinorVersion, - versioninfo.dwBuildNumber, - versioninfo.dwPlatformId, - versioninfo.szCSDVersion); - else - *info = '\0'; + "UPnP/1.0, Portable SDK for UPnP devices/" UPNP_VERSION_STRING + "on windows\r\n"); #else int ret_code; struct utsname sys_info;
Refactor is_encrypt into aead setup arguments Avoid touching the operation until later.
@@ -3403,6 +3403,7 @@ static psa_algorithm_t psa_aead_get_base_algorithm( psa_algorithm_t alg ) /* Set the key for a multipart authenticated operation. */ static psa_status_t psa_aead_setup( psa_aead_operation_t *operation, + int is_encrypt, mbedtls_svc_key_id_t key, psa_algorithm_t alg ) { @@ -3430,7 +3431,7 @@ static psa_status_t psa_aead_setup( psa_aead_operation_t *operation, goto exit; } - if( operation->is_encrypt ) + if( is_encrypt ) key_usage = PSA_KEY_USAGE_ENCRYPT; else key_usage = PSA_KEY_USAGE_DECRYPT; @@ -3445,7 +3446,7 @@ static psa_status_t psa_aead_setup( psa_aead_operation_t *operation, .core = slot->attr }; - if( operation->is_encrypt ) + if( is_encrypt ) status = psa_driver_wrapper_aead_encrypt_setup( operation, &attributes, slot->key.data, @@ -3472,6 +3473,7 @@ exit: { status = unlock_status; operation->alg = psa_aead_get_base_algorithm( alg ); + operation->is_encrypt = is_encrypt; } else psa_aead_abort( operation ); @@ -3484,9 +3486,7 @@ psa_status_t psa_aead_encrypt_setup( psa_aead_operation_t *operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg ) { - operation->is_encrypt = 1; - - return( psa_aead_setup( operation, key, alg ) ); + return( psa_aead_setup( operation, 1, key, alg ) ); } /* Set the key for a multipart authenticated decryption operation. */ @@ -3494,9 +3494,7 @@ psa_status_t psa_aead_decrypt_setup( psa_aead_operation_t *operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg ) { - operation->is_encrypt = 0; - - return( psa_aead_setup( operation, key, alg ) ); + return( psa_aead_setup( operation, 0, key, alg ) ); } /* Generate a random nonce / IV for multipart AEAD operation */
Metadata: Fix minor spelling mistake
@@ -115,7 +115,7 @@ type=namespace status=implemented usedby/api= ksLookup description=Typically all namespaces are cascaded one after the other - in the build-in order. + in the built-in order. Using this metadata you can avoid that some namespaces are used or can change the order.
fix cuda build __FORCE_COMMIT__
@@ -676,7 +676,11 @@ struct THash<TIntrusiveConstPtr<T, Ops>> : THash<const T*> { template <class T, class Ops> class TSimpleIntrusiveOps { - using TFunc = void (*)(T*) noexcept; + using TFunc = void (*)(T*) +#if __cplusplus >= 201703 + noexcept +#endif + ; static void DoRef(T* t) noexcept { Ops::Ref(t);
cooja-radio.c: update comments to fix spelling and grammar
@@ -60,19 +60,19 @@ const struct simInterface radio_interface; -/* There radio driver can provide cooja it's nosignal value. - * But at present, cooja ignore and override it. +/* The radio driver can provide Cooja these values. + * But at present, Cooja ignores and overrides them. * */ enum { /* - * Tmote Sky (with CC2420 radio) give value -100dB - * CC1310 gives value about -110dB + * Tmote Sky (with CC2420 radio) gives value -100dB + * CC1310 gives about -110dB */ RSSI_NO_SIGNAL = -110, /* - * Tmote Sky (with CC2420 radio) give value 105 - * CC1310 gives value about 100? + * Tmote Sky (with CC2420 radio) gives value 105 + * CC1310 gives about 100 */ LQI_NO_SIGNAL = 100, }; @@ -431,11 +431,11 @@ set_value(radio_param_t param, radio_value_t value) set_send_on_cca((value & RADIO_TX_MODE_SEND_ON_CCA) != 0); return RADIO_RESULT_OK; case RADIO_PARAM_CHANNEL: - /* with chanels <0 cooja mutches with any chanels: - * - sent packets on negative chanekl -> to any receivers chanels. - * - receiver on negative chanel <- gots any sender chcnels. - * So, negative chanel useful for wide-band noise generation. - * Or sniff wide-band air. + /* With channel value < 0 Cooja matches any channels: + * - send packets on a negative channel -> to any receiver's channels. + * - receive on a negative channel <- get packets from any sender's channels. + * So, negative channel are useful for wide-band noise generation. + * Or for wide-band sniffing. * */ radio_set_channel(value); return RADIO_RESULT_OK;
Inject touch events with smallest detectable size A value of 1 means the "largest detectable size", a value of 0 means the "smallest detectable size". Fixes <https://github.com/Genymobile/scrcpy/issues/2125>
@@ -45,7 +45,7 @@ public class Controller { MotionEvent.PointerCoords coords = new MotionEvent.PointerCoords(); coords.orientation = 0; - coords.size = 1; + coords.size = 0; pointerProperties[i] = props; pointerCoords[i] = coords;
GroupFeed: fix crash on enable
@@ -15,7 +15,8 @@ export function GroupFeedHeader(props) { historyLocation === `${baseUrl}/feed`; const locationUrl = - history.location.pathname.replace(`${baseUrl}/feed`, ''); + history.location.pathname.replace(`${baseUrl}`, '').replace(/^\/[a-z]*/, ''); + console.log(locationUrl); let nodeIndex = locationUrl.split('/').slice(1).map((ind) => { return bigInt(ind); });