message
stringlengths
6
474
diff
stringlengths
8
5.22k
Avoid `clang` alignment distrust issues
@@ -5101,17 +5101,21 @@ typedef enum fio_cluster_message_type_e { typedef struct fio_collection_s fio_collection_s; -#pragma pack(1) +#ifndef __clang__ /* clang might misbehave by assumming non-alignment */ +#pragma pack(1) /* https://gitter.im/halide/Halide/archives/2018/07/24 */ +#endif typedef struct { size_t name_len; char *name; - size_t ref; + volatile size_t ref; fio_ls_embd_s subscriptions; fio_collection_s *parent; fio_match_fn match; fio_lock_i lock; } channel_s; +#ifndef __clang__ #pragma pack() +#endif struct subscription_s { fio_ls_embd_s node;
uds zero second timeout
@@ -345,6 +345,9 @@ class IsoTpMessage(): self._isotp_rx_next(msg) if self.tx_done and self.rx_done: return self.rx_dat + # no timeout indicates non-blocking + if self.timeout == 0: + return None if time.time() - start_time > self.timeout: raise MessageTimeoutError("timeout waiting for response") finally: @@ -415,19 +418,22 @@ class IsoTpMessage(): # wait (do nothing until next flow control message) if self.debug: print("ISO-TP: TX - flow control wait") -class UdsClient(): - def __init__(self, panda, tx_addr: int, rx_addr: int=None, bus: int=0, timeout: float=1, debug: bool=False): - self.bus = bus - self.tx_addr = tx_addr - if rx_addr is None: +def get_rx_addr_for_tx_addr(tx_addr): if tx_addr < 0xFFF8: # standard 11 bit response addr (add 8) - self.rx_addr = tx_addr+8 - elif tx_addr > 0x10000000 and tx_addr < 0xFFFFFFFF: + return tx_addr + 8 + + if tx_addr > 0x10000000 and tx_addr < 0xFFFFFFFF: # standard 29 bit response addr (flip last two bytes) - self.rx_addr = (tx_addr & 0xFFFF0000) + (tx_addr<<8 & 0xFF00) + (tx_addr>>8 & 0xFF) - else: + return (tx_addr & 0xFFFF0000) + (tx_addr<<8 & 0xFF00) + (tx_addr>>8 & 0xFF) + raise ValueError("invalid tx_addr: {}".format(tx_addr)) + +class UdsClient(): + def __init__(self, panda, tx_addr: int, rx_addr: int=None, bus: int=0, timeout: float=1, debug: bool=False): + self.bus = bus + self.tx_addr = tx_addr + self.rx_addr = rx_addr if rx_addr is not None else get_rx_addr_for_tx_addr(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)
HUB75: Add expansion and feature pins
@@ -53,7 +53,19 @@ STATIC const mp_map_elem_t hub75_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_PANEL_GENERIC), MP_ROM_INT(0) }, { MP_OBJ_NEW_QSTR(MP_QSTR_PANEL_FM6126A), MP_ROM_INT(1) }, { MP_ROM_QSTR(MP_QSTR_color), MP_ROM_PTR(&Hub75_color_obj) }, - { MP_ROM_QSTR(MP_QSTR_color_hsv), MP_ROM_PTR(&Hub75_color_hsv_obj) } + { MP_ROM_QSTR(MP_QSTR_color_hsv), MP_ROM_PTR(&Hub75_color_hsv_obj) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_INT(14) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_USER), MP_ROM_INT(23) }, + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_INT(16) }, + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_INT(17) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_INT(18) }, + { MP_ROM_QSTR(MP_QSTR_PIN_A0), MP_ROM_INT(26) }, + { MP_ROM_QSTR(MP_QSTR_PIN_A1), MP_ROM_INT(27) }, + { MP_ROM_QSTR(MP_QSTR_PIN_A2), MP_ROM_INT(28) }, + { MP_ROM_QSTR(MP_QSTR_PIN_INT), MP_ROM_INT(19) }, + { MP_ROM_QSTR(MP_QSTR_PIN_SDA), MP_ROM_INT(20) }, + { MP_ROM_QSTR(MP_QSTR_PIN_SCL), MP_ROM_INT(21) }, + { MP_ROM_QSTR(MP_QSTR_CURRENT_SENSE), MP_ROM_INT(29) }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_hub75_globals, hub75_globals_table);
OcMachoLib: Remove redundant cast.
@@ -191,7 +191,7 @@ InternalGetNextCommand64 ( ASSERT (Context != NULL); - MachHeader = ((CONST OC_MACHO_CONTEXT *)Context)->MachHeader; + MachHeader = Context->MachHeader; ASSERT (MachHeader != NULL); TopOfCommands = ((UINTN)MachHeader->Commands + MachHeader->CommandsSize);
pack: fix msgpack_to_json() condition and do realloc
@@ -550,30 +550,44 @@ int flb_msgpack_obj_to_json(char *json_str, size_t str_len, */ char *flb_msgpack_to_json_str(size_t size, msgpack_unpacked *data) { + int ret; char *buf = NULL; + char *tmp; if (data == NULL) { return NULL; } + if (size <= 0) { size = 128; } - while(1) { - buf = (char *)flb_malloc(size); - if (buf == NULL) { + + buf = flb_malloc(size); + if (!buf) { flb_errno(); return NULL; } - if (flb_msgpack_to_json(buf, size, data) < 0){ + while (1) { + ret = flb_msgpack_to_json(buf, size, data); + if (ret <= 0) { /* buffer is small. retry.*/ size += 128; + tmp = flb_realloc(buf, size); + if (tmp) { + buf = tmp; + } + else { flb_free(buf); + flb_errno(); + return NULL; + } } else { break; } } + return buf; }
Fix compilation waring in eth sdk
@@ -60,9 +60,10 @@ bool adjustDecimals(char *src, uint32_t targetLength, uint8_t decimals); -__attribute__((no_instrument_function)) inline int allzeroes(uint8_t *buf, int n) { - for (int i = 0; i < n; ++i) { - if (buf[i]) { +__attribute__((no_instrument_function)) inline int allzeroes(void *buf, size_t n) { + uint8_t *p = (uint8_t *) buf; + for (size_t i = 0; i < n; ++i) { + if (p[i]) { return 0; } } @@ -77,6 +78,6 @@ __attribute__((no_instrument_function)) inline int ismaxint(uint8_t *buf, int n) return 1; } -static const uint8_t const HEXDIGITS[] = "0123456789abcdef"; +static const char HEXDIGITS[] = "0123456789abcdef"; #endif /* _ETHUTILS_H_ */
doc: add precondition to keySetBinary
@@ -493,6 +493,7 @@ ssize_t keyGetBinary (const Key * key, void * returnedBinary, size_t maxSize) * won't be changed. This will only happen in the successful case, * but not when -1 is returned. * + * @pre @p dataSize matches the length of @p newBinary * @pre @p newBinary is not NULL and @p dataSize > 0 * @pre @p key is not read-only * @post @p key's value set exactly to the data in @p newBinary
[numerics] factorization debug: clarify message & do not stop
@@ -3078,7 +3078,9 @@ int NM_LU_factorize(NumericsMatrix* Ao) { if(NM_check_values_sha1(Ao)) { - numerics_error("NM_LU_factorize", "this matrix is already factorized"); + numerics_warning("NM_LU_factorize", "an attempt to factorize this matrix has already been done"); + info = 1; + return info; } }
speed up the splunk integration test When it runs `splunk stop`, Splunk processes stop and become zombies but the `splunk stop` process is just spinning in a loop reading `/proc/PID/status` for those zombies. I just put a timeout on that so we move on faster.
@@ -36,7 +36,7 @@ class SplunkAppController(AppController): subprocess.run(start_command, check=True, shell=True) def stop(self): - subprocess.run("/opt/splunk/bin/splunk stop", check=True, shell=True) + subprocess.run("timeout 30 /opt/splunk/bin/splunk stop --force", check=False, shell=True) def assert_running(self): completed_proc = subprocess.run("/opt/splunk/bin/splunk status", check=True, shell=True,
odissey: check rc for shapito console write
@@ -77,7 +77,8 @@ static inline int od_console_show_stats_add(shapito_stream_t *stream, char *database, int database_len, - od_serverstat_t *total, od_serverstat_t *avg) + od_serverstat_t *total, + od_serverstat_t *avg) { int offset; offset = shapito_be_write_data_row(stream); @@ -166,8 +167,12 @@ od_console_show_stats(od_client_t *client) client); if (rc == -1) return -1; - shapito_be_write_complete(stream, "SHOW", 5); - shapito_be_write_ready(stream, 'I'); + rc = shapito_be_write_complete(stream, "SHOW", 5); + if (rc == -1) + return -1; + rc = shapito_be_write_ready(stream, 'I'); + if (rc == -1) + return -1; return 0; } @@ -196,8 +201,13 @@ od_console_show_servers(od_client_t *client) if (rc == -1) return -1; (void)router; - shapito_be_write_complete(stream, "SHOW", 5); - shapito_be_write_ready(stream, 'I'); + + rc = shapito_be_write_complete(stream, "SHOW", 5); + if (rc == -1) + return -1; + rc = shapito_be_write_ready(stream, 'I'); + if (rc == -1) + return -1; return 0; }
stm32f1 - Add missing prototype.
@@ -42,6 +42,12 @@ struct stm32f1_uart_cfg { IRQn_Type suc_irqn; /* NVIC IRQn */ }; +/* + * Internal API for stm32f1xx mcu specific code. + */ +int hal_gpio_init_af(int pin, uint8_t af_type, enum hal_gpio_pull pull, + uint8_t od); + struct hal_flash; extern struct hal_flash stm32f1_flash_dev;
make test: raise packet tracing limit to 1000
@@ -554,7 +554,7 @@ class VppTestCase(unittest.TestCase): (self.__class__.__name__, self._testMethodName, self._testMethodDoc)) if not self.vpp_dead: - self.logger.debug(self.vapi.cli("show trace")) + self.logger.debug(self.vapi.cli("show trace max 1000")) self.logger.info(self.vapi.ppcli("show interface")) self.logger.info(self.vapi.ppcli("show hardware")) self.logger.info(self.statistics.set_errors_str()) @@ -635,7 +635,7 @@ class VppTestCase(unittest.TestCase): cls.logger.debug("Removing zombie capture %s" % cap_name) cls.vapi.cli('packet-generator delete %s' % cap_name) - cls.vapi.cli("trace add pg-input 50") # 50 is maximum + cls.vapi.cli("trace add pg-input 1000") cls.vapi.cli('packet-generator enable') cls._zombie_captures = cls._captures cls._captures = []
Beautify the configuration interface and keep the interface style consistent with the c tool.
@@ -585,10 +585,12 @@ class MenuConfig(object): self.list = tk.Listbox( dlg, selectmode=tk.SINGLE, - activestyle=tk.UNDERLINE, + activestyle=tk.NONE, font=font.nametofont('TkFixedFont'), height=1, ) + self.list['foreground'] = 'Blue' + self.list['background'] = 'Gray95' # Make selection invisible self.list['selectbackground'] = self.list['background'] self.list['selectforeground'] = self.list['foreground'] @@ -633,6 +635,8 @@ class MenuConfig(object): dlg.bind('<Return>', self.handle_keypress) dlg.bind('<Right>', self.handle_keypress) dlg.bind('<Left>', self.handle_keypress) + dlg.bind('<Up>', self.handle_keypress) + dlg.bind('<Down>', self.handle_keypress) dlg.bind('n', self.handle_keypress) dlg.bind('m', self.handle_keypress) dlg.bind('y', self.handle_keypress) @@ -655,6 +659,10 @@ class MenuConfig(object): for n,c in widget.children.items(): self._set_option_to_all_children(c, option, value) + def _invert_colors(self, idx): + self.list.itemconfig(idx, {'bg' : self.list['foreground']}) + self.list.itemconfig(idx, {'fg' : self.list['background']}) + @property def _selected_entry(self): # type: (...) -> ListEntry @@ -676,6 +684,7 @@ class MenuConfig(object): if idx is not None: self.list.activate(idx) self.list.see(idx) + self._invert_colors(idx) def handle_keypress(self, ev): keysym = ev.keysym @@ -683,6 +692,10 @@ class MenuConfig(object): self._select_action(prev=True) elif keysym == 'Right': self._select_action(prev=False) + elif keysym == 'Up': + self.refresh_display(reset_selection=False) + elif keysym == 'Down': + self.refresh_display(reset_selection=False) elif keysym == 'space': self._selected_entry.toggle() elif keysym in ('n', 'm', 'y'): @@ -777,6 +790,7 @@ class MenuConfig(object): else: # Select the topmost entry self.list.activate(0) + self._invert_colors(0) # Select ACTION_SELECT on each refresh (mimic C menuconfig) self.tk_selected_action.set(self.ACTION_SELECT) # Display current location in configuration tree @@ -804,6 +818,7 @@ class MenuConfig(object): self.show_node(parent_node) # Restore previous selection self._select_node(select_node) + self.refresh_display(reset_selection=False) def ask_for_string(self, ident=None, title='Enter string', value=None): """
Applying read_image optimizations to write_image as well
#endif /* writes pixel to coord in image */ -void pocl_write_pixel (void* color_, ADDRESS_SPACE dev_image_t* dev_image, int4 coord) +void pocl_write_pixel (void* color_, ADDRESS_SPACE dev_image_t* dev_image, + int4 coord) { uint4 *color = (uint4*)color_; - int i, idx; int width = dev_image->_width; int height = dev_image->_height; int num_channels = dev_image->_num_channels; + int i = num_channels; int elem_size = dev_image->_elem_size; + int const base_index = + (coord.x + coord.y*width + coord.z*height*width) * num_channels; if (dev_image->_order == CL_A) { - idx = (coord.x + coord.y*width + coord.z*height*width) * num_channels; if (elem_size == 1) - ((uchar*)(dev_image->_data))[idx] = (*color)[3]; + ((uchar*) (dev_image->_data))[base_index] = (*color)[3]; else if (elem_size == 2) - ((ushort*)(dev_image->_data))[idx] = (*color)[3]; + ((ushort*) (dev_image->_data))[base_index] = (*color)[3]; else if (elem_size == 4) - ((uint*)(dev_image->_data))[idx] = (*color)[3]; + ((uint*) (dev_image->_data))[base_index] = (*color)[3]; return; } - for (i = 0; i < num_channels; i++) - { - idx = i + (coord.x + coord.y*width + coord.z*height*width)*num_channels; if (elem_size == 1) { - ((uchar*)dev_image->_data)[idx] = (*color)[i]; + while (i--) + { + ((uchar*) (dev_image->_data))[base_index + i] = (*color)[i]; + } } else if (elem_size == 2) { - ((ushort*)dev_image->_data)[idx] = (*color)[i]; + while (i--) + { + ((ushort*) dev_image->_data)[base_index + i] = (*color)[i]; + } } else if (elem_size == 4) { - ((uint*)dev_image->_data)[idx] = (*color)[i]; + while (i--) + { + ((uint*) dev_image->_data)[base_index + i] = (*color)[i]; } } }
Remove cook code
-(import cook) - -(cook/make-native - :name "numarray" - :source @["numarray.c"]) - -(import build/numarray :as numarray) +(import build/numarray) (def a (numarray/new 30)) (print (get a 20))
Update python docs with StringMatch and StringMatchInstance objects.
@@ -483,5 +483,46 @@ Reference .. py:attribute:: strings - List of tuples containing information about the matching strings. Each - tuple has the form: `(<offset>, <string identifier>, <string data>)`. + List of StringMatch objects. + +.. py:class:: StringMatch + + Objects which represent string matches. + + .. py:attribute:: identifier + + Name of the matching string. + + .. py:attribute:: instances + + List of StringMatchInstance objects. + + .. py:method:: is_xor() + + Returns a boolean if the string is using the xor modifier. + +.. py:class:: StringMatchInstance + + Objects which represent instances of matched strings. + + .. py:attribute:: matched_data + + Bytes of the matched data. + + .. py:attribute:: matched_length + + Length of the matched data. + + .. py:attribute:: offset + + Offset of the matched data. + + .. py:attribute:: xor_key + + XOR key found for the string. + + .. py:method:: plaintext() + + Returns the plaintext version of the string after xor key is applied. If + the string is not an xor string then no modification is done. +
Remove default hotkey combo argument from registerHotkey
@@ -25,7 +25,7 @@ ScriptContext::ScriptContext(sol::state_view aStateView, const std::filesystem:: Logger::ErrorToModsFmt("Tried to register unknown handler '{}'!", acName); }; - m_env["registerHotkey"] = [this](const std::string& acID, const std::string& acDescription, sol::table aVKBindCode, sol::function aCallback) + m_env["registerHotkey"] = [this](const std::string& acID, const std::string& acDescription, sol::function aCallback) { if (acID.empty() || (std::find_if(acID.cbegin(), acID.cend(), [](char c){ return !(isalpha(c) || isdigit(c) || c == '_'); }) != acID.cend())) @@ -40,20 +40,7 @@ ScriptContext::ScriptContext(sol::state_view aStateView, const std::filesystem:: return; } - if (aVKBindCode.size() > 4) - { - Logger::ErrorToModsFmt("Tried to register hotkey with too many keys! Maximum 4-key combos allowed! (ID of hotkey handler: {})", acID); - return; - } - std::string vkBindID = m_name + '.' + acID; - VKCodeBindDecoded vkCodeBindDec{ }; - for (size_t i = 0; i < 4; ++i) - { - auto codePart = aVKBindCode[i + 1]; - if (codePart.valid()) - vkCodeBindDec[i] = static_cast<uint8_t>(codePart.get_or<UINT>(0)); - } VKBind vkBind = { vkBindID, acDescription, [aCallback]() { // TODO: proper exception handling! @@ -67,8 +54,7 @@ ScriptContext::ScriptContext(sol::state_view aStateView, const std::filesystem:: Logger::ErrorToMods(e.what()); } }}; - UINT vkCodeBind = VKBindings::EncodeVKCodeBind(vkCodeBindDec); - m_vkBindInfos.emplace_back(VKBindInfo{vkBind, vkCodeBind}); + m_vkBindInfos.emplace_back(VKBindInfo{vkBind}); }; // TODO: proper exception handling!
erase early secrets and transcripts
@@ -1124,7 +1124,7 @@ static int ssl_tls13_generate_early_key( mbedtls_ssl_context *ssl, if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "ssl_tls13_get_cipher_key_info", ret ); - return( ret ); + goto cleanup; } md_type = ciphersuite_info->mac; @@ -1141,7 +1141,7 @@ static int ssl_tls13_generate_early_key( mbedtls_ssl_context *ssl, MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_get_handshake_transcript", ret ); - return( ret ); + goto cleanup; } ret = mbedtls_ssl_tls13_derive_early_secrets( @@ -1151,7 +1151,7 @@ static int ssl_tls13_generate_early_key( mbedtls_ssl_context *ssl, { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_tls13_derive_early_secrets", ret ); - return( ret ); + goto cleanup; } MBEDTLS_SSL_DEBUG_BUF( @@ -1181,7 +1181,7 @@ static int ssl_tls13_generate_early_key( mbedtls_ssl_context *ssl, if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "ssl_tls13_make_traffic_key", ret ); - return( 0 ); + goto cleanup; } traffic_keys->key_len = key_len; traffic_keys->iv_len = iv_len; @@ -1196,7 +1196,12 @@ static int ssl_tls13_generate_early_key( mbedtls_ssl_context *ssl, MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= ssl_tls13_generate_early_key" ) ); - return( 0 ); +cleanup: + /* Erase secret and transcript */ + mbedtls_platform_zeroize( + tls13_early_secrets, sizeof( mbedtls_ssl_tls13_early_secrets ) ); + mbedtls_platform_zeroize( transcript, sizeof( transcript ) ); + return( ret ); } int mbedtls_ssl_tls13_compute_early_transform( mbedtls_ssl_context *ssl )
Fix incorrect comments Found this while working on the code
@@ -154,7 +154,7 @@ void BedFile::Seek(unsigned long offset) { _bedStream->seekg(offset); } -// Jump to a specific byte in the file +// are the any intervals left in the file? bool BedFile::Empty(void) { return _status == BED_INVALID || _status == BED_BLANK; }
Added serializer files to Cypress makefiles
@@ -159,6 +159,8 @@ $(NAME)_SOURCES := $(AMAZON_FREERTOS_PATH)vendors/cypress/boards/$(PLATFORM)/ $(AFR_C_SDK_STANDARD_PATH)serializer/src/json/aws_iot_serializer_json_encoder.c \ $(AFR_C_SDK_STANDARD_PATH)common/iot_init.c \ $(AFR_C_SDK_STANDARD_PATH)serializer/src/iot_json_utils.c \ + $(AFR_C_SDK_STANDARD_PATH)serializer/test/iot_tests_serializer_cbor.c \ + $(AFR_C_SDK_STANDARD_PATH)serializer/test/iot_tests_serializer_json.c \ $(AFR_ABSTRACTIONS_PATH)platform/freertos/iot_metrics.c \ $(AFR_FREERTOS_PLUS_STANDARD_PATH)freertos_plus_tcp/test/aws_test_freertos_tcp.c \ $(AFR_FREERTOS_PLUS_STANDARD_PATH)freertos_plus_tcp/test/aws_freertos_tcp_test_access_dns_define.h \
Use cmocka gitlab mirror, Travis is failing to fetch it
@@ -29,7 +29,7 @@ matrix: before_install: - pushd ${HOME} - - git clone git://git.cryptomilk.org/projects/cmocka.git + - git clone https://gitlab.com/cmocka/cmocka.git - cd cmocka && mkdir build && cd build - cmake .. && make -j2 && sudo make install - cd .. && popd
EV3: Update API example import
"""API usage example for LEGO MINDSTORMS EV3.""" # Import basic stuff. We could perhaps import brick and all relevant ports by default like on the pyboard -import brick +import ev3brick from port import PORT_B, PORT_C, PORT_1 # Import the devices we want to use @@ -24,4 +24,4 @@ while not bumper.pressed(): base.stop() # Play a sound on the brick -brick.beep() +ev3brick.beep()
contrib-autotools: Added some more details on how the sample works.
This is a project skeleton that uses criterion tests with the TAP test driver. +## How this works + +Be sure to do the following to get similar setups to work: + +1. copy `tap-driver.sh` from your automake installation ([`autogen.sh:4-7`](autogen.sh#L4-L7)). +2. create a wrapper script that contains the following ([`autogen.sh:12-15`](autogen.sh#L12-L15)): + + ```bash + #!/bin/sh + $1 -Otap:- --always-succeed 2>&1 >/dev/null + ``` + +3. Check for criterion ([`configure.ac:5-7`](configure.ac#L5-L7)). +4. Check for awk ([`configure.ac:9`](configure.ac#L9)). +5. Check for `tap-driver.sh` ([`configure.ac:14`](configure.ac#L14)). +6. Set `LOG_COMPILER` to the path of the wrapper script created at step 2 ([`Makefile.am:2`](Makefile.am#L2)). +7. Set `LOG_DRIVER` to a command running `tap-driver.sh` with our found awk ([`Makefile.am:5-6`](Makefile.am#L5-L6)). +8. Register your test programs ([`Makefile.am:8-14`](Makefile.am#L8-L14)). + ## Running the tests The default setup assumes that criterion is installed on your system.
vfs/fs_poll: not clear POLLIN event if POLLHUP or POLLERR set
@@ -312,9 +312,9 @@ void poll_notify(FAR struct pollfd **afds, int nfds, pollevent_t eventset) fds->revents |= eventset & (fds->events | POLLERR | POLLHUP); if ((fds->revents & (POLLERR | POLLHUP)) != 0) { - /* Error, clear POLLIN and POLLOUT event */ + /* Error or Hung up, clear POLLOUT event */ - fds->revents &= ~(POLLIN | POLLOUT); + fds->revents &= ~POLLOUT; } if (fds->revents != 0)
BugID:18557727:open fpu hardware for pca board
@@ -81,7 +81,7 @@ $(NAME)_SOURCES += hal/ble_port.c endif ifeq ($(COMPILER),armcc) -GLOBAL_CFLAGS += --c99 --cpu=7E-M -D__MICROLIB -g --apcs=interwork --split_sections +GLOBAL_CFLAGS += --c99 --cpu=Cortex-M4 --apcs=/hardfp --fpu=vfpv4_sp_d16 -D__MICROLIB -g --split_sections else ifeq ($(COMPILER),iar) GLOBAL_CFLAGS += --cpu=Cortex-M4 \ --cpu_mode=thumb \ @@ -90,11 +90,13 @@ else GLOBAL_CFLAGS += -mcpu=cortex-m4 \ -mlittle-endian \ -mthumb -mthumb-interwork \ + -mfloat-abi=hard \ + -mfpu=fpv4-sp-d16 \ -w endif ifeq ($(COMPILER),armcc) -GLOBAL_ASMFLAGS += --cpu=7E-M -g --apcs=interwork --library_type=microlib --pd "__MICROLIB SETA 1" +GLOBAL_ASMFLAGS += --cpu=Cortex-M4 -g --apcs=/hardfp --fpu=vfpv4_sp_d16 --library_type=microlib --pd "__MICROLIB SETA 1" else ifeq ($(COMPILER),iar) GLOBAL_ASMFLAGS += --cpu Cortex-M4 \ --cpu_mode thumb \ @@ -102,12 +104,16 @@ GLOBAL_ASMFLAGS += --cpu Cortex-M4 \ else GLOBAL_ASMFLAGS += -mcpu=cortex-m4 \ -mlittle-endian \ - -mthumb -mthumb-interwork \ + -mthumb \ + -mfloat-abi=hard \ + -mfpu=fpv4-sp-d16 \ -w endif ifeq ($(COMPILER),armcc) -GLOBAL_LDFLAGS += -L --cpu=7E-M \ +GLOBAL_LDFLAGS += -L --cpu=Cortex-M4 \ + -L --fpu=vfpv4_sp_d16 \ + -L --apcs=/hardfp \ -L --strict \ -L --xref -L --callgraph -L --symbols \ -L --info=sizes -L --info=totals -L --info=unused -L --info=veneers -L --info=summarysizes @@ -119,6 +125,8 @@ GLOBAL_LDFLAGS += -mcpu=cortex-m4 \ -mlittle-endian \ -mthumb -mthumb-interwork \ --specs=nosys.specs \ + -mfloat-abi=hard \ + -mfpu=fpv4-sp-d16 \ $(CLIB_LDFLAGS_NANO_FLOAT) endif @@ -126,3 +134,4 @@ include $($(NAME)_LOCATION)/$(HOST_MCU_NAME).mk include $($(NAME)_LOCATION)/bt_controller/bt_controller.mk #$(NAME)_COMPONENTS += bt_controller +
shm mod BUGFIX unlock sid data races
@@ -497,9 +497,6 @@ revert_lock: static void sr_shmmod_unlock(struct sr_mod_lock_s *shm_lock, int timeout_ms, sr_lock_mode_t mode, sr_cid_t cid, sr_sid_t sid) { - /* UNLOCK */ - sr_rwunlock(&shm_lock->lock, timeout_ms, mode, cid, __func__); - /* remove our SID */ if ((mode == SR_LOCK_READ_UPGR) || (mode == SR_LOCK_WRITE)) { assert(!memcmp(&shm_lock->sid, &sid, sizeof sid)); @@ -515,6 +512,9 @@ sr_shmmod_unlock(struct sr_mod_lock_s *shm_lock, int timeout_ms, sr_lock_mode_t memset(&shm_lock->sid, 0, sizeof shm_lock->sid); } } + + /* UNLOCK */ + sr_rwunlock(&shm_lock->lock, timeout_ms, mode, cid, __func__); } /**
fix spare id random selection.
@@ -1589,18 +1589,20 @@ reuse_tcp_select_id(struct reuse_tcp* reuse, struct outside_network* outnet) int i; unsigned select, count, space; rbnode_type* node; - for(i = 0; i<try_random; i++) { + + /* make really sure the tree is not empty */ + if(reuse->tree_by_id.count == 0) { id = ((unsigned)ub_random(outnet->rnd)>>8) & 0xffff; - if(!reuse_tcp_by_id_find(reuse, id)) { return id; } - } - /* make really sure the tree is not empty */ - if(reuse->tree_by_id.count == 0) { + /* try to find random empty spots by picking them */ + for(i = 0; i<try_random; i++) { id = ((unsigned)ub_random(outnet->rnd)>>8) & 0xffff; + if(!reuse_tcp_by_id_find(reuse, id)) { return id; } + } /* equally pick a random unused element from the tree that is * not in use. Pick a the n-th index of an ununused number, @@ -1627,8 +1629,7 @@ reuse_tcp_select_id(struct reuse_tcp* reuse, struct outside_network* outnet) space = nextid - curid - 1; if(select < count + space) { /* here it is */ - return curid + 1 + ub_random_max( - outnet->rnd, space); + return curid + 1 + (select - count); } count += space; } @@ -1642,9 +1643,7 @@ reuse_tcp_select_id(struct reuse_tcp* reuse, struct outside_network* outnet) node = rbtree_last(&reuse->tree_by_id); log_assert(node && node != RBTREE_NULL); /* tree not empty */ curid = tree_by_id_get_id(node); - space = 0xffff - curid; - log_assert(select < count + space); - return curid + 1 + ub_random_max(outnet->rnd, space); + return curid + 1 + (select - count); } struct waiting_tcp*
[CM H0] updated wording + improved markdown code example
@@ -44,8 +44,18 @@ Now we can simply fetch the desired key's value as follows: String str = set.lookup("user:/my/presaved/key").getString() ``` -So for example if you have executed before the application starts `kdb set user:/my/test it_works!`, -the method call `set.lookup("user:/my/test").getString()` would return `it_works!`. +So for example if you had executed the command below via shell, before starting the application: + +```bash +kdb set user:/my/test it_works! +``` + +The method call would return `it_works!`. + +```java +String str = set.lookup("user:/my/test").getString() +System.out.println(str) //prints "it works!" +``` ## Saving Keys
Make `sock_touch` conditional upon actual data being sent
@@ -990,13 +990,15 @@ ssize_t sock_flush(intptr_t uuid) { if (validate_uuid(uuid) || !fdinfo(fd).open) return -1; ssize_t ret; + uint8_t touch = 0; lock_fd(fd); sock_rw_hook_s *rw; retry: rw = fdinfo(fd).rw_hooks; unlock_fd(fd); while ((ret = rw->flush(fd)) > 0) - ; + if (ret > 0) + touch = 1; if (ret == -1) { if (errno == EINTR) goto retry; @@ -1008,7 +1010,7 @@ retry: lock_fd(fd); while (fdinfo(fd).packet && (ret = fdinfo(fd).packet->metadata.write_func( fd, fdinfo(fd).packet)) > 0) - ; + touch = 1; if (ret == -1) { if (errno == EINTR) goto retry; @@ -1021,6 +1023,7 @@ retry: goto error; finish: unlock_fd(fd); + if (touch) sock_touch(uuid); return 0; error:
Fixed issue where served time metrics were not shown when data was piped. It fixes the issue by looking at the log-format %D or %T or %L as a fallback to the existing mechanism. Fixes
@@ -746,6 +746,20 @@ set_time_format_str (const char *oarg) { conf.time_format = fmt; } +/* Determine if time-served data was set through log-format. */ +static void +contains_usecs (void) { + if (!conf.log_format) + return; + + if (strstr (conf.log_format, "%D")) + conf.serve_usecs = 1; /* flag */ + if (strstr (conf.log_format, "%T")) + conf.serve_usecs = 1; /* flag */ + if (strstr (conf.log_format, "%L")) + conf.serve_usecs = 1; /* flag */ +} + /* Attempt to set the log format given a command line option argument. * The supplied optarg can be either an actual format string or the * enumerated value such as VCOMBINED */ @@ -761,6 +775,7 @@ set_log_format_str (const char *oarg) { /* type not found, use whatever was given by the user then */ if (type == -1) { conf.log_format = unescape_str (oarg); + contains_usecs (); /* set flag */ return; } @@ -771,6 +786,8 @@ set_log_format_str (const char *oarg) { } conf.log_format = unescape_str (fmt); + contains_usecs (); /* set flag */ + /* assume we are using the default date/time formats */ set_time_format_str (oarg); set_date_format_str (oarg);
generate pin script: support shell pipe of cert The script's contract is backwards compatible with this change. If the certificate file argument is omitted, the script will attempt to read the certificate bytes from stdin.
#!/usr/bin/env python2.7 """Helper script to generate a TrustKit or HPKP pin from a PEM/DER certificate file. """ -from subprocess import check_output +from subprocess import Popen, PIPE +from sys import stdin import os.path import argparse import hashlib @@ -17,25 +18,30 @@ class SupportedKeyAlgorithmsEnum(object): if __name__ == '__main__': # Parse the command line parser = argparse.ArgumentParser(description='Generate HPKP / TrustKit SSL Pins.') - parser.add_argument('certificate') + parser.add_argument('certificate', metavar='FILE', nargs='?', help='certificate file to read, if empty, stdin is used') parser.add_argument('--type', dest='type', action='store', default='PEM', help='Certificate file type; "PEM" (default) or "DER".') args = parser.parse_args() - if not os.path.isfile(args.certificate): + if not args.certificate: + certificate = stdin.read() + elif os.path.isfile(args.certificate): + with open(args.certificate, 'r') as certFile: + certificate = certFile.read() + else: raise ValueError('Could not open certificate file {}'.format(args.certificate)) if args.type not in ['DER', 'PEM']: raise ValueError('Invalid certificate type {}; expected DER or PEM'.format(args.type)) - # Parse the certificate and print its information - certificate_txt = check_output('openssl x509 -inform {} -in {} -text -noout'.format(args.type, - args.certificate), shell=True) - print '\nCERTIFICATE INFO\n----------------' - print check_output('openssl x509 -subject -issuer -fingerprint -sha1 -noout -inform {} -in {}'.format( - args.type, args.certificate), shell=True) + p1 = Popen('openssl x509 -inform {} -text -noout'.format(args.type), shell=True, stdin=PIPE, stdout=PIPE) + certificate_txt = p1.communicate(input=certificate)[0] + print '\nCERTIFICATE INFO\n----------------' + p1 = Popen('openssl x509 -subject -issuer -fingerprint -sha1 -noout -inform {}'.format( + args.type), shell=True, stdin=PIPE, stdout=PIPE) + print p1.communicate(input=certificate)[0] # Extract the certificate key's algorithm # Tested on the output of OpenSSL 0.9.8zh and OpenSSL 1.0.2i @@ -68,11 +74,11 @@ if __name__ == '__main__': else: raise ValueError('Unexpected key algorithm') - spki = check_output('openssl x509 -pubkey -noout -inform {} -in {} ' + p1 = Popen('openssl x509 -pubkey -noout -inform {} ' '| openssl {} -outform DER -pubin -in /dev/stdin 2>/dev/null'.format(args.type, - args.certificate, openssl_alg), - shell=True) + shell=True, stdin=PIPE, stdout=PIPE) + spki = p1.communicate(input=certificate)[0] spki_hash = hashlib.sha256(spki).digest() hpkp_pin = base64.b64encode(spki_hash)
feat: merge purge with clean so clean meets its convention of clean all generated files
@@ -133,9 +133,6 @@ mkdir : mkdir -p specs-code $(OBJDIR)/specs-code mkdir -p $(OBJDIR)/sqlite3 -$(OBJDIR)/common/curl-%.c.o : common/curl-%.c - $(CC) $(CFLAGS) $(LIBS_CFLAGS) -c -o $@ $< \ - -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 #generic compilation @@ -214,6 +211,7 @@ clean : rm -rf $(OBJDIR) *.exe test/*.exe bots/*.exe rm -rf bots-1/*.b1 bots-2/*.b2 $(MAKE) -C mujs clean + rm -rf $(LIBDIR) clean_actor_gen:
[software] Correct condition on sub-tile wake-up
@@ -100,7 +100,7 @@ void mempool_log_partial_barrier(uint32_t step, uint32_t core_id, ((1U << (tile_end - tile_init)) - 1) << tile_init % NUM_TILES_PER_GROUP); } else { - while (core_init > core_end - 1) { + while (core_init < core_end) { wake_up(core_init); core_init++; }
.github/workflows: build llsp
@@ -351,6 +351,12 @@ jobs: with: name: primehub-firmware path: bricks/primehub/main.py + - name: Upload install_pybricks.llsp + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: primehub-firmware + path: bricks/primehub/build/install_pybricks.llsp nxt_firmware: name: nxt firmware
Fix test id descriptions
@@ -6288,7 +6288,7 @@ def test_multiclass_train_on_constant_data(task_type): @pytest.mark.parametrize( 'loss_function', ['Logloss', 'CrossEntropy'], - ids=['label_type=%s' % s for s in ['Logloss', 'CrossEntropy']] + ids=['loss_function=%s' % s for s in ['Logloss', 'CrossEntropy']] ) def test_classes_attribute_binclass(label_type, loss_function): params = {'loss_function': loss_function, 'iterations': 2}
Swap parameters of evp_method_id() The order of the function's parameters `name_id` and `operation_id` was reverted compared to their order of appearance in the comments and assertions.
@@ -83,7 +83,7 @@ static OSSL_METHOD_STORE *get_evp_method_store(OPENSSL_CTX *libctx) * | name identity | op id | * +------------------------+--------+ */ -static uint32_t evp_method_id(unsigned int operation_id, int name_id) +static uint32_t evp_method_id(int name_id, unsigned int operation_id) { if (!ossl_assert(name_id > 0 && name_id < (1 << 24)) || !ossl_assert(operation_id > 0 && operation_id < (1 << 8))) @@ -116,7 +116,7 @@ static void *get_evp_method_from_store(OPENSSL_CTX *libctx, void *store, } if (name_id == 0 - || (meth_id = evp_method_id(methdata->operation_id, name_id)) == 0) + || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0) return NULL; if (store == NULL @@ -154,7 +154,7 @@ static int put_evp_method_in_store(OPENSSL_CTX *libctx, void *store, if ((namemap = ossl_namemap_stored(libctx)) == NULL || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0 - || (meth_id = evp_method_id(operation_id, name_id)) == 0) + || (meth_id = evp_method_id(name_id, operation_id)) == 0) return 0; if (store == NULL @@ -242,7 +242,7 @@ inner_evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, * about 2^8) or too many names (more than about 2^24). In that case, * we can't create any new method. */ - if (name_id != 0 && (meth_id = evp_method_id(operation_id, name_id)) == 0) + if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) return NULL; if (meth_id == 0 @@ -277,7 +277,7 @@ inner_evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, */ if (name_id == 0) name_id = ossl_namemap_name2num(namemap, name); - meth_id = evp_method_id(operation_id, name_id); + meth_id = evp_method_id(name_id, operation_id); ossl_method_store_cache_set(store, meth_id, properties, method, up_ref_method, free_method); }
vcl: narrow the scope of the restriction of vlsh_bit_val The restriction of vlsh_bit_val only effect select/pselect, so move the check to select/pselect function. Type: fix
@@ -271,10 +271,11 @@ ldp_init (void) /* Make sure there are enough bits in the fd set for vcl sessions */ if (ldp->vlsh_bit_val > FD_SETSIZE / 2) { - LDBG (0, "ERROR: LDP vlsh bit value %d > FD_SETSIZE/2 %d!", + /* Only valid for select/pselect, so just WARNING and not exit */ + LDBG (0, + "WARNING: LDP vlsh bit value %d > FD_SETSIZE/2 %d, " + "select/pselect not supported now!", ldp->vlsh_bit_val, FD_SETSIZE / 2); - ldp->init = 0; - return -1; } } env_var_str = getenv (LDP_ENV_TLS_TRANS);
bondo's fix using local storage
import React, { useState } from "react"; import Helmet from "react-helmet"; - import { useStaticQuery, graphql, Link } from "gatsby"; import "../scss/_docsNav.scss"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Search from "./search"; import "../utils/font-awesome"; + const searchIndices = [{ name: `Pages`, title: `Pages` }]; +const DARK_MODE_KEY = 'DARK_MODE'; export default function DocsNav() { - const [darkMode, toggleDarkMode] = useState(false); + const [darkMode, toggleDarkMode] = useState(localStorage.getItem(DARK_MODE_KEY) === 'true'); const [mobileNav, openMobileNav] = useState(false); const data = useStaticQuery(graphql` query DocumentationNav { @@ -25,6 +26,11 @@ export default function DocsNav() { } `); const navItems = data.allDocumentationNavYaml.nodes; + const darkModeClick = () => { + localStorage.setItem(DARK_MODE_KEY, !darkMode); + toggleDarkMode(!darkMode); + } + return ( <> <Helmet @@ -44,9 +50,7 @@ export default function DocsNav() { <h4> <FontAwesomeIcon icon={darkMode ? ["fas", "toggle-on"] : ["fas", "toggle-off"]} - onClick={() => { - darkMode ? toggleDarkMode(false) : toggleDarkMode(true); - }} + onClick={darkModeClick} /> <span>{darkMode ? "Light" : "Dark"}</span> </h4>
Don't run the TLSv1.3 CCS tests if TLSv1.3 is not enabled
use OpenSSL::Test::Utils; use OpenSSL::Test qw/:DEFAULT srctop_file/; -setup("test_tls13ccs"); +my $test_name = "test_tls13ccs"; +setup($test_name); -plan skip_all => "No TLS/SSL protocols are supported by this OpenSSL build" - if alldisabled(grep { $_ ne "ssl3" } available_protocols("tls")); +plan skip_all => "$test_name is not supported in this build" + if disabled("tls1_3"); plan tests => 1;
Testing: add test for g1date when yearOfCentury=255
@@ -20,6 +20,11 @@ grib_check_key_equals $temp "mars.date,monthlyVerificationDate" "20060301 200603 ${tools_dir}/grib_dump $temp +# Date as string with month names +${tools_dir}/grib_set -s yearOfCentury=255 $sample_g1 $temp +grib_check_key_equals $temp "dataDate:s" "mar-16" + + # Clean up rm -f $temp
proc_load (nommu): Fixed bad reloc modifying ELF JIRA:
@@ -669,6 +669,10 @@ int process_load(process_t *process, vm_object_t *o, offs_t base, size_t size, v if (process_relocate(reloc, relocsz, (char **)&relptr) < 0) return -ENOEXEC; + /* Don't modify ELF file! */ + if ((ptr_t)relptr >= (ptr_t)base && (ptr_t)relptr < (ptr_t)base + size) + continue; + if (process_relocate(reloc, relocsz, relptr) < 0) return -ENOEXEC; }
apps/wireless/wapi: Correct an error in dependency generation.
@@ -54,6 +54,7 @@ CSRCS = MAINSRC = VPATH = . +DEPPATH = --dep-path . include $(APPDIR)/wireless/wapi/src/Make.defs @@ -87,8 +88,6 @@ endif CONFIG_WAPI_PROGNAME ?= wapi$(EXEEXT) PROGNAME = $(CONFIG_WAPI_PROGNAME) -ROOTDEPPATH = --dep-path . - # Common build all: .built @@ -131,7 +130,7 @@ endif # Create dependencies .depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ depend: .depend
Add missing SDL_GL_CONTEXT_RESET_NOTIFICATION and SDL_GL_CONTEXT_NO_ERROR OpenGL attributes
@@ -62,6 +62,12 @@ static void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable) #if !(SDL_VERSION_ATLEAST(2,0,6)) #pragma message("SDL_WINDOW_VULKAN is not supported before SDL 2.0.6") #define SDL_WINDOW_VULKAN (0) + +#pragma message("SDL_GL_CONTEXT_RESET_NOTIFICATION is not supported before SDL 2.0.6") +#define SDL_GL_CONTEXT_RESET_NOTIFICATION (0) + +#pragma message("SDL_GL_CONTEXT_NO_ERROR is not supported before SDL 2.0.6") +#define SDL_GL_CONTEXT_NO_ERROR (0) #endif */ import "C" @@ -166,6 +172,8 @@ const ( GL_SHARE_WITH_CURRENT_CONTEXT = C.SDL_GL_SHARE_WITH_CURRENT_CONTEXT // OpenGL context sharing; defaults to 0 GL_FRAMEBUFFER_SRGB_CAPABLE = C.SDL_GL_FRAMEBUFFER_SRGB_CAPABLE // requests sRGB capable visual; defaults to 0 (>= SDL 2.0.1) GL_CONTEXT_RELEASE_BEHAVIOR = C.SDL_GL_CONTEXT_RELEASE_BEHAVIOR // sets context the release behavior; defaults to 1 (>= SDL 2.0.4) + GL_CONTEXT_RESET_NOTIFICATION = C.SDL_GL_CONTEXT_RESET_NOTIFICATION // (>= SDL 2.0.6) + GL_CONTEXT_NO_ERROR = C.SDL_GL_CONTEXT_NO_ERROR // (>= SDL 2.0.6) ) // An enumeration of OpenGL profiles.
generate a simpler while loop when possible
@@ -60,6 +60,7 @@ local function checkandget(t, c, s, lin) else error("invalid type " .. types.tostring(t)) end + --return getslot(t, c, s) .. ";" return string.format([[ if(ttis%s(%s)) { %s; } else luaL_error(L, "type error at line %d, expected %s but found %%s", lua_typename(L, ttnov(%s))); @@ -173,17 +174,23 @@ local function codewhile(ctx, node) local cstats, cexp = codeexp(ctx, node.condition, true) local cblk = codestat(ctx, node.block) popd(ctx) - local restoretop = "" -- FIXME + if cstats == "" then + return string.format([[ + while(%s) { + %s + } + ]], cexp, cblk) + else return string.format([[ while(1) { %s if(!(%s)) { - %s break; } %s } - ]], cstats, cexp, restoretop, cblk) + ]], cstats, cexp, cblk) + end end local function coderepeat(ctx, node)
Document pkcs12 alg NONE To generate unencrypted PKCS#12 file it is needed to use options: -keypbe NONE -certpbe NONE CLA: trivial
@@ -275,6 +275,8 @@ can be used (see L</NOTES> section for more information). If a cipher name is used with PKCS#5 v2.0. For interoperability reasons it is advisable to only use PKCS#12 algorithms. +Special value C<NONE> disables encryption of the private key and certificate. + =item B<-keyex>|B<-keysig> Specifies that the private key is to be used for key exchange or just signing.
BUFR decoding: Add error checking on unpack string
@@ -354,13 +354,13 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) size_t slen = 0; double dval = 0; size_t dlen = 1; - - int ret = 0, idx; + int idx = 0, err = 0; grib_context* c = a->context; if (self->type != BUFR_DESCRIPTOR_TYPE_STRING) { char sval[32] = {0,}; - unpack_double(a, &dval, &dlen); + err = unpack_double(a, &dval, &dlen); + if (err) return err; sprintf(sval, "%g", dval); slen = strlen(sval); if (*len < slen) @@ -389,9 +389,10 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) grib_context_free(c, str); *len = 0; *val = 0; - return ret; + return GRIB_SUCCESS; } + /* Start from the end of the string and remove spaces */ p = str; while (*p != 0) p++; @@ -411,7 +412,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) grib_context_free(c, str); *len = slen; - return ret; + return GRIB_SUCCESS; } static int pack_string(grib_accessor* a, const char* val, size_t* len)
acrn-config: enable log_setting in all VMs enable log_setting for all VMs. Acked-by: Victor Sun
@@ -497,9 +497,6 @@ def dm_arg_set(names, sel, virt_io, dm, vmid, config): else: print('{} $npk_virt \\'.format(dm_str), file=config) - if board_name == "apl-up2" or is_nuc_whl_clr(names, vmid): - print(" $logger_setting \\", file=config) - if uos_type in ("CLEARLINUX", "ANDROID", "ALIOS"): if uos_type in ("ANDROID", "ALIOS"): print(" -s {},virtio-rpmb \\".format(launch_cfg_lib.virtual_dev_slot("virtio-rpmb")), file=config) @@ -541,6 +538,9 @@ def dm_arg_set(names, sel, virt_io, dm, vmid, config): return print(" {} \\".format(launch_cfg_lib.PM_CHANNEL_DIC[pm_key]), file=config) + # set logger_setting for all VMs + print(" $logger_setting \\", file=config) + # XHCI args set xhci_args_set(dm, vmid, config)
mesh: Fix net_buf_slist_merge implementation
@@ -839,13 +839,11 @@ void net_buf_slist_remove(struct net_buf_slist_t *list, struct os_mbuf *prev, void net_buf_slist_merge_slist(struct net_buf_slist_t *list, struct net_buf_slist_t *list_to_append) { - struct os_mbuf_pkthdr *pkthdr; - - STAILQ_FOREACH(pkthdr, list_to_append, omp_next) { - STAILQ_INSERT_TAIL(list, pkthdr, omp_next); + if (!STAILQ_EMPTY(list_to_append)) { + *(list)->stqh_last = list_to_append->stqh_first; + (list)->stqh_last = list_to_append->stqh_last; + STAILQ_INIT(list_to_append); } - - STAILQ_INIT(list); } #if MYNEWT_VAL(BLE_MESH_SETTINGS)
stm32l4: Fixed incomplete rcc clock handling
@@ -169,6 +169,14 @@ int _stm32_rccSetDevClock(unsigned int d, u32 hz) t = *(stm32_common.rcc + rcc_apb1enr1) & ~(1 << (d - apb1_1_begin)); *(stm32_common.rcc + rcc_apb1enr1) = t | (hz << (d - apb1_1_begin)); } + else if (d <= apb1_2_end) { + t = *(stm32_common.rcc + rcc_apb1enr2) & ~(1 << (d - apb1_2_begin)); + *(stm32_common.rcc + rcc_apb1enr2) = t | (hz << (d - apb1_2_begin)); + } + else if (d <= apb2_end) { + t = *(stm32_common.rcc + rcc_apb2enr) & ~(1 << (d - apb2_begin)); + *(stm32_common.rcc + rcc_apb2enr) = t | (hz << (d - apb2_begin)); + } else if (d == pctl_rtc) { t = *(stm32_common.rcc + rcc_bdcr) & ~(1 << 15); *(stm32_common.rcc + rcc_bdcr) = t | (hz << 15); @@ -185,11 +193,17 @@ int _stm32_rccSetDevClock(unsigned int d, u32 hz) int _stm32_rccGetDevClock(unsigned int d, u32 *hz) { if (d <= ahb1_end) - *hz = !!(*(stm32_common.rcc + rcc_ahb1enr) & (1 << d)); + *hz = !!(*(stm32_common.rcc + rcc_ahb1enr) & (1 << (d - ahb1_begin))); else if (d <= ahb2_end) *hz = !!(*(stm32_common.rcc + rcc_ahb2enr) & (1 << (d - ahb2_begin))); else if (d <= ahb3_end) *hz = !!(*(stm32_common.rcc + rcc_ahb3enr) & (1 << (d - ahb3_begin))); + else if (d <= apb1_1_end) + *hz = !!(*(stm32_common.rcc + rcc_apb1enr1) & (1 << (d - apb1_1_begin))); + else if (d <= apb1_2_end) + *hz = !!(*(stm32_common.rcc + rcc_apb1enr2) & (1 << (d - apb1_2_begin))); + else if (d <= apb2_end) + *hz = !!(*(stm32_common.rcc + rcc_apb2enr) & (1 << (d - apb2_begin))); else if (d == pctl_rtc) *hz = !!(*(stm32_common.rcc + rcc_bdcr) & (1 << 15)); else
KDB List: Restore mountpoint in MSR example
@@ -37,6 +37,7 @@ This command will list the name of all keys below a given path. ## EXAMPLES ```sh +# Backup-and-Restore: /sw/elektra/examples # Create the keys we use for the examples kdb set /sw/elektra/examples/kdb-ls/test val1
hw/drivers/sdadc_da1469x: Acquire PD_PER when GPADC is opened
#include <DA1469xAB.h> #include <mcu/mcu.h> +#include <mcu/da1469x_pd.h> #include "gpadc_da1469x/gpadc_da1469x.h" @@ -471,6 +472,8 @@ da1469x_gpadc_open(struct os_dev *odev, uint32_t wait, void *arg) return rc; } if (++dev->dgd_adc.ad_ref_cnt == 1) { + da1469x_pd_acquire(MCU_PD_DOMAIN_PER); + /* initialize */ if (da1469x_gpadc_hwinit(dev, arg)) { rc = OS_EINVAL; @@ -485,6 +488,7 @@ da1469x_gpadc_open(struct os_dev *odev, uint32_t wait, void *arg) dev->dgd_dma[0]->DMA_A_START_REG = (uint32_t)&GPADC->GP_ADC_RESULT_REG; } if (rc) { + da1469x_pd_release(MCU_PD_DOMAIN_PER); --dev->dgd_adc.ad_ref_cnt; } os_mutex_release(&dev->dgd_adc.ad_lock); @@ -521,6 +525,7 @@ da1469x_gpadc_close(struct os_dev *odev) CRG_TOP->LDO_VDDD_HIGH_CTRL_REG &= ~CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_ENABLE_Msk; + da1469x_pd_release(MCU_PD_DOMAIN_PER); } os_mutex_release(&dev->dgd_adc.ad_lock); return rc;
mesh: Add net transmit status rx in config client Adds an opcode handler for the network transmit status opcode. this is port of
@@ -136,6 +136,27 @@ static void relay_status(struct bt_mesh_model *model, k_sem_give(&cli->op_sync); } +static void net_transmit_status(struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, + struct os_mbuf *buf) +{ + uint8_t *status; + + BT_DBG("net_idx 0x%04x app_idx 0x%04x src 0x%04x len %u: %s", + ctx->net_idx, ctx->app_idx, ctx->addr, buf->om_len, + bt_hex(buf->om_data, buf->om_len)); + + if (cli->op_pending != OP_NET_TRANSMIT_STATUS) { + BT_WARN("Unexpected Net Transmit Status message"); + return; + } + + status = cli->op_param; + *status = net_buf_simple_pull_u8(buf); + + k_sem_give(&cli->op_sync); +} + struct net_key_param { uint8_t *status; uint16_t net_idx; @@ -693,6 +714,7 @@ const struct bt_mesh_model_op bt_mesh_cfg_cli_op[] = { { OP_FRIEND_STATUS, 1, friend_status }, { OP_GATT_PROXY_STATUS, 1, gatt_proxy_status }, { OP_RELAY_STATUS, 2, relay_status }, + { OP_NET_TRANSMIT_STATUS, 1, net_transmit_status }, { OP_NET_KEY_STATUS, 3, net_key_status }, { OP_NET_KEY_LIST, 0, net_key_list }, { OP_APP_KEY_STATUS, 4, app_key_status },
partially picked changes in
@@ -32,7 +32,7 @@ enum { HTTP_EVENT_SEND_RESP_HDR }; -struct event_t { +typedef struct st_http_event_t { uint8_t type; uint64_t conn_id; uint64_t req_id; @@ -46,12 +46,12 @@ struct event_t { char value[MAX_HDR_LEN]; } header; }; -}; +} http_event_t; BPF_PERF_OUTPUT(events); int trace_receive_request(struct pt_regs *ctx) { - struct event_t ev = { .type = HTTP_EVENT_RECEIVE_REQ }; + http_event_t ev = { .type = HTTP_EVENT_RECEIVE_REQ }; bpf_usdt_readarg(1, ctx, &ev.conn_id); bpf_usdt_readarg(2, ctx, &ev.req_id); bpf_usdt_readarg(3, ctx, &ev.http_version); @@ -60,7 +60,7 @@ int trace_receive_request(struct pt_regs *ctx) { } int trace_receive_request_header(struct pt_regs *ctx) { - struct event_t ev = { .type = HTTP_EVENT_RECEIVE_REQ_HDR }; + http_event_t ev = { .type = HTTP_EVENT_RECEIVE_REQ_HDR }; void *pos = NULL; bpf_usdt_readarg(1, ctx, &ev.conn_id); bpf_usdt_readarg(2, ctx, &ev.req_id); @@ -75,7 +75,7 @@ int trace_receive_request_header(struct pt_regs *ctx) { } int trace_send_response(struct pt_regs *ctx) { - struct event_t ev = { .type = HTTP_EVENT_SEND_RESP }; + http_event_t ev = { .type = HTTP_EVENT_SEND_RESP }; bpf_usdt_readarg(1, ctx, &ev.conn_id); bpf_usdt_readarg(2, ctx, &ev.req_id); bpf_usdt_readarg(3, ctx, &ev.http_status); @@ -84,7 +84,7 @@ int trace_send_response(struct pt_regs *ctx) { } int trace_send_response_header(struct pt_regs *ctx) { - struct event_t ev = { .type = HTTP_EVENT_SEND_RESP_HDR }; + http_event_t ev = { .type = HTTP_EVENT_SEND_RESP_HDR }; void *pos = NULL; bpf_usdt_readarg(1, ctx, &ev.conn_id); bpf_usdt_readarg(2, ctx, &ev.req_id);
dshot: increase motor reverse command count
@@ -358,7 +358,7 @@ void motor_write(float *values) { if (time_millis() - dir_change_time < DSHOT_DIR_CHANGE_IDLE_TIME) { // give the motors enough time to come a full stop make_packet_all(0, false); - } else if (counter <= 12) { + } else if (counter <= 24) { const uint16_t value = motor_dir == MOTOR_REVERSE ? DSHOT_CMD_ROTATE_REVERSE : DSHOT_CMD_ROTATE_NORMAL; make_packet_all(value, true); counter++;
Add kscePowerSetDisplayBrightness to db.yml
@@ -6467,6 +6467,7 @@ modules: kscePowerSetBatteryFakeStatus: 0x0C6973B8 kscePowerSetBusClockFrequency: 0xB8D7B3FB kscePowerSetCompatClockFrequency: 0xFFC84E69 + kscePowerSetDisplayBrightness: 0x43D5CE1D kscePowerSetDisplayMaxBrightness: 0x77027B6B kscePowerSetGpuClockFrequency: 0x264C24FC kscePowerSetGpuXbarClockFrequency: 0xA7739DBE
puff: Disable TCPMv2. On puff with TCPMv2 enabled, the type C mux is not being configured to allow USB 3. Disable TCPMv2 for now to unblock testing. BRANCH=None TEST=make buildall
#define CONFIG_CHARGER_INPUT_CURRENT 512 /* Allow low-current USB charging */ /* USB type C */ -/* Use TCPMv2 */ +/* TODO: (b/147255678) Use TCPMv2 */ +#if 0 #define CONFIG_USB_SM_FRAMEWORK +#endif + #undef CONFIG_USB_CHARGER #define CONFIG_USB_POWER_DELIVERY #define CONFIG_USB_PID 0x5040
Fix wrong creation of sensor nodes and device groups
@@ -1653,6 +1653,31 @@ void DeRestPluginPrivate::handleIndicationFindSensors(const deCONZ::ApsDataIndic findSensorCandidates.push_back(sc); return; } + else if (ind.profileId() == ZLL_PROFILE_ID || ind.profileId() == HA_PROFILE_ID) + { + switch (ind.clusterId()) + { + case ONOFF_CLUSTER_ID: + case SCENE_CLUSTER_ID: + if ((zclFrame.frameControl() & deCONZ::ZclFCClusterCommand) == 0) + { + return; + } + + if (zclFrame.frameControl() & deCONZ::ZclFCDirectionServerToClient) + { + return; + } + break; // ok + + default: + return; + } + } + else + { + return; + } if (ind.dstAddressMode() != deCONZ::ApsGroupAddress && ind.dstAddressMode() != deCONZ::ApsNwkAddress) { @@ -1686,16 +1711,35 @@ void DeRestPluginPrivate::handleIndicationFindSensors(const deCONZ::ApsDataIndic { Sensor *sensor = getSensorNodeForAddressAndEndpoint(ind.srcAddress(), ind.srcEndpoint()); - if (sensor) + if (sensor && sensor->node()) { indAddress = sensor->address(); - macCapabilities = sensor->node() ? (int)sensor->node()->nodeDescriptor().macCapabilities() : 0x80; + macCapabilities = (int)sensor->node()->macCapabilities(); } else if (apsCtrl) { - indAddress = ind.srcAddress(); - apsCtrl->resolveAddress(indAddress); - macCapabilities = 0x80; // assume end-device + int i = 0; + const deCONZ::Node *node; + + while (apsCtrl->getNode(i, &node) == 0) + { + if (node->address().hasExt() && ind.srcAddress().hasExt() && + ind.srcAddress().ext() == node->address().ext()) + { + indAddress = node->address(); + macCapabilities = node->macCapabilities(); + break; + } + + if (node->address().hasNwk() && ind.srcAddress().hasNwk() && + ind.srcAddress().nwk() == node->address().nwk()) + { + indAddress = node->address(); + macCapabilities = node->macCapabilities(); + break; + } + i++; + } } }
pic32mz: Fix remote_wakeup without OS Remote wakeup requires 10ms of delay when RESUME bit is toggled. It was covered for OS build. For non-OS build simple delay based on board_millis() is used to wait required amount of time. Without this remote wakup may not work.
@@ -163,6 +163,10 @@ void dcd_remote_wakeup(uint8_t rhport) USB_REGS->POWERbits.RESUME = 1; #if CFG_TUSB_OS != OPT_OS_NONE osal_task_delay(10); +#else + // TODO: Wait in non blocking mode + unsigned cnt = 2000; + while (cnt--) __asm__("nop"); #endif USB_REGS->POWERbits.RESUME = 0; }
added mssing default value for sim refclk_200
@@ -711,7 +711,7 @@ ARCHITECTURE afu OF afu IS SIGNAL c1_ddr3_ras_n : STD_LOGIC; -- only for DDR3_USED=TRUE SIGNAL c1_ddr3_reset_n : STD_LOGIC; -- only for DDR3_USED=TRUE SIGNAL c1_ddr3_we_n : STD_LOGIC; -- only for DDR3_USED=TRUE - SIGNAL refclk200_p : STD_LOGIC; -- only for DDR3_USED=TRUE + SIGNAL refclk200_p : STD_LOGIC:= '0'; -- only for DDR3_USED=TRUE SIGNAL refclk200_n : STD_LOGIC; -- only for DDR3_USED=TRUE SIGNAL c1_ddr3_ui_clk : STD_LOGIC; -- only for DDR3_USED=TRUE SIGNAL c1_ddr3_ui_clk_sync_rst : STD_LOGIC; -- only for DDR3_USED=TRUE
Add doxygen comment for new kernel api : posix_spawn_file_actions_adddup2 posix_spawn_file_actions_adddup2() is a new api for TizenRT v1.1
@@ -197,13 +197,10 @@ int posix_spawn_file_actions_destroy(FAR posix_spawn_file_actions_t *file_action */ int posix_spawn_file_actions_addclose(FAR posix_spawn_file_actions_t *file_actions, int fd); /** - * @cond - * @internal + * @brief POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) + * @since Tizen RT v1.1 */ int posix_spawn_file_actions_adddup2(FAR posix_spawn_file_actions_t *file_actions, int fd1, int fd2); -/** - * @endcond - */ /** * @brief POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) * @since Tizen RT v1.0
interface: run chromatic on push to update baselines
@@ -4,6 +4,11 @@ on: pull_request: paths: - 'pkg/interface/**' + push: + paths: + - 'pkg/interface/**' + branches: + - 'release/next-userspace' jobs: chromatic-deployment:
Make page's header transparency 1
@@ -68,7 +68,7 @@ features : # Theme Settings topbar_color : "#000000" -topbar_transparency : 0.1 +topbar_transparency : 1 topbar_title_color : "#000000" cover_image : # Replace with alternative image path or image URL.
build: renew "Build Time" whenever building a new image This patch renews .version and version.h whenever building a new tizenrt image.
@@ -229,7 +229,7 @@ BIN_EXE = tinyara$(EXEEXT) BIN = $(BIN_DIR)/$(BIN_EXE) all: $(BIN) memstat -.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean +.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean force_build # Target used to copy include/tinyara/math.h. If CONFIG_ARCH_MATH_H is # defined, then there is an architecture specific math.h header file @@ -291,15 +291,15 @@ endif # part of the overall TinyAra configuration sequence. Notice that the # tools/mkversion tool is built and used to create include/tinyara/version.h +force_build: + tools/mkversion$(HOSTEXEEXT): $(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkversion$(HOSTEXEEXT) -$(TOPDIR)/.version: - $(Q) if [ ! -f .version ]; then \ - echo "No .version file found, creating one"; \ +$(TOPDIR)/.version: force_build + echo "create .version file"; \ tools/version.sh -v 1.0 .version; \ - chmod 755 .version; \ - fi + chmod 755 .version include/tinyara/version.h: $(TOPDIR)/.version tools/mkversion$(HOSTEXEEXT) $(Q) tools/mkversion $(TOPDIR) > include/tinyara/version.h
config: make boolean value more flexible: on, true and yes (fix
@@ -324,8 +324,9 @@ static int set_log_level(struct flb_config *config, char *v_str) static inline int atobool(char*v) { - return (strncasecmp("true", v, 256) == 0 || - strncasecmp("on", v, 256) == 0) + return (strcasecmp("true", v) == 0 || + strcasecmp("on", v) == 0 || + strcasecmp("yes", v) == 0) ? FLB_TRUE : FLB_FALSE; }
Include time.h not matter if PROFILING_ENABLED is defined or not. Now that YR_RULE and YR_STRING always have a clock_ticks fields type clock_t must be defined.
@@ -39,10 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <yara/threading.h> - -#ifdef PROFILING_ENABLED #include <time.h> -#endif #define DECLARE_REFERENCE(type, name) \
touch_sensor.c: Fix datatype of argument for timer callback function
@@ -432,7 +432,7 @@ esp_err_t touch_pad_filter_start(uint32_t filter_period_ms) } if (s_touch_pad_filter->timer == NULL) { s_touch_pad_filter->timer = xTimerCreate("filter_tmr", filter_period_ms / portTICK_PERIOD_MS, pdFALSE, - NULL, touch_pad_filter_cb); + NULL, (TimerCallbackFunction_t) touch_pad_filter_cb); if (s_touch_pad_filter->timer == NULL) { free(s_touch_pad_filter); s_touch_pad_filter = NULL;
tmp floopy driver save, no test
@@ -11,6 +11,18 @@ static __inline unsigned char inb(int port) __asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port)); return data; } +static __inline unsigned char inb_p(unsigned short port) +{ + unsigned char _v; + __asm__ __volatile__ ("inb %1, %0\n\t" + // "outb %0,$0x80\n\t" + // "outb %0,$0x80\n\t" + // "outb %0,$0x80\n\t" + "outb %0,$0x80" + :"=a" (_v) + :"d" ((unsigned short) port)); + return _v; +} static __inline unsigned short inw(int port) { @@ -39,11 +51,36 @@ static __inline void outb(int port, unsigned char data) __asm __volatile("outb %0,%w1" : : "a" (data), "d" (port)); } + +static __inline void outb_p(char value, unsigned short port) +{ + __asm__ __volatile__ ("outb %0,%1\n\t" + "outb %0,$0x80" + ::"a" ((char) value),"d" ((unsigned short) port)); +} + static __inline void outw(int port, unsigned short data) { __asm __volatile("outw %0,%w1" : : "a" (data), "d" (port)); } +static __inline unsigned char readcmos(int reg) +{ + outb(reg,0x70); + return (unsigned char) inb(0x71); +} + + + +#define io_delay() \ + __asm__ __volatile__ ("pushal \n\t"\ + "mov $0x3F6, %dx \n\t" \ + "inb %dx, %al \n\t" \ + "inb %dx, %al \n\t" \ + "inb %dx, %al \n\t" \ + "inb %dx, %al \n\t" \ + "popal") + /* Gate descriptors are slightly different*/ struct Gatedesc { unsigned gd_off_15_0 : 16; // low 16 bits of offset in segment
Update the license for 2021
MIT License -Copyright (c) 2019-2020 Jason Hall +Copyright (c) 2019-2021 Jason Hall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
Fix initial web header...
@@ -220,7 +220,7 @@ papplClientHTMLHeader( " <div class=\"header\">\n" " <div class=\"row\">\n" " <div class=\"col-3 nav\">\n" - " <a class=\"nav\" href=\"/\"><img class=\"nav\" src=\"/nav-icon.png\"> %s %s\n" + " <a class=\"nav\" href=\"/\"><img class=\"nav\" src=\"/nav-icon.png\"> %s %s</a>\n" " </div>\n" " <div class=\"col-9 nav\">\n", sw_name, sw_sversion);
rms/munge: update service patch for latest munge
---- src/etc/munge.service 2013-08-27 11:35:31.000000000 -0700 -+++ src/etc/munge.service 2014-11-10 11:37:55.104178894 -0800 +--- src/etc/munge.service.in 2013-08-27 11:35:31.000000000 -0700 ++++ src/etc/munge.service.in 2014-11-10 11:37:55.104178894 -0800 User=munge Group=munge
Do not include sparse_array.o in libssl with no-shared
@@ -102,7 +102,9 @@ $UTIL_COMMON=\ param_build_set.c der_writer.c threads_lib.c params_dup.c \ quic_vlint.c time.c +IF[{- !$disabled{shared} -}] SOURCE[../libssl]=sparse_array.c +ENDIF SOURCE[../libcrypto]=$UTIL_COMMON \ mem.c mem_sec.c \
zeromqsend: fix for failing MacOS tests
@@ -37,6 +37,8 @@ void * context; /** timeout for tests in seconds */ #define TEST_TIMEOUT 3 +#define TEST_ENDPOINT "ipc://testmod_zeromqsend" + /** * Create subscriber socket for tests. * @internal @@ -50,7 +52,7 @@ static void * createTestSocket (char * subscribeFilter) usleep (TIME_HOLDOFF); void * subSocket = zmq_socket (context, ZMQ_SUB); - int result = zmq_bind (subSocket, "tcp://*:6000"); + int result = zmq_bind (subSocket, TEST_ENDPOINT); if (result != 0) { yield_error ("zmq_bind failed"); @@ -88,6 +90,8 @@ static void * notificationReaderThreadMain (void * filter) int lastErrno; do { + usleep (100 * 1000); // wait 100 ms + lastErrno = 0; int result = zmq_msg_recv (&message, subSocket, ZMQ_DONTWAIT); @@ -142,6 +146,7 @@ static void * notificationReaderThreadMain (void * filter) default: yield_error ("test inconsistency"); } + partCounter++; } } while (lastErrno == EAGAIN || (more && partCounter < maxParts)); @@ -174,7 +179,7 @@ static void test_sending (void) char * sendingKeyName = "user/foo/bar"; void * pubSocket = zmq_socket (context, ZMQ_PUB); - int result = zmq_connect (pubSocket, "tcp://localhost:6000"); + int result = zmq_connect (pubSocket, TEST_ENDPOINT); if (result != 0) { yield_error ("zmq_connect failed!"); @@ -208,7 +213,7 @@ static void test_commit (void) Key * toAdd = keyNew ("system/tests/foo/bar", KEY_END); KeySet * ks = ksNew (0, KS_END); - KeySet * conf = ksNew (0, KS_END); + KeySet * conf = ksNew (1, keyNew ("/config/endpoint", KEY_VALUE, TEST_ENDPOINT, KEY_END), KS_END); PLUGIN_OPEN ("zeromqsend"); // initial get to save current state
Update echo_example_main.c Fixed compile error in example. `error: designator order for field 'esp_ping_callbacks_t::cb_args' does not match declaration order in 'esp_ping_callbacks_t'`. Moved `.cb_args` in example to match declaration.
@@ -137,10 +137,10 @@ static int do_ping_cmd(int argc, char **argv) /* set callback functions */ esp_ping_callbacks_t cbs = { + .cb_args = NULL, .on_ping_success = cmd_ping_on_ping_success, .on_ping_timeout = cmd_ping_on_ping_timeout, - .on_ping_end = cmd_ping_on_ping_end, - .cb_args = NULL + .on_ping_end = cmd_ping_on_ping_end }; esp_ping_handle_t ping; esp_ping_new_session(&config, &cbs, &ping);
module.c edited online with Bitbucket. Rory replaced AddModuleRadheat with fvAddModuleRadheat in module.c.
@@ -350,7 +350,7 @@ void FinalizeModule(BODY *body,MODULE *module,int iBody) { module->iaModule[iBody][iModule++] = DISTROT; } if (body[iBody].bRadheat) { - AddModuleRadheat(module,iBody,iModule); + fvAddModuleRadheat(module,iBody,iModule); module->iaModule[iBody][iModule++] = RADHEAT; } if (body[iBody].bThermint) {
Add working directory to module search path for debug mode or embedded mode.
@@ -2926,6 +2926,10 @@ def _cmd_setup_server(command, args, options): if options['python_paths'] is None: options['python_paths'] = [] + if options['debug_mode'] or options['embedded_mode']: + if options['working_directory'] not in options['python_paths']: + options['python_paths'].insert(0, options['working_directory']) + # Special case to check for when being executed from shiv variant # of a zipapp application bundle. We need to work out where the # site packages directory is and pass it with Python module search
make test: rename dummy test name
@@ -8,7 +8,7 @@ from framework import VppTestCase, KeepAliveReporter class SanityTestCase(VppTestCase): - """ Dummy test case used to check if VPP is able to start """ + """ Sanity test case - verify if VPP is able to start """ pass if __name__ == '__main__':
Update example/https/README for name changes
@@ -7,7 +7,7 @@ After running `make examples`, if SSL is enabled, you can quickly test HTTPS, wi # Test without client auth # Run the server -./examples/example_https \ +./examples/example_https_server \ -cert examples/https/server-crt.pem \ -key examples/https/server-key.pem @@ -16,7 +16,7 @@ curl -vk https://localhost:4443/ # Test WITH client auth -./examples/example_https \ +./examples/example_https_server \ -cert examples/https/server-crt.pem \ -key examples/https/server-key.pem \ -ca examples/https/ca-crt.pem \
fixup: check Python version to decide the import
@@ -3,7 +3,12 @@ from copy import deepcopy from six import iteritems, string_types, integer_types import os import imp + +if sys.version_info >= (3, 3): from collections.abc import Iterable, Sequence, Mapping, MutableMapping +else: + from collections import Iterable, Sequence, Mapping, MutableMapping + import warnings import numpy as np import ctypes
fix versor alignment
@@ -286,7 +286,7 @@ glm_quat_conjugate(versor q, versor dest) { CGLM_INLINE void glm_quat_inv(versor q, versor dest) { - CGLM_ALIGN(8) versor conj; + CGLM_ALIGN(16) versor conj; glm_quat_conjugate(q, conj); glm_vec4_scale(conj, 1.0f / glm_vec4_norm2(q), dest); }
cbm in load_model
@@ -2394,7 +2394,7 @@ class CatBoost(_CatBoostBase): ) self._save_model(fname, format, export_parameters, pool) - def load_model(self, fname, format='catboost'): + def load_model(self, fname, format='cbm'): """ Load model from a file.
Fix invalid Invalid character escape
@@ -615,7 +615,7 @@ if(RTOS_CHIBIOS_CHECK) else() # board NOT found in targets folder # can't continue - message(FATAL_ERROR "\n\nSorry but support for ${CHIBIOS_BOARD} target is not available...\n\You can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n") + message(FATAL_ERROR "\n\nSorry but support for ${CHIBIOS_BOARD} target is not available...\n\nYou can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n") endif() endif()
Always create a key when importing Even if there is no data to import we should still create an empty key.
@@ -39,6 +39,13 @@ static int try_import(const OSSL_PARAM params[], void *arg) { struct import_data_st *data = arg; + /* Just in time creation of keydata */ + if (data->keydata == NULL + && (data->keydata = evp_keymgmt_newdata(data->keymgmt)) == NULL) { + ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + /* * It's fine if there was no data to transfer, we just end up with an * empty destination key. @@ -46,13 +53,6 @@ static int try_import(const OSSL_PARAM params[], void *arg) if (params[0].key == NULL) return 1; - /* Just in time creation of keydata, if needed */ - if (data->keydata == NULL - && (data->keydata = evp_keymgmt_newdata(data->keymgmt)) == NULL) { - ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE); - return 0; - } - return evp_keymgmt_import(data->keymgmt, data->keydata, data->selection, params); }
Fix INTERFACE64 builds on riscv and loongarch
@@ -827,13 +827,32 @@ endif ifeq ($(ARCH), riscv64) NO_BINARY_MODE = 1 BINARY_DEFINED = 1 +ifdef INTERFACE64 +ifneq ($(INTERFACE64), 0) +ifeq ($(F_COMPILER), GFORTRAN) +FCOMMON_OPT += -fdefault-integer-8 +endif +ifeq ($(F_COMPILER), FLANG) +FCOMMON_OPT += -i8 +endif +endif +endif endif ifeq ($(ARCH), loongarch64) NO_BINARY_MODE = 1 BINARY_DEFINED = 1 +ifdef INTERFACE64 +ifneq ($(INTERFACE64), 0) +ifeq ($(F_COMPILER), GFORTRAN) +FCOMMON_OPT += -fdefault-integer-8 +endif +ifeq ($(F_COMPILER), FLANG) +FCOMMON_OPT += -i8 +endif +endif +endif endif - # # C Compiler dependent settings
Fixed minor typos in README Tested-by: IoTivity Jenkins
@@ -4,15 +4,15 @@ Java Language binding for IoTivity-lite using SWIG Introduction ================================================= This uses a tool called SWIG to generate Java language bindings for IoTivity-lite. SWIG is an -interface compiler that connect programs written in C and C++ with other languages such as Java. +interface compiler that connects programs written in C and C++ with other languages such as Java. SWIG is not a stubs generator. It produces code that can be compiled and used. The output is -generated by a tool. For this reason there is not fancy encapsulation of the code to make it +generated by a tool. For this reason there is no fancy encapsulation of the code to make it appear more like what most developers would expect when using Java code. The output is not organized into classes. The output classes with very few exceptions are just a collection of static methods. This has both the advantage and disadvantage that the way the code is used in Java is similar to the way it is used in C. This means the code does not resemble what a -typical Java programmer expects but it is easy for someone familiar with the C code to flow the +typical Java programmer expects but it is easy for someone familiar with the C code to follow the flow of the code. The Java output is still in early development and is expected to change. Since the Java output
fix FIXME in transformStorageEncodingClause The parameter namespace passed to transformRelOptions routine has only tow values. One is 'toast',the other one is NULL. 'toast' value is to filter toast reloptions. NULL value is to get no-toast reloptions. In transformStorageEncodingClause routine just need to get no-toast reloption. Author: Max Yang
@@ -3612,8 +3612,6 @@ transformStorageEncodingClause(List *options) */ d = transformRelOptions(PointerGetDatum(NULL), list_concat(extra, options), - /* GPDB_84_MERGE_FIXME: do we need any - * namespaces? */ NULL, NULL, true, false); (void)heap_reloptions(RELKIND_RELATION, d, true);
docs: update asio docs with new example paths after refactor.
@@ -36,8 +36,7 @@ ESP examples are based on standard asio :example:`protocols/asio`: - :example:`protocols/asio/udp_echo_server` - :example:`protocols/asio/tcp_echo_server` -- :example:`protocols/asio/chat_client` -- :example:`protocols/asio/chat_server` +- :example:`protocols/asio/asio_chat` - :example:`protocols/asio/ssl_client_server` Please refer to the specific example README.md for details
fixed circle collision export
@@ -88,7 +88,7 @@ public class Collision extends Resource outS.append(" dc.w " + ccircle.ray + "\n"); outB.write(ccircle.x); outB.write(ccircle.y); - Util.outB(outB, ccircle.ray); + Util.outB(outB, (short) ccircle.ray); } else {
Fix nvs_flash_generate_keys Merges
@@ -571,16 +571,24 @@ extern "C" esp_err_t nvs_flash_generate_keys(const esp_partition_t* partition, n } for(uint8_t cnt = 0; cnt < NVS_KEY_SIZE; cnt++) { + /* Adjacent 16-byte blocks should be different */ + if (((cnt / 16) & 1) == 0) { cfg->eky[cnt] = 0xff; cfg->tky[cnt] = 0xee; + } else { + cfg->eky[cnt] = 0x99; + cfg->tky[cnt] = 0x88; + } } - err = esp_partition_write(partition, 0, cfg->eky, NVS_KEY_SIZE); + /* Write without encryption */ + err = esp_partition_write_raw(partition, 0, cfg->eky, NVS_KEY_SIZE); if(err != ESP_OK) { return err; } - err = esp_partition_write(partition, NVS_KEY_SIZE, cfg->tky, NVS_KEY_SIZE); + /* Write without encryption */ + err = esp_partition_write_raw(partition, NVS_KEY_SIZE, cfg->tky, NVS_KEY_SIZE); if(err != ESP_OK) { return err; }
Added debug print to restart and shutdown gateway
#ifdef ARCH_ARM #include <unistd.h> #include <sys/reboot.h> + #include <errno.h> #endif #include "colorspace.h" #include "de_web_plugin.h" @@ -11683,7 +11684,10 @@ void DeRestPluginPrivate::restartGatewayTimerFired() { //qApp->exit(APP_RET_RESTART_SYS); #ifdef ARCH_ARM - reboot(RB_AUTOBOOT); + if (reboot(RB_AUTOBOOT) == -1) + { + DBG_Printf(DBG_INFO, "Reboot failed with errno: %s\n", strerror(errno)); + } #endif } @@ -11691,7 +11695,10 @@ void DeRestPluginPrivate::shutDownGatewayTimerFired() { // qApp->exit(APP_RET_SHUTDOWN_SYS); #ifdef ARCH_ARM - reboot(RB_POWER_OFF); + if (reboot(RB_POWER_OFF) == -1) + { + DBG_Printf(DBG_INFO, "Shutdown failed with errno: %s\n", strerror(errno)); + } #endif }
[numerics,swig] fix sparse deep copy on unzeroed pointers
@@ -175,7 +175,7 @@ typedef struct cs_sparse /* matrix in compressed-column or triplet form */ if (!res) { goto fail; } else if (res < 0) { SWIG_Error(SWIG_RuntimeError, "Error the matrix is not sparse!"); goto fail; } - M = (CSparseMatrix *) malloc(sizeof(CSparseMatrix)); + M = (CSparseMatrix *) calloc(sizeof(CSparseMatrix), 1); if(!M) { SWIG_Error(SWIG_RuntimeError, "Failed to allocate a cs_sparse"); goto fail; } // perform a deep copy since we do not have any mechanism to record the fact we use data from the python object
Documentation change only: minor English correction in README.md.
@@ -12,9 +12,9 @@ Note: currently building/running/debugging is only supported on the following pl 1. Make sure you have Python 3.x installed and that it is in your `PATH` environment. Also make sure that `pip3` is accessable through your `PATH` environment. 2. Run either [setup_linux.sh](setup_linux.sh) or [setup_windows.bat](setup_windows.sh) depending on your platform. 3. In vscode use `Open workspace from file` and open [ubxlib-runner.code-workspace](/ubxlib-runner.code-workspace). -4. Make sure that all the extentsions recommended by the workspace is installed. +4. Make sure that all the extensions recommended by the workspace are installed. -## `config.yml` +## [config.yml](config.yml) This file is used to tell what SDK versions should be downloaded and where to install them. If you already have some SDKs installed you can point to their location. If not you will be asked for confirmation when you try to build a target if you want to download the required software. ## `u_flags.yml`
Make sure all appveyor artifacts get deployed
@@ -59,7 +59,7 @@ deploy: provider: GitHub auth_token: secure: lwEXy09qhj2jSH9s1C/KvCkAUqJSma8phFR+0kbsfUc3rVxpNK5uD3z9Md0SjYRx - artifact: /janet-.*/ + artifact: /janet.*/ draft: true on: APPVEYOR_REPO_TAG: true
Switch deprecation method for SEED
@@ -72,35 +72,38 @@ typedef struct seed_key_st { # endif } SEED_KEY_SCHEDULE; # endif /* OPENSSL_NO_DEPRECATED_3_0 */ - -DEPRECATEDIN_3_0(void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], - SEED_KEY_SCHEDULE *ks)) - -DEPRECATEDIN_3_0(void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], +# ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], + SEED_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 +void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], - const SEED_KEY_SCHEDULE *ks)) -DEPRECATEDIN_3_0(void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], + const SEED_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 +void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], - const SEED_KEY_SCHEDULE *ks)) - -DEPRECATEDIN_3_0(void SEED_ecb_encrypt(const unsigned char *in, + const SEED_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 +void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out, - const SEED_KEY_SCHEDULE *ks, int enc)) -DEPRECATEDIN_3_0(void SEED_cbc_encrypt(const unsigned char *in, - unsigned char *out, size_t len, + const SEED_KEY_SCHEDULE *ks, int enc); +OSSL_DEPRECATEDIN_3_0 +void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], - int enc)) -DEPRECATEDIN_3_0(void SEED_cfb128_encrypt(const unsigned char *in, - unsigned char *out, size_t len, - const SEED_KEY_SCHEDULE *ks, + int enc); +OSSL_DEPRECATEDIN_3_0 +void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], - int *num, int enc)) -DEPRECATEDIN_3_0(void SEED_ofb128_encrypt(const unsigned char *in, - unsigned char *out, size_t len, - const SEED_KEY_SCHEDULE *ks, + int *num, int enc); +OSSL_DEPRECATEDIN_3_0 +void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], - int *num)) + int *num); +# endif # ifdef __cplusplus }
cmd/kubectl-gadget: Print deploy command result
@@ -300,7 +300,11 @@ func runDeploy(cmd *cobra.Command, args []string) error { } } - if printOnly || !wait { + if printOnly { + return nil + } + if !wait { + info("Inspektor Gadget is being deployed\n") return nil } @@ -350,5 +354,11 @@ func runDeploy(cmd *cobra.Command, args []string) error { } }) + if err != nil { return err } + + info("Inspektor Gadget successfully deployed\n") + + return nil +}
ci: raise legacy adc high/low test low thresh
#elif CONFIG_IDF_TARGET_ESP32C3 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 30 +#define ADC_TEST_LOW_THRESH 50 #define ADC_TEST_HIGH_VAL 4095 #define ADC_TEST_HIGH_THRESH 10
Check that Yices and Z3 are executable right away
@@ -34,8 +34,9 @@ cd $DOWNLOAD_DIR curl https://s3-us-west-2.amazonaws.com/s2n-public-test-dependencies/z3-2017-04-04-Ubuntu14.04-64 > z3 curl https://saw.galois.com/builds/yices/yices_smt2-linux-static > yices_smt2 sudo chmod +x z3 -sudo chmod +x yices_smt2 +sudo chmod +x yices-smt2 mkdir -p $INSTALL_DIR/bin mv z3 $INSTALL_DIR/bin -mv yices_smt2 $INSTALL_DIR/bin - +mv yices-smt2 $INSTALL_DIR/bin +$INSTALL_DIR/bin/z3 --version +$INSTALL_DIR/bin/yices-smt2 --version
Add maximum to received frame streams frames.
/** the msec to wait for reconnect slow, to stop busy spinning on reconnect */ #define DTIO_RECONNECT_TIMEOUT_SLOW 1000 +/** maximum length of received frame */ +#define DTIO_RECV_FRAME_MAX_LEN 1000 + struct stop_flush_info; /** DTIO command channel commands */ enum { @@ -1031,6 +1034,12 @@ static int dtio_read_accept_frame(struct dt_io_thread* dtio) continue; } dtio->read_frame.frame_len = ntohl(dtio->read_frame.frame_len); + if(dtio->read_frame.frame_len > DTIO_RECV_FRAME_MAX_LEN) { + verbose(VERB_OPS, "dnstap: received frame exceeds max " + "length, capped to %d bytes", + DTIO_RECV_FRAME_MAX_LEN); + dtio->read_frame.frame_len = DTIO_RECV_FRAME_MAX_LEN; + } dtio->read_frame.buf = calloc(1, dtio->read_frame.frame_len); dtio->read_frame.buf_cap = dtio->read_frame.frame_len; if(!dtio->read_frame.buf) {
Prevent flipping static actors
@@ -85,14 +85,14 @@ void UpdateActors_b() { } else if (actor->dir.x != 0) { fo = 2 + MUL_2(actor->sprite_type == SPRITE_ACTOR_ANIMATED); } - } - - LOG("RERENDER actor a=%u\n", a); // Facing left so flip sprite if (IS_NEG(actor->dir.x)) { LOG("AUR FLIP DIR X0\n"); flip = TRUE; } + } + + LOG("RERENDER actor a=%u\n", a); frame = MUL_4(actor->sprite + actor->frame + fo); LOG("RERENDER actor a=%u with FRAME %u [ %u + %u ] \n", a, frame, actor->sprite,
nimble/mesh: using correct define name
#define MYNEWT_VAL_BLE_MESH_TX_SEG_MSG_COUNT (4) #endif -#ifndef MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANSMIT_ATTEMPTS -#define MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANSMIT_ATTEMPTS (2) +#ifndef MYNEWT_VAL_BLE_MESH_SEG_RETRANSMIT_ATTEMPTS +#define MYNEWT_VAL_BLE_MESH_SEG_RETRANSMIT_ATTEMPTS (2) #endif /*** net/nimble/host/services/ans */
Added message notifying which language pack json to create if current language not supported.
@@ -2,7 +2,7 @@ import electron from "electron"; import en from "../../lang/en"; const app = electron.app || electron.remote.app; -const locale = app.getLocale() +const locale = app.getLocale(); let languageOverrides = {}; @@ -11,6 +11,9 @@ if (locale && locale !== "en") { languageOverrides = require(`../../lang/${locale}.json`); } catch (e) { console.warn("No language pack for user setting, falling back to en"); + console.warn( + `Add a language pack by making the file src/lang/${locale}.json` + ); } }