diff --git a/LICENSE b/LICENSE index eb38b7a7582b43a2b73497c61d1ff91488bbbc57..cad0117cd20b77cbcb7b2658c1d0eb46328ce553 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ -Copyright (c) 2004-2013 Sergey Lyubka <valenok@gmail.com> -Copyright (c) 2013-2018 Cesanta Software Limited +Copyright (c) 2004-2013 Sergey Lyubka +Copyright (c) 2013-2020 Cesanta Software Limited All rights reserved This software is dual-licensed: you can redistribute it and/or modify diff --git a/mongoose.c b/mongoose.c index 6a409a336f795c4885ea6bac5f8c4a29154dbf9d..6236b2fd2f0a6c6b006f0dd87a4178f6916465c0 100644 --- a/mongoose.c +++ b/mongoose.c @@ -19,7 +19,7 @@ #include "mongoose.h" #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_internal.h" +#line 1 "src/mg_internal.h" #endif #ifndef CS_MONGOOSE_SRC_INTERNAL_H_ @@ -180,7 +180,7 @@ MG_INTERNAL int mg_sntp_parse_reply(const char *buf, int len, #endif /* CS_MONGOOSE_SRC_INTERNAL_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/mg_mem.h" +#line 1 "src/common/mg_mem.h" #endif #ifndef CS_COMMON_MG_MEM_H_ @@ -212,7 +212,7 @@ extern "C" { #endif /* CS_COMMON_MG_MEM_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_base64.c" +#line 1 "src/common/cs_base64.c" #endif #ifndef EXCLUDE_COMMON @@ -416,7 +416,7 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst, int *dec_len) { #endif /* EXCLUDE_COMMON */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_dbg.h" +#line 1 "src/common/cs_dbg.h" #endif #ifndef CS_COMMON_CS_DBG_H_ @@ -551,7 +551,7 @@ void cs_log_printf(const char *fmt, ...) PRINTF_LIKE(1, 2); #endif /* CS_COMMON_CS_DBG_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_dbg.c" +#line 1 "src/common/cs_dbg.c" #endif /* Amalgamated: #include "common/cs_dbg.h" */ @@ -681,7 +681,7 @@ void cs_log_set_level(enum cs_log_level level) { #endif } #ifdef MG_MODULE_LINES -#line 1 "common/cs_dirent.h" +#line 1 "src/common/cs_dirent.h" #endif #ifndef CS_COMMON_CS_DIRENT_H_ @@ -719,7 +719,7 @@ struct dirent *readdir(DIR *dir); #endif /* CS_COMMON_CS_DIRENT_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_dirent.c" +#line 1 "src/common/cs_dirent.c" #endif #ifndef EXCLUDE_COMMON @@ -814,7 +814,7 @@ struct dirent *readdir(DIR *d) { /* ISO C requires a translation unit to contain at least one declaration */ typedef int cs_dirent_dummy; #ifdef MG_MODULE_LINES -#line 1 "common/cs_time.c" +#line 1 "src/common/cs_time.c" #endif /* Amalgamated: #include "common/cs_time.h" */ @@ -896,7 +896,7 @@ double cs_timegm(const struct tm *tm) { return rt < 0 ? -1 : (double) rt; } #ifdef MG_MODULE_LINES -#line 1 "common/cs_endian.h" +#line 1 "src/common/cs_endian.h" #endif #ifndef CS_COMMON_CS_ENDIAN_H_ @@ -927,7 +927,7 @@ extern "C" { #endif /* CS_COMMON_CS_ENDIAN_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_md5.c" +#line 1 "src/common/cs_md5.c" #endif /* * This code implements the MD5 message-digest algorithm. @@ -1141,7 +1141,7 @@ void cs_md5_final(unsigned char digest[16], cs_md5_ctx *ctx) { #endif /* CS_DISABLE_MD5 */ #endif /* EXCLUDE_COMMON */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_sha1.c" +#line 1 "src/common/cs_sha1.c" #endif /* Copyright(c) By Steve Reid <steve@edmweb.com> */ /* 100% Public Domain */ @@ -1397,7 +1397,7 @@ void cs_hmac_sha1(const unsigned char *key, size_t keylen, #endif /* EXCLUDE_COMMON */ #ifdef MG_MODULE_LINES -#line 1 "common/mbuf.c" +#line 1 "src/common/mbuf.c" #endif #ifndef EXCLUDE_COMMON @@ -1535,7 +1535,7 @@ void mbuf_move(struct mbuf *from, struct mbuf *to) { #endif /* EXCLUDE_COMMON */ #ifdef MG_MODULE_LINES -#line 1 "common/mg_str.c" +#line 1 "src/common/mg_str.c" #endif /* Amalgamated: #include "common/mg_mem.h" */ @@ -1700,7 +1700,7 @@ int mg_str_starts_with(struct mg_str s, struct mg_str prefix) { return (mg_strcmp(sp, prefix) == 0); } #ifdef MG_MODULE_LINES -#line 1 "common/str_util.c" +#line 1 "src/common/str_util.c" #endif #ifndef EXCLUDE_COMMON @@ -2219,7 +2219,7 @@ size_t mg_match_prefix(const char *pattern, int pattern_len, const char *str) { #endif /* EXCLUDE_COMMON */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net.c" +#line 1 "src/mg_net.c" #endif /* Amalgamated: #include "common/cs_time.h" */ @@ -3415,7 +3415,7 @@ double mg_time(void) { return cs_time(); } #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net_if_socket.h" +#line 1 "src/mg_net_if_socket.h" #endif #ifndef CS_MONGOOSE_SRC_NET_IF_SOCKET_H_ @@ -3439,7 +3439,7 @@ extern const struct mg_iface_vtable mg_socket_iface_vtable; #endif /* CS_MONGOOSE_SRC_NET_IF_SOCKET_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net_if_socks.h" +#line 1 "src/mg_net_if_socks.h" #endif #ifndef CS_MONGOOSE_SRC_NET_IF_SOCKS_H_ @@ -3460,7 +3460,7 @@ extern const struct mg_iface_vtable mg_socks_iface_vtable; #endif /* MG_ENABLE_SOCKS */ #endif /* CS_MONGOOSE_SRC_NET_IF_SOCKS_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net_if.c" +#line 1 "src/mg_net_if.c" #endif /* Amalgamated: #include "mg_net_if.h" */ /* Amalgamated: #include "mg_internal.h" */ @@ -3516,7 +3516,7 @@ double mg_mgr_min_timer(const struct mg_mgr *mgr) { return min_timer; } #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net_if_null.c" +#line 1 "src/mg_net_if_null.c" #endif static void mg_null_if_connect_tcp(struct mg_connection *c, @@ -3643,7 +3643,7 @@ const struct mg_iface_vtable mg_null_iface_vtable = MG_NULL_IFACE_VTABLE; const struct mg_iface_vtable mg_default_iface_vtable = MG_NULL_IFACE_VTABLE; #endif /* MG_NET_IF == MG_NET_IF_NULL */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net_if_socket.c" +#line 1 "src/mg_net_if_socket.c" #endif #if MG_ENABLE_NET_IF_SOCKET @@ -4223,7 +4223,7 @@ const struct mg_iface_vtable mg_default_iface_vtable = MG_SOCKET_IFACE_VTABLE; #endif /* MG_ENABLE_NET_IF_SOCKET */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net_if_socks.c" +#line 1 "src/mg_net_if_socks.c" #endif #if MG_ENABLE_SOCKS @@ -4459,7 +4459,7 @@ struct mg_iface *mg_socks_mk_iface(struct mg_mgr *mgr, const char *proxy_addr) { #endif #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_ssl_if_openssl.c" +#line 1 "src/mg_ssl_if_openssl.c" #endif #if MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_OPENSSL @@ -4873,7 +4873,7 @@ const char *mg_set_ssl(struct mg_connection *nc, const char *cert, #endif /* MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_OPENSSL */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_ssl_if_mbedtls.c" +#line 1 "src/mg_ssl_if_mbedtls.c" #endif #if MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_MBEDTLS @@ -5387,7 +5387,7 @@ int mg_ssl_if_mbed_random(void *ctx, unsigned char *buf, size_t len) { #endif /* MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_MBEDTLS */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_uri.c" +#line 1 "src/mg_uri.c" #endif /* Amalgamated: #include "mg_internal.h" */ @@ -5647,7 +5647,7 @@ out: return result; } #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http.c" +#line 1 "src/mg_http.c" #endif #if MG_ENABLE_HTTP @@ -8836,7 +8836,7 @@ void mg_register_http_endpoint(struct mg_connection *nc, const char *uri_path, #endif /* MG_ENABLE_HTTP */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http_cgi.c" +#line 1 "src/mg_http_cgi.c" #endif #ifndef _WIN32 @@ -9348,7 +9348,7 @@ MG_INTERNAL void mg_http_free_proto_data_cgi(struct mg_http_proto_data_cgi *d) { #endif /* MG_ENABLE_HTTP && MG_ENABLE_HTTP_CGI */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http_ssi.c" +#line 1 "src/mg_http_ssi.c" #endif #if MG_ENABLE_HTTP && MG_ENABLE_HTTP_SSI && MG_ENABLE_FILESYSTEM @@ -9550,7 +9550,7 @@ MG_INTERNAL void mg_handle_ssi_request(struct mg_connection *nc, #endif /* MG_ENABLE_HTTP_SSI && MG_ENABLE_HTTP && MG_ENABLE_FILESYSTEM */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http_webdav.c" +#line 1 "src/mg_http_webdav.c" #endif #if MG_ENABLE_HTTP && MG_ENABLE_HTTP_WEBDAV @@ -9818,7 +9818,7 @@ MG_INTERNAL void mg_handle_put(struct mg_connection *nc, const char *path, #endif /* MG_ENABLE_HTTP && MG_ENABLE_HTTP_WEBDAV */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http_websocket.c" +#line 1 "src/mg_http_websocket.c" #endif #if MG_ENABLE_HTTP && MG_ENABLE_HTTP_WEBSOCKET @@ -10336,7 +10336,7 @@ struct mg_connection *mg_connect_ws( } #endif /* MG_ENABLE_HTTP && MG_ENABLE_HTTP_WEBSOCKET */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_util.c" +#line 1 "src/mg_util.c" #endif /* Amalgamated: #include "common/cs_base64.h" */ @@ -10679,7 +10679,7 @@ struct mg_str mg_url_encode(const struct mg_str src) { return mg_url_encode_opt(src, mg_mk_str("._-$,;~()/"), 0); } #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_mqtt.c" +#line 1 "src/mg_mqtt.c" #endif #if MG_ENABLE_MQTT @@ -11211,7 +11211,7 @@ void mg_mqtt_disconnect(struct mg_connection *nc) { #endif /* MG_ENABLE_MQTT */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_mqtt_server.c" +#line 1 "src/mg_mqtt_server.c" #endif /* Amalgamated: #include "mg_internal.h" */ @@ -11404,7 +11404,7 @@ struct mg_mqtt_session *mg_mqtt_next(struct mg_mqtt_broker *brk, #endif /* MG_ENABLE_MQTT_BROKER */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_dns.c" +#line 1 "src/mg_dns.c" #endif #if MG_ENABLE_DNS @@ -11784,7 +11784,7 @@ void mg_set_protocol_dns(struct mg_connection *nc) { #endif /* MG_ENABLE_DNS */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_dns_server.c" +#line 1 "src/mg_dns_server.c" #endif #if MG_ENABLE_DNS_SERVER @@ -11854,7 +11854,7 @@ int mg_dns_reply_record(struct mg_dns_reply *reply, #endif /* MG_ENABLE_DNS_SERVER */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_resolv.c" +#line 1 "src/mg_resolv.c" #endif #if MG_ENABLE_ASYNC_RESOLVER @@ -12145,7 +12145,7 @@ void mg_set_nameserver(struct mg_mgr *mgr, const char *nameserver) { #endif /* MG_ENABLE_ASYNC_RESOLVER */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_coap.c" +#line 1 "src/mg_coap.c" #endif /* Amalgamated: #include "mg_internal.h" */ @@ -12729,7 +12729,7 @@ int mg_set_protocol_coap(struct mg_connection *nc) { #endif /* MG_ENABLE_COAP */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_sntp.c" +#line 1 "src/mg_sntp.c" #endif /* Amalgamated: #include "mg_internal.h" */ @@ -13016,7 +13016,7 @@ struct mg_connection *mg_sntp_get_time(struct mg_mgr *mgr, #endif /* MG_ENABLE_SNTP */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_socks.c" +#line 1 "src/mg_socks.c" #endif #if MG_ENABLE_SOCKS @@ -13174,7 +13174,7 @@ void mg_set_protocol_socks(struct mg_connection *c) { } #endif #ifdef MG_MODULE_LINES -#line 1 "common/platforms/cc3200/cc3200_libc.c" +#line 1 "src/common/platforms/cc3200/cc3200_libc.c" #endif #if CS_PLATFORM == CS_P_CC3200 @@ -13276,7 +13276,7 @@ int _isatty(int fd) { #endif /* CS_PLATFORM == CS_P_CC3200 */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/msp432/msp432_libc.c" +#line 1 "src/common/platforms/msp432/msp432_libc.c" #endif #if CS_PLATFORM == CS_P_MSP432 @@ -13293,7 +13293,7 @@ int gettimeofday(struct timeval *tp, void *tzp) { #endif /* CS_PLATFORM == CS_P_MSP432 */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/nrf5/nrf5_libc.c" +#line 1 "src/common/platforms/nrf5/nrf5_libc.c" #endif #if (CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52) && \ @@ -13306,7 +13306,7 @@ int gettimeofday(struct timeval *tp, void *tzp) { } #endif #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_fs_slfs.h" +#line 1 "src/common/platforms/simplelink/sl_fs_slfs.h" #endif #ifndef CS_COMMON_PLATFORMS_SIMPLELINK_SL_FS_SLFS_H_ @@ -13341,7 +13341,7 @@ void fs_slfs_unset_file_flags(const char *name); #endif /* CS_COMMON_PLATFORMS_SIMPLELINK_SL_FS_SLFS_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_fs_slfs.c" +#line 1 "src/common/platforms/simplelink/sl_fs_slfs.c" #endif /* Standard libc interface to TI SimpleLink FS. */ @@ -13630,7 +13630,7 @@ void fs_slfs_unset_file_flags(const char *name) { #endif /* defined(MG_FS_SLFS) || defined(CC3200_FS_SLFS) */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_fs.c" +#line 1 "src/common/platforms/simplelink/sl_fs.c" #endif #if MG_NET_IF == MG_NET_IF_SIMPLELINK && \ @@ -14040,7 +14040,7 @@ int sl_fs_init(void) { #endif /* MG_NET_IF == MG_NET_IF_SIMPLELINK && (defined(MG_FS_SLFS) || \ defined(MG_FS_SPIFFS)) */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_socket.c" +#line 1 "src/common/platforms/simplelink/sl_socket.c" #endif #if MG_NET_IF == MG_NET_IF_SIMPLELINK @@ -14087,7 +14087,7 @@ int inet_pton(int af, const char *src, void *dst) { #endif /* MG_NET_IF == MG_NET_IF_SIMPLELINK */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_mg_task.c" +#line 1 "src/common/platforms/simplelink/sl_mg_task.c" #endif #if MG_NET_IF == MG_NET_IF_SIMPLELINK && !defined(MG_SIMPLELINK_NO_OSI) @@ -14142,7 +14142,7 @@ void mg_run_in_task(void (*cb)(struct mg_mgr *mgr, void *arg), void *cb_arg) { #endif /* MG_NET_IF == MG_NET_IF_SIMPLELINK && !defined(MG_SIMPLELINK_NO_OSI) \ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_net_if.h" +#line 1 "src/common/platforms/simplelink/sl_net_if.h" #endif #ifndef CS_COMMON_PLATFORMS_SIMPLELINK_SL_NET_IF_H_ @@ -14166,7 +14166,7 @@ extern const struct mg_iface_vtable mg_simplelink_iface_vtable; #endif /* CS_COMMON_PLATFORMS_SIMPLELINK_SL_NET_IF_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_net_if.c" +#line 1 "src/common/platforms/simplelink/sl_net_if.c" #endif /* Amalgamated: #include "common/platforms/simplelink/sl_net_if.h" */ @@ -14585,7 +14585,7 @@ const struct mg_iface_vtable mg_default_iface_vtable = MG_SL_IFACE_VTABLE; #endif /* MG_ENABLE_NET_IF_SIMPLELINK */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/sl_ssl_if.c" +#line 1 "src/common/platforms/simplelink/sl_ssl_if.c" #endif #if MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_SIMPLELINK @@ -14823,7 +14823,7 @@ int sl_set_ssl_opts(int sock, struct mg_connection *nc) { #endif /* MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_SIMPLELINK */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/lwip/mg_lwip_net_if.h" +#line 1 "src/common/platforms/lwip/mg_lwip_net_if.h" #endif #ifndef CS_COMMON_PLATFORMS_LWIP_MG_NET_IF_LWIP_H_ @@ -14875,7 +14875,7 @@ void mg_lwip_mgr_schedule_poll(struct mg_mgr *mgr); #endif /* CS_COMMON_PLATFORMS_LWIP_MG_NET_IF_LWIP_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/lwip/mg_lwip_net_if.c" +#line 1 "src/common/platforms/lwip/mg_lwip_net_if.c" #endif #if MG_ENABLE_NET_IF_LWIP_LOW_LEVEL @@ -15608,7 +15608,7 @@ const struct mg_iface_vtable mg_default_iface_vtable = MG_LWIP_IFACE_VTABLE; #endif /* MG_ENABLE_NET_IF_LWIP_LOW_LEVEL */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/lwip/mg_lwip_ev_mgr.c" +#line 1 "src/common/platforms/lwip/mg_lwip_ev_mgr.c" #endif #if MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL @@ -15768,7 +15768,7 @@ time_t mg_lwip_if_poll(struct mg_iface *iface, int timeout_ms) { #endif /* MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/wince/wince_libc.c" +#line 1 "src/common/platforms/wince/wince_libc.c" #endif #ifdef WINCE @@ -15841,7 +15841,7 @@ static void mg_gmt_time_string(char *buf, size_t buf_len, time_t *t) { #endif #ifdef MG_MODULE_LINES -#line 1 "common/platforms/pic32/pic32_net_if.h" +#line 1 "src/common/platforms/pic32/pic32_net_if.h" #endif #ifndef CS_COMMON_PLATFORMS_PIC32_NET_IF_H_ @@ -15865,7 +15865,7 @@ extern const struct mg_iface_vtable mg_pic32_iface_vtable; #endif /* CS_COMMON_PLATFORMS_PIC32_NET_IF_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/pic32/pic32_net_if.c" +#line 1 "src/common/platforms/pic32/pic32_net_if.c" #endif #if MG_ENABLE_NET_IF_PIC32 @@ -16156,7 +16156,7 @@ const struct mg_iface_vtable mg_default_iface_vtable = MG_PIC32_IFACE_VTABLE; #endif /* MG_ENABLE_NET_IF_PIC32 */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/windows/windows_direct.c" +#line 1 "src/common/platforms/windows/windows_direct.c" #endif #ifdef _WIN32 diff --git a/mongoose.h b/mongoose.h index 3ebba00ab8f659a8ffdb2339aebbd404d24dfb0f..7808e914a77cd6f44c8f5aa5eab6c9435b6a7b8e 100644 --- a/mongoose.h +++ b/mongoose.h @@ -18,7 +18,7 @@ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_common.h" +#line 1 "src/mg_common.h" #endif #ifndef CS_MONGOOSE_SRC_COMMON_H_ #define CS_MONGOOSE_SRC_COMMON_H_ @@ -32,7 +32,7 @@ #endif /* CS_MONGOOSE_SRC_COMMON_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platform.h" +#line 1 "src/common/platform.h" #endif #ifndef CS_COMMON_PLATFORM_H_ #define CS_COMMON_PLATFORM_H_ @@ -174,7 +174,7 @@ #endif /* CS_COMMON_PLATFORM_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_windows.h" +#line 1 "src/common/platforms/platform_windows.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_ #define CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_ @@ -360,7 +360,7 @@ unsigned int sleep(unsigned int seconds); #endif /* CS_PLATFORM == CS_P_WINDOWS */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_unix.h" +#line 1 "src/common/platforms/platform_unix.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_ #define CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_ @@ -508,7 +508,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_UNIX */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_esp32.h" +#line 1 "src/common/platforms/platform_esp32.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_ESP32_H_ @@ -549,7 +549,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_ESP32 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_ESP32_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_esp8266.h" +#line 1 "src/common/platforms/platform_esp8266.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_ESP8266_H_ @@ -606,7 +606,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_ESP8266 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_ESP8266_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_cc3100.h" +#line 1 "src/common/platforms/platform_cc3100.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_CC3100_H_ @@ -651,7 +651,7 @@ int inet_pton(int af, const char *src, void *dst); #endif /* CS_PLATFORM == CS_P_CC3100 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_CC3100_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_cc3200.h" +#line 1 "src/common/platforms/platform_cc3200.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_ @@ -772,7 +772,7 @@ int stat(const char *pathname, struct stat *st); #endif /* CS_PLATFORM == CS_P_CC3200 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_cc3220.h" +#line 1 "src/common/platforms/platform_cc3220.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_CC3220_H_ @@ -880,7 +880,7 @@ int stat(const char *pathname, struct stat *st); #endif /* CS_PLATFORM == CS_P_CC3220 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_msp432.h" +#line 1 "src/common/platforms/platform_msp432.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_ @@ -984,7 +984,7 @@ int _stat(const char *pathname, struct stat *st); #endif /* CS_PLATFORM == CS_P_MSP432 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_tm4c129.h" +#line 1 "src/common/platforms/platform_tm4c129.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_TM4C129_H_ @@ -1040,7 +1040,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_TM4C129 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_TM4C129_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_mbed.h" +#line 1 "src/common/platforms/platform_mbed.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_MBED_H_ @@ -1120,7 +1120,7 @@ in_addr_t inet_addr(const char *cp); #endif /* CS_PLATFORM == CS_P_MBED */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_MBED_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_nrf51.h" +#line 1 "src/common/platforms/platform_nrf51.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_ @@ -1161,7 +1161,7 @@ int gettimeofday(struct timeval *tp, void *tzp); #endif /* CS_PLATFORM == CS_P_NRF51 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_nrf52.h" +#line 1 "src/common/platforms/platform_nrf52.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_ @@ -1205,7 +1205,7 @@ int gettimeofday(struct timeval *tp, void *tzp); #endif /* CS_PLATFORM == CS_P_NRF52 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/simplelink/cs_simplelink.h" +#line 1 "src/common/platforms/simplelink/cs_simplelink.h" #endif #ifndef CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_ @@ -1368,7 +1368,7 @@ int slfs_open(const unsigned char *fname, uint32_t flags, uint32_t *token); #endif /* CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_wince.h" +#line 1 "src/common/platforms/platform_wince.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_ #define CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_ @@ -1572,7 +1572,7 @@ const char *strerror(); #endif /* CS_PLATFORM == CS_P_WINCE */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_nxp_lpc.h" +#line 1 "src/common/platforms/platform_nxp_lpc.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_NXP_LPC_H_ @@ -1624,7 +1624,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_NXP_LPC */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_NXP_LPC_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_nxp_kinetis.h" +#line 1 "src/common/platforms/platform_nxp_kinetis.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_ @@ -1654,7 +1654,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_NXP_KINETIS */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_pic32.h" +#line 1 "src/common/platforms/platform_pic32.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_ @@ -1690,7 +1690,7 @@ char *inet_ntoa(struct in_addr in); #endif /* CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_rs14100.h" +#line 1 "src/common/platforms/platform_rs14100.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_RS14100_H_ @@ -1738,7 +1738,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_RS14100 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_RS14100_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/platform_stm32.h" +#line 1 "src/common/platforms/platform_stm32.h" #endif #ifndef CS_COMMON_PLATFORMS_PLATFORM_STM32_H_ @@ -1776,7 +1776,7 @@ typedef struct stat cs_stat_t; #endif /* CS_PLATFORM == CS_P_STM32 */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_STM32_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/platforms/lwip/mg_lwip.h" +#line 1 "src/common/platforms/lwip/mg_lwip.h" #endif #ifndef CS_COMMON_PLATFORMS_LWIP_MG_LWIP_H_ @@ -1843,7 +1843,7 @@ void mg_lwip_set_keepalive_params(struct mg_connection *nc, int idle, #endif /* CS_COMMON_PLATFORMS_LWIP_MG_LWIP_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_md5.h" +#line 1 "src/common/cs_md5.h" #endif #ifndef CS_COMMON_MD5_H_ @@ -1875,7 +1875,7 @@ void cs_md5_final(unsigned char *md, cs_md5_ctx *c); #endif /* CS_COMMON_MD5_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_sha1.h" +#line 1 "src/common/cs_sha1.h" #endif #ifndef CS_COMMON_SHA1_H_ @@ -1913,7 +1913,7 @@ void cs_hmac_sha1(const unsigned char *key, size_t key_len, #endif /* CS_COMMON_SHA1_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_time.h" +#line 1 "src/common/cs_time.h" #endif #ifndef CS_COMMON_CS_TIME_H_ @@ -1942,7 +1942,7 @@ double cs_timegm(const struct tm *tm); #endif /* CS_COMMON_CS_TIME_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/mg_str.h" +#line 1 "src/common/mg_str.h" #endif #ifndef CS_COMMON_MG_STR_H_ @@ -2042,7 +2042,7 @@ int mg_str_starts_with(struct mg_str s, struct mg_str prefix); #endif /* CS_COMMON_MG_STR_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/mbuf.h" +#line 1 "src/common/mbuf.h" #endif /* @@ -2140,7 +2140,7 @@ void mbuf_trim(struct mbuf *); #endif /* CS_COMMON_MBUF_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/cs_base64.h" +#line 1 "src/common/cs_base64.h" #endif #ifndef CS_COMMON_CS_BASE64_H_ @@ -2193,7 +2193,7 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst, int *dec_len); #endif /* CS_COMMON_CS_BASE64_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/str_util.h" +#line 1 "src/common/str_util.h" #endif #ifndef CS_COMMON_STR_UTIL_H_ @@ -2378,7 +2378,7 @@ size_t mg_match_prefix_n(const struct mg_str pattern, const struct mg_str str); #endif /* CS_COMMON_STR_UTIL_H_ */ #ifdef MG_MODULE_LINES -#line 1 "common/queue.h" +#line 1 "src/common/queue.h" #endif /* clang-format off */ /*- @@ -3133,7 +3133,7 @@ struct { \ #endif /* !_SYS_QUEUE_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_features.h" +#line 1 "src/mg_features.h" #endif #ifndef CS_MONGOOSE_SRC_FEATURES_H_ @@ -3308,7 +3308,7 @@ struct { \ #endif /* CS_MONGOOSE_SRC_FEATURES_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net_if.h" +#line 1 "src/mg_net_if.h" #endif #ifndef CS_MONGOOSE_SRC_NET_IF_H_ @@ -3438,7 +3438,7 @@ double mg_mgr_min_timer(const struct mg_mgr *mgr); #endif /* CS_MONGOOSE_SRC_NET_IF_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_ssl_if.h" +#line 1 "src/mg_ssl_if.h" #endif #ifndef CS_MONGOOSE_SRC_SSL_IF_H_ @@ -3492,7 +3492,7 @@ int mg_ssl_if_write(struct mg_connection *nc, const void *data, size_t len); #endif /* CS_MONGOOSE_SRC_SSL_IF_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_net.h" +#line 1 "src/mg_net.h" #endif /* @@ -4078,7 +4078,7 @@ double mg_time(void); #endif /* CS_MONGOOSE_SRC_NET_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_uri.h" +#line 1 "src/mg_uri.h" #endif /* @@ -4144,7 +4144,7 @@ int mg_normalize_uri_path(const struct mg_str *in, struct mg_str *out); #endif /* __cplusplus */ #endif /* CS_MONGOOSE_SRC_URI_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_util.h" +#line 1 "src/mg_util.h" #endif /* @@ -4358,7 +4358,7 @@ struct mg_str mg_url_encode(const struct mg_str src); #endif /* __cplusplus */ #endif /* CS_MONGOOSE_SRC_UTIL_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http.h" +#line 1 "src/mg_http.h" #endif /* @@ -4742,7 +4742,7 @@ void mg_http_send_digest_auth_request(struct mg_connection *c, #endif /* CS_MONGOOSE_SRC_HTTP_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http_server.h" +#line 1 "src/mg_http_server.h" #endif /* * === Server API reference @@ -5306,7 +5306,7 @@ void mg_http_reverse_proxy(struct mg_connection *nc, #endif /* CS_MONGOOSE_SRC_HTTP_SERVER_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_http_client.h" +#line 1 "src/mg_http_client.h" #endif /* * === Client API reference @@ -5371,7 +5371,7 @@ int mg_http_create_digest_auth_header(char *buf, size_t buf_len, #endif /* __cplusplus */ #endif /* CS_MONGOOSE_SRC_HTTP_CLIENT_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_mqtt.h" +#line 1 "src/mg_mqtt.h" #endif /* @@ -5586,7 +5586,7 @@ int mg_mqtt_vmatch_topic_expression(const char *exp, struct mg_str topic); #endif /* CS_MONGOOSE_SRC_MQTT_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_mqtt_server.h" +#line 1 "src/mg_mqtt_server.h" #endif /* @@ -5677,7 +5677,7 @@ struct mg_mqtt_session *mg_mqtt_next(struct mg_mqtt_broker *brk, #endif /* MG_ENABLE_MQTT_BROKER */ #endif /* CS_MONGOOSE_SRC_MQTT_BROKER_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_dns.h" +#line 1 "src/mg_dns.h" #endif /* @@ -5841,7 +5841,7 @@ void mg_set_protocol_dns(struct mg_connection *nc); #endif /* __cplusplus */ #endif /* CS_MONGOOSE_SRC_DNS_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_dns_server.h" +#line 1 "src/mg_dns_server.h" #endif /* @@ -5934,7 +5934,7 @@ void mg_dns_send_reply(struct mg_connection *nc, struct mg_dns_reply *r); #endif /* MG_ENABLE_DNS_SERVER */ #endif /* CS_MONGOOSE_SRC_DNS_SERVER_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_resolv.h" +#line 1 "src/mg_resolv.h" #endif /* @@ -6014,7 +6014,7 @@ int mg_resolve_from_hosts_file(const char *host, union socket_address *usa); #endif /* __cplusplus */ #endif /* CS_MONGOOSE_SRC_RESOLV_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_coap.h" +#line 1 "src/mg_coap.h" #endif /* @@ -6166,7 +6166,7 @@ uint32_t mg_coap_compose(struct mg_coap_message *cm, struct mbuf *io); #endif /* CS_MONGOOSE_SRC_COAP_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_sntp.h" +#line 1 "src/mg_sntp.h" #endif #ifndef CS_MONGOOSE_SRC_SNTP_H_ @@ -6219,7 +6219,7 @@ struct mg_connection *mg_sntp_get_time(struct mg_mgr *mgr, #endif /* CS_MONGOOSE_SRC_SNTP_H_ */ #ifdef MG_MODULE_LINES -#line 1 "mongoose/src/mg_socks.h" +#line 1 "src/mg_socks.h" #endif #ifndef CS_MONGOOSE_SRC_SOCKS_H_ diff --git a/src/CPPLINT.cfg b/src/CPPLINT.cfg deleted file mode 100644 index 6809e557e112968573f5522fdaaff48a168387dc..0000000000000000000000000000000000000000 --- a/src/CPPLINT.cfg +++ /dev/null @@ -1 +0,0 @@ -exclude_files=sha1\.c diff --git a/src/common/cs_base64.c b/src/common/cs_base64.c new file mode 100644 index 0000000000000000000000000000000000000000..0a8fc1efe3e6fe4f5cdedbdefd6fccdc7deea19d --- /dev/null +++ b/src/common/cs_base64.c @@ -0,0 +1,201 @@ + +#ifndef EXCLUDE_COMMON + +#include "common/cs_base64.h" + +#include <string.h> + +#include "common/cs_dbg.h" + +/* ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ */ + +#define NUM_UPPERCASES ('Z' - 'A' + 1) +#define NUM_LETTERS (NUM_UPPERCASES * 2) +#define NUM_DIGITS ('9' - '0' + 1) + +/* + * Emit a base64 code char. + * + * Doesn't use memory, thus it's safe to use to safely dump memory in crashdumps + */ +static void cs_base64_emit_code(struct cs_base64_ctx *ctx, int v) { + if (v < NUM_UPPERCASES) { + ctx->b64_putc(v + 'A', ctx->user_data); + } else if (v < (NUM_LETTERS)) { + ctx->b64_putc(v - NUM_UPPERCASES + 'a', ctx->user_data); + } else if (v < (NUM_LETTERS + NUM_DIGITS)) { + ctx->b64_putc(v - NUM_LETTERS + '0', ctx->user_data); + } else { + ctx->b64_putc(v - NUM_LETTERS - NUM_DIGITS == 0 ? '+' : '/', + ctx->user_data); + } +} + +static void cs_base64_emit_chunk(struct cs_base64_ctx *ctx) { + int a, b, c; + + a = ctx->chunk[0]; + b = ctx->chunk[1]; + c = ctx->chunk[2]; + + cs_base64_emit_code(ctx, a >> 2); + cs_base64_emit_code(ctx, ((a & 3) << 4) | (b >> 4)); + if (ctx->chunk_size > 1) { + cs_base64_emit_code(ctx, (b & 15) << 2 | (c >> 6)); + } + if (ctx->chunk_size > 2) { + cs_base64_emit_code(ctx, c & 63); + } +} + +void cs_base64_init(struct cs_base64_ctx *ctx, cs_base64_putc_t b64_putc, + void *user_data) { + ctx->chunk_size = 0; + ctx->b64_putc = b64_putc; + ctx->user_data = user_data; +} + +void cs_base64_update(struct cs_base64_ctx *ctx, const char *str, size_t len) { + const unsigned char *src = (const unsigned char *) str; + size_t i; + for (i = 0; i < len; i++) { + ctx->chunk[ctx->chunk_size++] = src[i]; + if (ctx->chunk_size == 3) { + cs_base64_emit_chunk(ctx); + ctx->chunk_size = 0; + } + } +} + +void cs_base64_finish(struct cs_base64_ctx *ctx) { + if (ctx->chunk_size > 0) { + int i; + memset(&ctx->chunk[ctx->chunk_size], 0, 3 - ctx->chunk_size); + cs_base64_emit_chunk(ctx); + for (i = 0; i < (3 - ctx->chunk_size); i++) { + ctx->b64_putc('=', ctx->user_data); + } + } +} + +#define BASE64_ENCODE_BODY \ + static const char *b64 = \ + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; \ + int i, j, a, b, c; \ + \ + for (i = j = 0; i < src_len; i += 3) { \ + a = src[i]; \ + b = i + 1 >= src_len ? 0 : src[i + 1]; \ + c = i + 2 >= src_len ? 0 : src[i + 2]; \ + \ + BASE64_OUT(b64[a >> 2]); \ + BASE64_OUT(b64[((a & 3) << 4) | (b >> 4)]); \ + if (i + 1 < src_len) { \ + BASE64_OUT(b64[(b & 15) << 2 | (c >> 6)]); \ + } \ + if (i + 2 < src_len) { \ + BASE64_OUT(b64[c & 63]); \ + } \ + } \ + \ + while (j % 4 != 0) { \ + BASE64_OUT('='); \ + } \ + BASE64_FLUSH() + +#define BASE64_OUT(ch) \ + do { \ + dst[j++] = (ch); \ + } while (0) + +#define BASE64_FLUSH() \ + do { \ + dst[j++] = '\0'; \ + } while (0) + +void cs_base64_encode(const unsigned char *src, int src_len, char *dst) { + BASE64_ENCODE_BODY; +} + +#undef BASE64_OUT +#undef BASE64_FLUSH + +#if CS_ENABLE_STDIO +#define BASE64_OUT(ch) \ + do { \ + fprintf(f, "%c", (ch)); \ + j++; \ + } while (0) + +#define BASE64_FLUSH() + +void cs_fprint_base64(FILE *f, const unsigned char *src, int src_len) { + BASE64_ENCODE_BODY; +} + +#undef BASE64_OUT +#undef BASE64_FLUSH +#endif /* CS_ENABLE_STDIO */ + +/* Convert one byte of encoded base64 input stream to 6-bit chunk */ +static unsigned char from_b64(unsigned char ch) { + /* Inverse lookup map */ + static const unsigned char tab[128] = { + 255, 255, 255, 255, + 255, 255, 255, 255, /* 0 */ + 255, 255, 255, 255, + 255, 255, 255, 255, /* 8 */ + 255, 255, 255, 255, + 255, 255, 255, 255, /* 16 */ + 255, 255, 255, 255, + 255, 255, 255, 255, /* 24 */ + 255, 255, 255, 255, + 255, 255, 255, 255, /* 32 */ + 255, 255, 255, 62, + 255, 255, 255, 63, /* 40 */ + 52, 53, 54, 55, + 56, 57, 58, 59, /* 48 */ + 60, 61, 255, 255, + 255, 200, 255, 255, /* 56 '=' is 200, on index 61 */ + 255, 0, 1, 2, + 3, 4, 5, 6, /* 64 */ + 7, 8, 9, 10, + 11, 12, 13, 14, /* 72 */ + 15, 16, 17, 18, + 19, 20, 21, 22, /* 80 */ + 23, 24, 25, 255, + 255, 255, 255, 255, /* 88 */ + 255, 26, 27, 28, + 29, 30, 31, 32, /* 96 */ + 33, 34, 35, 36, + 37, 38, 39, 40, /* 104 */ + 41, 42, 43, 44, + 45, 46, 47, 48, /* 112 */ + 49, 50, 51, 255, + 255, 255, 255, 255, /* 120 */ + }; + return tab[ch & 127]; +} + +int cs_base64_decode(const unsigned char *s, int len, char *dst, int *dec_len) { + unsigned char a, b, c, d; + int orig_len = len; + char *orig_dst = dst; + while (len >= 4 && (a = from_b64(s[0])) != 255 && + (b = from_b64(s[1])) != 255 && (c = from_b64(s[2])) != 255 && + (d = from_b64(s[3])) != 255) { + s += 4; + len -= 4; + if (a == 200 || b == 200) break; /* '=' can't be there */ + *dst++ = a << 2 | b >> 4; + if (c == 200) break; + *dst++ = b << 4 | c >> 2; + if (d == 200) break; + *dst++ = c << 6 | d; + } + *dst = 0; + if (dec_len != NULL) *dec_len = (dst - orig_dst); + return orig_len - len; +} + +#endif /* EXCLUDE_COMMON */ diff --git a/src/common/cs_base64.h b/src/common/cs_base64.h new file mode 100644 index 0000000000000000000000000000000000000000..4dd328c31ff533ef1b24620448e67894ac7997fb --- /dev/null +++ b/src/common/cs_base64.h @@ -0,0 +1,50 @@ + +#ifndef CS_COMMON_CS_BASE64_H_ +#define CS_COMMON_CS_BASE64_H_ + +#ifndef DISABLE_BASE64 +#define DISABLE_BASE64 0 +#endif + +#if !DISABLE_BASE64 + +#include <stdio.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*cs_base64_putc_t)(char, void *); + +struct cs_base64_ctx { + /* cannot call it putc because it's a macro on some environments */ + cs_base64_putc_t b64_putc; + unsigned char chunk[3]; + int chunk_size; + void *user_data; +}; + +void cs_base64_init(struct cs_base64_ctx *ctx, cs_base64_putc_t putc, + void *user_data); +void cs_base64_update(struct cs_base64_ctx *ctx, const char *str, size_t len); +void cs_base64_finish(struct cs_base64_ctx *ctx); + +void cs_base64_encode(const unsigned char *src, int src_len, char *dst); +void cs_fprint_base64(FILE *f, const unsigned char *src, int src_len); + +/* + * Decodes a base64 string `s` length `len` into `dst`. + * `dst` must have enough space to hold the result. + * `*dec_len` will contain the resulting length of the string in `dst` + * while return value will return number of processed bytes in `src`. + * Return value == len indicates successful processing of all the data. + */ +int cs_base64_decode(const unsigned char *s, int len, char *dst, int *dec_len); + +#ifdef __cplusplus +} +#endif + +#endif /* DISABLE_BASE64 */ + +#endif /* CS_COMMON_CS_BASE64_H_ */ diff --git a/src/common/cs_dbg.c b/src/common/cs_dbg.c index 35c457e3d061637610fde16ac497be3e1dbaf99f..c221e1f569ccff5e46b9b0f47500d4423092c3a7 100644 --- a/src/common/cs_dbg.c +++ b/src/common/cs_dbg.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #include "common/cs_dbg.h" diff --git a/src/common/cs_dbg.h b/src/common/cs_dbg.h index 8422ca3be686061d92787f04fa607a3ff9cfe1e8..493f639560853bd67a4ed45ee2d68130663ffa65 100644 --- a/src/common/cs_dbg.h +++ b/src/common/cs_dbg.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_CS_DBG_H_ #define CS_COMMON_CS_DBG_H_ diff --git a/src/common/cs_dirent.c b/src/common/cs_dirent.c new file mode 100644 index 0000000000000000000000000000000000000000..66169ae9aa03aba5959090c444d6998ca5651bb5 --- /dev/null +++ b/src/common/cs_dirent.c @@ -0,0 +1,92 @@ + +#ifndef EXCLUDE_COMMON + +#include "common/mg_mem.h" +#include "common/cs_dirent.h" + +/* + * This file contains POSIX opendir/closedir/readdir API implementation + * for systems which do not natively support it (e.g. Windows). + */ + +#ifdef _WIN32 +struct win32_dir { + DIR d; + HANDLE handle; + WIN32_FIND_DATAW info; + struct dirent result; +}; + +DIR *opendir(const char *name) { + struct win32_dir *dir = NULL; + wchar_t wpath[MAX_PATH]; + DWORD attrs; + + if (name == NULL) { + SetLastError(ERROR_BAD_ARGUMENTS); + } else if ((dir = (struct win32_dir *) MG_MALLOC(sizeof(*dir))) == NULL) { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + } else { + to_wchar(name, wpath, ARRAY_SIZE(wpath)); + attrs = GetFileAttributesW(wpath); + if (attrs != 0xFFFFFFFF && (attrs & FILE_ATTRIBUTE_DIRECTORY)) { + (void) wcscat(wpath, L"\\*"); + dir->handle = FindFirstFileW(wpath, &dir->info); + dir->result.d_name[0] = '\0'; + } else { + MG_FREE(dir); + dir = NULL; + } + } + + return (DIR *) dir; +} + +int closedir(DIR *d) { + struct win32_dir *dir = (struct win32_dir *) d; + int result = 0; + + if (dir != NULL) { + if (dir->handle != INVALID_HANDLE_VALUE) + result = FindClose(dir->handle) ? 0 : -1; + MG_FREE(dir); + } else { + result = -1; + SetLastError(ERROR_BAD_ARGUMENTS); + } + + return result; +} + +struct dirent *readdir(DIR *d) { + struct win32_dir *dir = (struct win32_dir *) d; + struct dirent *result = NULL; + + if (dir) { + memset(&dir->result, 0, sizeof(dir->result)); + if (dir->handle != INVALID_HANDLE_VALUE) { + result = &dir->result; + (void) WideCharToMultiByte(CP_UTF8, 0, dir->info.cFileName, -1, + result->d_name, sizeof(result->d_name), NULL, + NULL); + + if (!FindNextFileW(dir->handle, &dir->info)) { + (void) FindClose(dir->handle); + dir->handle = INVALID_HANDLE_VALUE; + } + + } else { + SetLastError(ERROR_FILE_NOT_FOUND); + } + } else { + SetLastError(ERROR_BAD_ARGUMENTS); + } + + return result; +} +#endif + +#endif /* EXCLUDE_COMMON */ + +/* ISO C requires a translation unit to contain at least one declaration */ +typedef int cs_dirent_dummy; diff --git a/src/common/cs_dirent.h b/src/common/cs_dirent.h new file mode 100644 index 0000000000000000000000000000000000000000..d4ac9a72225cb250648b9871ab2be1a0b521a1ae --- /dev/null +++ b/src/common/cs_dirent.h @@ -0,0 +1,35 @@ + +#ifndef CS_COMMON_CS_DIRENT_H_ +#define CS_COMMON_CS_DIRENT_H_ + +#include <limits.h> + +#include "common/platform.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifdef CS_DEFINE_DIRENT +typedef struct { int dummy; } DIR; + +struct dirent { + int d_ino; +#ifdef _WIN32 + char d_name[MAX_PATH]; +#else + /* TODO(rojer): Use PATH_MAX but make sure it's sane on every platform */ + char d_name[256]; +#endif +}; + +DIR *opendir(const char *dir_name); +int closedir(DIR *dir); +struct dirent *readdir(DIR *dir); +#endif /* CS_DEFINE_DIRENT */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* CS_COMMON_CS_DIRENT_H_ */ diff --git a/src/common/cs_endian.h b/src/common/cs_endian.h new file mode 100644 index 0000000000000000000000000000000000000000..f3aab4efbe437a1b4a681fa65dc2b48955592048 --- /dev/null +++ b/src/common/cs_endian.h @@ -0,0 +1,28 @@ + +#ifndef CS_COMMON_CS_ENDIAN_H_ +#define CS_COMMON_CS_ENDIAN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * clang with std=-c99 uses __LITTLE_ENDIAN, by default + * while for ex, RTOS gcc - LITTLE_ENDIAN, by default + * it depends on __USE_BSD, but let's have everything + */ +#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER) +#define BYTE_ORDER __BYTE_ORDER +#ifndef LITTLE_ENDIAN +#define LITTLE_ENDIAN __LITTLE_ENDIAN +#endif /* LITTLE_ENDIAN */ +#ifndef BIG_ENDIAN +#define BIG_ENDIAN __LITTLE_ENDIAN +#endif /* BIG_ENDIAN */ +#endif /* BYTE_ORDER */ + +#ifdef __cplusplus +} +#endif + +#endif /* CS_COMMON_CS_ENDIAN_H_ */ diff --git a/src/common/cs_md5.h b/src/common/cs_md5.h index 302b03270e7d473584f0ef4dd1987922b2b5b75c..075a4b328c3bd20d5ce999fc3e6ae652c1ded92d 100644 --- a/src/common/cs_md5.h +++ b/src/common/cs_md5.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_MD5_H_ #define CS_COMMON_MD5_H_ diff --git a/src/common/cs_sha1.c b/src/common/cs_sha1.c new file mode 100644 index 0000000000000000000000000000000000000000..7eab302253852ecf6f2a5d9c38bd4e1bdc699f63 --- /dev/null +++ b/src/common/cs_sha1.c @@ -0,0 +1,253 @@ +/* Copyright(c) By Steve Reid <steve@edmweb.com> */ +/* 100% Public Domain */ + +#include "common/cs_sha1.h" + +#if !CS_DISABLE_SHA1 && !defined(EXCLUDE_COMMON) + +#include "common/cs_endian.h" + +#define SHA1HANDSOFF +#if defined(__sun) +#include "common/solarisfixes.h" +#endif + +union char64long16 { + unsigned char c[64]; + uint32_t l[16]; +}; + +#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) + +static uint32_t blk0(union char64long16 *block, int i) { +/* Forrest: SHA expect BIG_ENDIAN, swap if LITTLE_ENDIAN */ +#if BYTE_ORDER == LITTLE_ENDIAN + block->l[i] = + (rol(block->l[i], 24) & 0xFF00FF00) | (rol(block->l[i], 8) & 0x00FF00FF); +#endif + return block->l[i]; +} + +/* Avoid redefine warning (ARM /usr/include/sys/ucontext.h define R0~R4) */ +#undef blk +#undef R0 +#undef R1 +#undef R2 +#undef R3 +#undef R4 + +#define blk(i) \ + (block->l[i & 15] = rol(block->l[(i + 13) & 15] ^ block->l[(i + 8) & 15] ^ \ + block->l[(i + 2) & 15] ^ block->l[i & 15], \ + 1)) +#define R0(v, w, x, y, z, i) \ + z += ((w & (x ^ y)) ^ y) + blk0(block, i) + 0x5A827999 + rol(v, 5); \ + w = rol(w, 30); +#define R1(v, w, x, y, z, i) \ + z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \ + w = rol(w, 30); +#define R2(v, w, x, y, z, i) \ + z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); \ + w = rol(w, 30); +#define R3(v, w, x, y, z, i) \ + z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \ + w = rol(w, 30); +#define R4(v, w, x, y, z, i) \ + z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \ + w = rol(w, 30); + +void cs_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) { + uint32_t a, b, c, d, e; + union char64long16 block[1]; + + memcpy(block, buffer, 64); + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + R0(a, b, c, d, e, 0); + R0(e, a, b, c, d, 1); + R0(d, e, a, b, c, 2); + R0(c, d, e, a, b, 3); + R0(b, c, d, e, a, 4); + R0(a, b, c, d, e, 5); + R0(e, a, b, c, d, 6); + R0(d, e, a, b, c, 7); + R0(c, d, e, a, b, 8); + R0(b, c, d, e, a, 9); + R0(a, b, c, d, e, 10); + R0(e, a, b, c, d, 11); + R0(d, e, a, b, c, 12); + R0(c, d, e, a, b, 13); + R0(b, c, d, e, a, 14); + R0(a, b, c, d, e, 15); + R1(e, a, b, c, d, 16); + R1(d, e, a, b, c, 17); + R1(c, d, e, a, b, 18); + R1(b, c, d, e, a, 19); + R2(a, b, c, d, e, 20); + R2(e, a, b, c, d, 21); + R2(d, e, a, b, c, 22); + R2(c, d, e, a, b, 23); + R2(b, c, d, e, a, 24); + R2(a, b, c, d, e, 25); + R2(e, a, b, c, d, 26); + R2(d, e, a, b, c, 27); + R2(c, d, e, a, b, 28); + R2(b, c, d, e, a, 29); + R2(a, b, c, d, e, 30); + R2(e, a, b, c, d, 31); + R2(d, e, a, b, c, 32); + R2(c, d, e, a, b, 33); + R2(b, c, d, e, a, 34); + R2(a, b, c, d, e, 35); + R2(e, a, b, c, d, 36); + R2(d, e, a, b, c, 37); + R2(c, d, e, a, b, 38); + R2(b, c, d, e, a, 39); + R3(a, b, c, d, e, 40); + R3(e, a, b, c, d, 41); + R3(d, e, a, b, c, 42); + R3(c, d, e, a, b, 43); + R3(b, c, d, e, a, 44); + R3(a, b, c, d, e, 45); + R3(e, a, b, c, d, 46); + R3(d, e, a, b, c, 47); + R3(c, d, e, a, b, 48); + R3(b, c, d, e, a, 49); + R3(a, b, c, d, e, 50); + R3(e, a, b, c, d, 51); + R3(d, e, a, b, c, 52); + R3(c, d, e, a, b, 53); + R3(b, c, d, e, a, 54); + R3(a, b, c, d, e, 55); + R3(e, a, b, c, d, 56); + R3(d, e, a, b, c, 57); + R3(c, d, e, a, b, 58); + R3(b, c, d, e, a, 59); + R4(a, b, c, d, e, 60); + R4(e, a, b, c, d, 61); + R4(d, e, a, b, c, 62); + R4(c, d, e, a, b, 63); + R4(b, c, d, e, a, 64); + R4(a, b, c, d, e, 65); + R4(e, a, b, c, d, 66); + R4(d, e, a, b, c, 67); + R4(c, d, e, a, b, 68); + R4(b, c, d, e, a, 69); + R4(a, b, c, d, e, 70); + R4(e, a, b, c, d, 71); + R4(d, e, a, b, c, 72); + R4(c, d, e, a, b, 73); + R4(b, c, d, e, a, 74); + R4(a, b, c, d, e, 75); + R4(e, a, b, c, d, 76); + R4(d, e, a, b, c, 77); + R4(c, d, e, a, b, 78); + R4(b, c, d, e, a, 79); + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + /* Erase working structures. The order of operations is important, + * used to ensure that compiler doesn't optimize those out. */ + memset(block, 0, sizeof(block)); + a = b = c = d = e = 0; + (void) a; + (void) b; + (void) c; + (void) d; + (void) e; +} + +void cs_sha1_init(cs_sha1_ctx *context) { + context->state[0] = 0x67452301; + context->state[1] = 0xEFCDAB89; + context->state[2] = 0x98BADCFE; + context->state[3] = 0x10325476; + context->state[4] = 0xC3D2E1F0; + context->count[0] = context->count[1] = 0; +} + +void cs_sha1_update(cs_sha1_ctx *context, const unsigned char *data, + uint32_t len) { + uint32_t i, j; + + j = context->count[0]; + if ((context->count[0] += len << 3) < j) context->count[1]++; + context->count[1] += (len >> 29); + j = (j >> 3) & 63; + if ((j + len) > 63) { + memcpy(&context->buffer[j], data, (i = 64 - j)); + cs_sha1_transform(context->state, context->buffer); + for (; i + 63 < len; i += 64) { + cs_sha1_transform(context->state, &data[i]); + } + j = 0; + } else + i = 0; + memcpy(&context->buffer[j], &data[i], len - i); +} + +void cs_sha1_final(unsigned char digest[20], cs_sha1_ctx *context) { + unsigned i; + unsigned char finalcount[8], c; + + for (i = 0; i < 8; i++) { + finalcount[i] = (unsigned char) ((context->count[(i >= 4 ? 0 : 1)] >> + ((3 - (i & 3)) * 8)) & + 255); + } + c = 0200; + cs_sha1_update(context, &c, 1); + while ((context->count[0] & 504) != 448) { + c = 0000; + cs_sha1_update(context, &c, 1); + } + cs_sha1_update(context, finalcount, 8); + for (i = 0; i < 20; i++) { + digest[i] = + (unsigned char) ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); + } + memset(context, '\0', sizeof(*context)); + memset(&finalcount, '\0', sizeof(finalcount)); +} + +void cs_hmac_sha1(const unsigned char *key, size_t keylen, + const unsigned char *data, size_t datalen, + unsigned char out[20]) { + cs_sha1_ctx ctx; + unsigned char buf1[64], buf2[64], tmp_key[20], i; + + if (keylen > sizeof(buf1)) { + cs_sha1_init(&ctx); + cs_sha1_update(&ctx, key, keylen); + cs_sha1_final(tmp_key, &ctx); + key = tmp_key; + keylen = sizeof(tmp_key); + } + + memset(buf1, 0, sizeof(buf1)); + memset(buf2, 0, sizeof(buf2)); + memcpy(buf1, key, keylen); + memcpy(buf2, key, keylen); + + for (i = 0; i < sizeof(buf1); i++) { + buf1[i] ^= 0x36; + buf2[i] ^= 0x5c; + } + + cs_sha1_init(&ctx); + cs_sha1_update(&ctx, buf1, sizeof(buf1)); + cs_sha1_update(&ctx, data, datalen); + cs_sha1_final(out, &ctx); + + cs_sha1_init(&ctx); + cs_sha1_update(&ctx, buf2, sizeof(buf2)); + cs_sha1_update(&ctx, out, 20); + cs_sha1_final(out, &ctx); +} + +#endif /* EXCLUDE_COMMON */ diff --git a/src/common/cs_sha1.h b/src/common/cs_sha1.h new file mode 100644 index 0000000000000000000000000000000000000000..1250a01f376acfbc56d22b28fcf152ec93781e82 --- /dev/null +++ b/src/common/cs_sha1.h @@ -0,0 +1,35 @@ + +#ifndef CS_COMMON_SHA1_H_ +#define CS_COMMON_SHA1_H_ + +#ifndef CS_DISABLE_SHA1 +#define CS_DISABLE_SHA1 0 +#endif + +#if !CS_DISABLE_SHA1 + +#include "common/platform.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef struct { + uint32_t state[5]; + uint32_t count[2]; + unsigned char buffer[64]; +} cs_sha1_ctx; + +void cs_sha1_init(cs_sha1_ctx *); +void cs_sha1_update(cs_sha1_ctx *, const unsigned char *data, uint32_t len); +void cs_sha1_final(unsigned char digest[20], cs_sha1_ctx *); +void cs_hmac_sha1(const unsigned char *key, size_t key_len, + const unsigned char *text, size_t text_len, + unsigned char out[20]); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* CS_DISABLE_SHA1 */ + +#endif /* CS_COMMON_SHA1_H_ */ diff --git a/src/common/cs_time.c b/src/common/cs_time.c index f14de39e97ff55833f988ecccdcb6adcf7aded7e..8160febf9e8de06c6f60e8a44628df7092be05dd 100644 --- a/src/common/cs_time.c +++ b/src/common/cs_time.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #include "common/cs_time.h" diff --git a/src/common/cs_time.h b/src/common/cs_time.h index eba5395774598b52f60c86c32dbda2baf6596d73..0b4975d99e097797211268b0ac975ac18918081f 100644 --- a/src/common/cs_time.h +++ b/src/common/cs_time.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_CS_TIME_H_ #define CS_COMMON_CS_TIME_H_ diff --git a/src/common/mbuf.c b/src/common/mbuf.c new file mode 100644 index 0000000000000000000000000000000000000000..9ae977e88414ea5d5674154f5b661120ad53e326 --- /dev/null +++ b/src/common/mbuf.c @@ -0,0 +1,135 @@ + +#ifndef EXCLUDE_COMMON + +#include <assert.h> +#include <string.h> +#include "common/mbuf.h" + +#ifndef MBUF_REALLOC +#define MBUF_REALLOC realloc +#endif + +#ifndef MBUF_FREE +#define MBUF_FREE free +#endif + +void mbuf_init(struct mbuf *mbuf, size_t initial_size) WEAK; +void mbuf_init(struct mbuf *mbuf, size_t initial_size) { + mbuf->len = mbuf->size = 0; + mbuf->buf = NULL; + mbuf_resize(mbuf, initial_size); +} + +void mbuf_free(struct mbuf *mbuf) WEAK; +void mbuf_free(struct mbuf *mbuf) { + if (mbuf->buf != NULL) { + MBUF_FREE(mbuf->buf); + mbuf_init(mbuf, 0); + } +} + +void mbuf_resize(struct mbuf *a, size_t new_size) WEAK; +void mbuf_resize(struct mbuf *a, size_t new_size) { + if (new_size > a->size || (new_size < a->size && new_size >= a->len)) { + char *buf = (char *) MBUF_REALLOC(a->buf, new_size); + /* + * In case realloc fails, there's not much we can do, except keep things as + * they are. Note that NULL is a valid return value from realloc when + * size == 0, but that is covered too. + */ + if (buf == NULL && new_size != 0) return; + a->buf = buf; + a->size = new_size; + } +} + +void mbuf_trim(struct mbuf *mbuf) WEAK; +void mbuf_trim(struct mbuf *mbuf) { + mbuf_resize(mbuf, mbuf->len); +} + +size_t mbuf_insert(struct mbuf *a, size_t off, const void *buf, size_t) WEAK; +size_t mbuf_insert(struct mbuf *a, size_t off, const void *buf, size_t len) { + char *p = NULL; + + assert(a != NULL); + assert(a->len <= a->size); + assert(off <= a->len); + + /* check overflow */ + if (~(size_t) 0 - (size_t) a->buf < len) return 0; + + if (a->len + len <= a->size) { + memmove(a->buf + off + len, a->buf + off, a->len - off); + if (buf != NULL) { + memcpy(a->buf + off, buf, len); + } + a->len += len; + } else { + size_t min_size = (a->len + len); + size_t new_size = (size_t)(min_size * MBUF_SIZE_MULTIPLIER); + if (new_size - min_size > MBUF_SIZE_MAX_HEADROOM) { + new_size = min_size + MBUF_SIZE_MAX_HEADROOM; + } + p = (char *) MBUF_REALLOC(a->buf, new_size); + if (p == NULL && new_size != min_size) { + new_size = min_size; + p = (char *) MBUF_REALLOC(a->buf, new_size); + } + if (p != NULL) { + a->buf = p; + if (off != a->len) { + memmove(a->buf + off + len, a->buf + off, a->len - off); + } + if (buf != NULL) memcpy(a->buf + off, buf, len); + a->len += len; + a->size = new_size; + } else { + len = 0; + } + } + + return len; +} + +size_t mbuf_append(struct mbuf *a, const void *buf, size_t len) WEAK; +size_t mbuf_append(struct mbuf *a, const void *buf, size_t len) { + return mbuf_insert(a, a->len, buf, len); +} + +size_t mbuf_append_and_free(struct mbuf *a, void *buf, size_t len) WEAK; +size_t mbuf_append_and_free(struct mbuf *a, void *data, size_t len) { + size_t ret; + /* Optimization: if the buffer is currently empty, + * take over the user-provided buffer. */ + if (a->len == 0) { + if (a->buf != NULL) free(a->buf); + a->buf = (char *) data; + a->len = a->size = len; + return len; + } + ret = mbuf_insert(a, a->len, data, len); + free(data); + return ret; +} + +void mbuf_remove(struct mbuf *mb, size_t n) WEAK; +void mbuf_remove(struct mbuf *mb, size_t n) { + if (n > 0 && n <= mb->len) { + memmove(mb->buf, mb->buf + n, mb->len - n); + mb->len -= n; + } +} + +void mbuf_clear(struct mbuf *mb) WEAK; +void mbuf_clear(struct mbuf *mb) { + mb->len = 0; +} + +void mbuf_move(struct mbuf *from, struct mbuf *to) WEAK; +void mbuf_move(struct mbuf *from, struct mbuf *to) { + memcpy(to, from, sizeof(*to)); + memset(from, 0, sizeof(*from)); +} + +#endif /* EXCLUDE_COMMON */ diff --git a/src/common/mbuf.h b/src/common/mbuf.h new file mode 100644 index 0000000000000000000000000000000000000000..45de8111b519cb06aa90d8d22e4c1fc7b635c8a9 --- /dev/null +++ b/src/common/mbuf.h @@ -0,0 +1,95 @@ + +/* + * Mbufs are mutable/growing memory buffers, like C++ strings. + * Mbuf can append data to the end of a buffer or insert data into arbitrary + * position in the middle of a buffer. The buffer grows automatically when + * needed. + */ + +#ifndef CS_COMMON_MBUF_H_ +#define CS_COMMON_MBUF_H_ + +#include <stdlib.h> +#include "common/platform.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef MBUF_SIZE_MULTIPLIER +#define MBUF_SIZE_MULTIPLIER 1.5 +#endif + +#ifndef MBUF_SIZE_MAX_HEADROOM +#ifdef BUFSIZ +#define MBUF_SIZE_MAX_HEADROOM BUFSIZ +#else +#define MBUF_SIZE_MAX_HEADROOM 1024 +#endif +#endif + +/* Memory buffer descriptor */ +struct mbuf { + char *buf; /* Buffer pointer */ + size_t len; /* Data length. Data is located between offset 0 and len. */ + size_t size; /* Buffer size allocated by realloc(1). Must be >= len */ +}; + +/* + * Initialises an Mbuf. + * `initial_capacity` specifies the initial capacity of the mbuf. + */ +void mbuf_init(struct mbuf *, size_t initial_capacity); + +/* Frees the space allocated for the mbuffer and resets the mbuf structure. */ +void mbuf_free(struct mbuf *); + +/* + * Appends data to the Mbuf. + * + * Returns the number of bytes appended or 0 if out of memory. + */ +size_t mbuf_append(struct mbuf *, const void *data, size_t data_size); + +/* + * Appends data to the Mbuf and frees it (data must be heap-allocated). + * + * Returns the number of bytes appended or 0 if out of memory. + * data is freed irrespective of return value. + */ +size_t mbuf_append_and_free(struct mbuf *, void *data, size_t data_size); + +/* + * Inserts data at a specified offset in the Mbuf. + * + * Existing data will be shifted forwards and the buffer will + * be grown if necessary. + * Returns the number of bytes inserted. + */ +size_t mbuf_insert(struct mbuf *, size_t, const void *, size_t); + +/* Removes `data_size` bytes from the beginning of the buffer. */ +void mbuf_remove(struct mbuf *, size_t data_size); + +/* + * Resizes an Mbuf. + * + * If `new_size` is smaller than buffer's `len`, the + * resize is not performed. + */ +void mbuf_resize(struct mbuf *, size_t new_size); + +/* Moves the state from one mbuf to the other. */ +void mbuf_move(struct mbuf *from, struct mbuf *to); + +/* Removes all the data from mbuf (if any). */ +void mbuf_clear(struct mbuf *); + +/* Shrinks an Mbuf by resizing its `size` to `len`. */ +void mbuf_trim(struct mbuf *); + +#if defined(__cplusplus) +} +#endif /* __cplusplus */ + +#endif /* CS_COMMON_MBUF_H_ */ diff --git a/src/common/mg_mem.h b/src/common/mg_mem.h index 7fe8381d49e34c62967419e29ffea5f809c801ff..dc5e5cf39882b9a41ea1d7475e145c77c2fdc68a 100644 --- a/src/common/mg_mem.h +++ b/src/common/mg_mem.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_MG_MEM_H_ #define CS_COMMON_MG_MEM_H_ diff --git a/src/common/mg_str.c b/src/common/mg_str.c new file mode 100644 index 0000000000000000000000000000000000000000..f69b0fd491ab7f8a1410a903d9831ec99e296c08 --- /dev/null +++ b/src/common/mg_str.c @@ -0,0 +1,162 @@ + +#include "common/mg_mem.h" +#include "common/mg_str.h" +#include "common/platform.h" + +#include <ctype.h> +#include <stdlib.h> +#include <string.h> + +int mg_ncasecmp(const char *s1, const char *s2, size_t len) WEAK; + +struct mg_str mg_mk_str(const char *s) WEAK; +struct mg_str mg_mk_str(const char *s) { + struct mg_str ret = {s, 0}; + if (s != NULL) ret.len = strlen(s); + return ret; +} + +struct mg_str mg_mk_str_n(const char *s, size_t len) WEAK; +struct mg_str mg_mk_str_n(const char *s, size_t len) { + struct mg_str ret = {s, len}; + return ret; +} + +int mg_vcmp(const struct mg_str *str1, const char *str2) WEAK; +int mg_vcmp(const struct mg_str *str1, const char *str2) { + size_t n2 = strlen(str2), n1 = str1->len; + int r = strncmp(str1->p, str2, (n1 < n2) ? n1 : n2); + if (r == 0) { + return n1 - n2; + } + return r; +} + +int mg_vcasecmp(const struct mg_str *str1, const char *str2) WEAK; +int mg_vcasecmp(const struct mg_str *str1, const char *str2) { + size_t n2 = strlen(str2), n1 = str1->len; + int r = mg_ncasecmp(str1->p, str2, (n1 < n2) ? n1 : n2); + if (r == 0) { + return n1 - n2; + } + return r; +} + +static struct mg_str mg_strdup_common(const struct mg_str s, + int nul_terminate) { + struct mg_str r = {NULL, 0}; + if (s.len > 0 && s.p != NULL) { + char *sc = (char *) MG_MALLOC(s.len + (nul_terminate ? 1 : 0)); + if (sc != NULL) { + memcpy(sc, s.p, s.len); + if (nul_terminate) sc[s.len] = '\0'; + r.p = sc; + r.len = s.len; + } + } + return r; +} + +struct mg_str mg_strdup(const struct mg_str s) WEAK; +struct mg_str mg_strdup(const struct mg_str s) { + return mg_strdup_common(s, 0 /* NUL-terminate */); +} + +struct mg_str mg_strdup_nul(const struct mg_str s) WEAK; +struct mg_str mg_strdup_nul(const struct mg_str s) { + return mg_strdup_common(s, 1 /* NUL-terminate */); +} + +const char *mg_strchr(const struct mg_str s, int c) WEAK; +const char *mg_strchr(const struct mg_str s, int c) { + size_t i; + for (i = 0; i < s.len; i++) { + if (s.p[i] == c) return &s.p[i]; + } + return NULL; +} + +int mg_strcmp(const struct mg_str str1, const struct mg_str str2) WEAK; +int mg_strcmp(const struct mg_str str1, const struct mg_str str2) { + size_t i = 0; + while (i < str1.len && i < str2.len) { + int c1 = str1.p[i]; + int c2 = str2.p[i]; + if (c1 < c2) return -1; + if (c1 > c2) return 1; + i++; + } + if (i < str1.len) return 1; + if (i < str2.len) return -1; + return 0; +} + +int mg_strncmp(const struct mg_str, const struct mg_str, size_t n) WEAK; +int mg_strncmp(const struct mg_str str1, const struct mg_str str2, size_t n) { + struct mg_str s1 = str1; + struct mg_str s2 = str2; + + if (s1.len > n) { + s1.len = n; + } + if (s2.len > n) { + s2.len = n; + } + return mg_strcmp(s1, s2); +} + +int mg_strcasecmp(const struct mg_str str1, const struct mg_str str2) WEAK; +int mg_strcasecmp(const struct mg_str str1, const struct mg_str str2) { + size_t i = 0; + while (i < str1.len && i < str2.len) { + int c1 = tolower((int) str1.p[i]); + int c2 = tolower((int) str2.p[i]); + if (c1 < c2) return -1; + if (c1 > c2) return 1; + i++; + } + if (i < str1.len) return 1; + if (i < str2.len) return -1; + return 0; +} + +void mg_strfree(struct mg_str *s) WEAK; +void mg_strfree(struct mg_str *s) { + char *sp = (char *) s->p; + s->p = NULL; + s->len = 0; + if (sp != NULL) free(sp); +} + +const char *mg_strstr(const struct mg_str haystack, + const struct mg_str needle) WEAK; +const char *mg_strstr(const struct mg_str haystack, + const struct mg_str needle) { + size_t i; + if (needle.len > haystack.len) return NULL; + for (i = 0; i <= haystack.len - needle.len; i++) { + if (memcmp(haystack.p + i, needle.p, needle.len) == 0) { + return haystack.p + i; + } + } + return NULL; +} + +struct mg_str mg_strstrip(struct mg_str s) WEAK; +struct mg_str mg_strstrip(struct mg_str s) { + while (s.len > 0 && isspace((int) *s.p)) { + s.p++; + s.len--; + } + while (s.len > 0 && isspace((int) *(s.p + s.len - 1))) { + s.len--; + } + return s; +} + +int mg_str_starts_with(struct mg_str s, struct mg_str prefix) WEAK; +int mg_str_starts_with(struct mg_str s, struct mg_str prefix) { + const struct mg_str sp = MG_MK_STR_N(s.p, prefix.len); + if (s.len < prefix.len) return 0; + return (mg_strcmp(sp, prefix) == 0); +} diff --git a/src/common/mg_str.h b/src/common/mg_str.h new file mode 100644 index 0000000000000000000000000000000000000000..8863e0e52dd6ffd843c5ca995a32fae60dfe6fca --- /dev/null +++ b/src/common/mg_str.h @@ -0,0 +1,97 @@ + +#ifndef CS_COMMON_MG_STR_H_ +#define CS_COMMON_MG_STR_H_ + +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Describes chunk of memory */ +struct mg_str { + const char *p; /* Memory chunk pointer */ + size_t len; /* Memory chunk length */ +}; + +/* + * Helper function for creating mg_str struct from plain C string. + * `NULL` is allowed and becomes `{NULL, 0}`. + */ +struct mg_str mg_mk_str(const char *s); + +/* + * Like `mg_mk_str`, but takes string length explicitly. + */ +struct mg_str mg_mk_str_n(const char *s, size_t len); + +/* Macro for initializing mg_str. */ +#define MG_MK_STR(str_literal) \ + { str_literal, sizeof(str_literal) - 1 } +#define MG_MK_STR_N(str_literal, len) \ + { str_literal, len } +#define MG_NULL_STR \ + { NULL, 0 } + +/* + * Cross-platform version of `strcmp()` where where first string is + * specified by `struct mg_str`. + */ +int mg_vcmp(const struct mg_str *str2, const char *str1); + +/* + * Cross-platform version of `strncasecmp()` where first string is + * specified by `struct mg_str`. + */ +int mg_vcasecmp(const struct mg_str *str2, const char *str1); + +/* Creates a copy of s (heap-allocated). */ +struct mg_str mg_strdup(const struct mg_str s); + +/* + * Creates a copy of s (heap-allocated). + * Resulting string is NUL-terminated (but NUL is not included in len). + */ +struct mg_str mg_strdup_nul(const struct mg_str s); + +/* + * Locates character in a string. + */ +const char *mg_strchr(const struct mg_str s, int c); + +/* + * Compare two `mg_str`s; return value is the same as `strcmp`. + */ +int mg_strcmp(const struct mg_str str1, const struct mg_str str2); + +/* + * Like `mg_strcmp`, but compares at most `n` characters. + */ +int mg_strncmp(const struct mg_str str1, const struct mg_str str2, size_t n); + +/* + * Compare two `mg_str`s ignoreing case; return value is the same as `strcmp`. + */ +int mg_strcasecmp(const struct mg_str str1, const struct mg_str str2); + +/* + * Free the string (assuming it was heap allocated). + */ +void mg_strfree(struct mg_str *s); + +/* + * Finds the first occurrence of a substring `needle` in the `haystack`. + */ +const char *mg_strstr(const struct mg_str haystack, const struct mg_str needle); + +/* Strip whitespace at the start and the end of s */ +struct mg_str mg_strstrip(struct mg_str s); + +/* Returns 1 if s starts with the given prefix. */ +int mg_str_starts_with(struct mg_str s, struct mg_str prefix); + +#ifdef __cplusplus +} +#endif + +#endif /* CS_COMMON_MG_STR_H_ */ diff --git a/src/common/platforms/arm/arm_exc.c b/src/common/platforms/arm/arm_exc.c deleted file mode 100644 index 3477e6bf3c10f7c4925071d34b16219546271620..0000000000000000000000000000000000000000 --- a/src/common/platforms/arm/arm_exc.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "arm_exc.h" - -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "FreeRTOS.h" - -#include "common/platform.h" - -#include "mgos_core_dump.h" -#include "mgos_hal.h" - -#ifndef MGOS_ENABLE_CORE_DUMP -#define MGOS_ENABLE_CORE_DUMP 1 -#endif - -#if __FPU_PRESENT && !defined(MGOS_BOOT_BUILD) -static void save_s16_s31(uint32_t *dst) { - __asm volatile( - "\ - vmov r1, s16\n str r1, [%0, 0]\n\ - vmov r1, s17\n str r1, [%0, 4]\n\ - vmov r1, s18\n str r1, [%0, 8]\n\ - vmov r1, s19\n str r1, [%0, 12]\n\ - vmov r1, s20\n str r1, [%0, 16]\n\ - vmov r1, s21\n str r1, [%0, 20]\n\ - vmov r1, s22\n str r1, [%0, 24]\n\ - vmov r1, s23\n str r1, [%0, 28]\n\ - vmov r1, s24\n str r1, [%0, 32]\n\ - vmov r1, s25\n str r1, [%0, 36]\n\ - vmov r1, s26\n str r1, [%0, 40]\n\ - vmov r1, s27\n str r1, [%0, 44]\n\ - vmov r1, s28\n str r1, [%0, 48]\n\ - vmov r1, s29\n str r1, [%0, 52]\n\ - vmov r1, s30\n str r1, [%0, 56]\n\ - vmov r1, s31\n str r1, [%0, 60]\n\ - " - : - : "r"(dst) - : "r1"); -} - -static void print_fpu_regs(const uint32_t *regs, int off, int n) { - for (int i = 0, j = off; i < n; i++, j++) { - if (j % 4 == 0) mgos_cd_putc('\n'); - mgos_cd_printf(" S%d: %s0x%08lx", j, (j < 10 ? " " : ""), regs[i]); - } -} -#endif - -static struct arm_gdb_reg_file *s_rf = NULL; - -void arm_exc_dump_regs(void) { - mgos_cd_write_section(MGOS_CORE_DUMP_SECTION_REGS, s_rf, sizeof(*s_rf)); -} - -void arm_exc_handler_bottom(uint8_t isr_no, struct arm_exc_frame *ef, - struct arm_gdb_reg_file *rf) { - char buf[8]; - const char *name; -#if __MPU_PRESENT - MPU->CTRL = 0; // Disable MPU. -#endif - portDISABLE_INTERRUPTS(); - s_rf = rf; - switch (isr_no) { - case 0: - name = "ThreadMode"; - break; - case 1: - case 7: - case 8: - case 9: - case 10: - case 13: - name = "Reserved"; - break; - case 2: - name = "NMI"; - break; - case 3: - name = "HardFault"; - break; - case 4: - name = "MemManage"; - break; - case 5: - name = "BusFault"; - break; - case 6: - name = "UsageFault"; - break; - case 11: - name = "SVCall"; - break; - case 12: - name = "ReservedDebug"; - break; - case 14: - name = "PendSV"; - break; - case 15: - name = "SysTick"; - break; - default: { -#ifndef MGOS_BOOT_BUILD - sprintf(buf, "IRQ%u", isr_no - 16); -#endif - name = buf; - } - } - mgos_cd_printf("\n\n--- Exception %u (%s) ---\n", isr_no, name); - if (rf != NULL) { - mgos_cd_printf( - " R%d: 0x%08lx R%d: 0x%08lx R%d: 0x%08lx R%d: 0x%08lx\n", 0, - rf->r[0], 1, rf->r[1], 2, rf->r[2], 3, rf->r[3]); - mgos_cd_printf( - " R%d: 0x%08lx R%d: 0x%08lx R%d: 0x%08lx R%d: 0x%08lx\n", 4, - rf->r[4], 5, rf->r[5], 6, rf->r[6], 7, rf->r[7]); - mgos_cd_printf(" R8: 0x%08lx R9: 0x%08lx R10: 0x%08lx R11: 0x%08lx\n", - rf->r[8], rf->r[9], rf->r[10], rf->r[11]); - mgos_cd_printf(" R12: 0x%08lx SP: 0x%08lx LR: 0x%08lx PC: 0x%08lx\n", - rf->r[12], rf->sp, rf->lr, rf->pc); - mgos_cd_printf(" PSR: 0x%08lx MSP: 0x%08lx PSP: 0x%08lx\n", rf->xpsr, - rf->msp, rf->psp); - } -#if __FPU_PRESENT - memset(rf->d, 0, sizeof(rf->d)); -#if !defined(MGOS_BOOT_BUILD) - rf->fpscr = ef->fpscr; - memcpy((uint8_t *) rf->d, ef->s, sizeof(ef->s)); - print_fpu_regs((uint32_t *) rf->d, 0, ARRAY_SIZE(ef->s)); - save_s16_s31(ef->s); - memcpy(((uint8_t *) rf->d) + sizeof(ef->s), ef->s, sizeof(ef->s)); - print_fpu_regs((uint32_t *) (((uint8_t *) rf->d) + sizeof(ef->s)), 16, - ARRAY_SIZE(ef->s)); - mgos_cd_putc('\n'); - mgos_cd_printf("FPSCR: 0x%08lx\n", rf->fpscr); -#else - rf->fpscr = 0; -#endif -#endif -#if MGOS_ENABLE_CORE_DUMP - mgos_cd_write(); -#endif -#ifdef MGOS_HALT_ON_EXCEPTION - mgos_cd_printf("Halting\n"); - while (1) { - mgos_wdt_feed(); - } -#else - mgos_cd_printf("Rebooting\n"); - mgos_dev_system_restart(); -#endif - (void) ef; -} diff --git a/src/common/platforms/arm/arm_exc.h b/src/common/platforms/arm/arm_exc.h deleted file mode 100644 index 63a2c1ccbbbdea910a98eaab446457de9046fb25..0000000000000000000000000000000000000000 --- a/src/common/platforms/arm/arm_exc.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014-2019 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <stdint.h> - -struct arm_exc_frame { - uint32_t r0; - uint32_t r1; - uint32_t r2; - uint32_t r3; - uint32_t r12; - uint32_t lr; - uint32_t pc; - uint32_t xpsr; -#if __FPU_PRESENT - uint32_t s[16]; - uint32_t fpscr; - uint32_t reserved; -#endif -} __attribute__((packed)); - -struct arm_gdb_reg_file { - uint32_t r[13]; - uint32_t sp; - uint32_t lr; - uint32_t pc; - uint32_t xpsr; -#if __FPU_PRESENT - uint64_t d[16]; - uint32_t fpscr; -#endif - // MSP and PSP are our extension. - uint32_t msp; - uint32_t psp; -} __attribute__((packed)); - -void arm_exc_handler_bottom(uint8_t isr_no, struct arm_exc_frame *ef, - struct arm_gdb_reg_file *rf); -void arm_exc_dump_regs(void); diff --git a/src/common/platforms/arm/arm_exc_top.S b/src/common/platforms/arm/arm_exc_top.S deleted file mode 100644 index 10a7c9ae5a579ecf88ef813196b96e49db1f43ca..0000000000000000000000000000000000000000 --- a/src/common/platforms/arm/arm_exc_top.S +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2014-2017 Cesanta Software Limited - * All rights reserved - */ - -.arch armv7e-m -.syntax unified -.thumb - -/* These are required to satisfy TI linker. */ -.eabi_attribute Tag_ABI_align_needed, 1 -.eabi_attribute Tag_ABI_align_preserved, 1 - -.global arm_exc_handler_top -.global arm_exc_handler_bottom - -/* - * Determines the stack pointer, populates most of the GDB frame - * and hands off to the C routine. - */ -.section .text.arm_exc_handler_top -.type arm_exc_handler_top, %function -.align 8 - -arm_exc_handler_top: - tst lr, #4 - ite eq - mrseq r1, msp - mrsne r1, psp - // r1 -> arm_exc_frame prepared for us by the CPU -#if __FPU_PRESENT - add r0, r1, #104 // sizeof(arm_exc_frame) - sub sp, #208 // sizeof(arm_gdb_reg_file) -#else - add r0, r1, #32 // sizeof(arm_exc_frame) - sub sp, #76 // sizeof(arm_gdb_reg_file) -#endif - mov r2, sp - // r0 -> original sp, r2 -> arm_gdb_reg_file to fill - // r3 - scratch - ldr r3, [r1, #0] // r0 - str r3, [r2, #0] - ldr r3, [r1, #4] // r2 - str r3, [r2, #4] - ldr r3, [r1, #8] // r1 - str r3, [r2, #8] - ldr r3, [r1, #12] // r3 - str r3, [r2, #12] - str r4, [r2, #16] // r4 - str r5, [r2, #20] // r5 - str r6, [r2, #24] // r6 - str r7, [r2, #28] // r7 - str r8, [r2, #32] // r8 - str r9, [r2, #36] // r9 - str r10, [r2, #40] // r10 - str r11, [r2, #44] // r11 - ldr r3, [r1, #16] // r12 - str r3, [r2, #48] - str r0, [r2, #52] // sp - ldr r3, [r1, #20] // lr - str r3, [r2, #56] - ldr r3, [r1, #24] // pc - str r3, [r2, #60] - ldr r3, [r1, #28] // xpsr - str r3, [r2, #64] -#if __FPU_PRESENT - mrs r3, msp - str r3, [r2, #200] // msp - mrs r3, psp - str r3, [r2, #204] // psp -#else - mrs r3, msp - str r3, [r2, #68] // msp - mrs r3, psp - str r3, [r2, #72] // psp -#endif - - mrs r0, ipsr - b arm_exc_handler_bottom -.size arm_exc_handler_top, . - arm_exc_handler_top diff --git a/src/common/platforms/arm/arm_nsleep100.c b/src/common/platforms/arm/arm_nsleep100.c deleted file mode 100644 index 554d20441d2db32dfc6ecebd204c07d807d3e04d..0000000000000000000000000000000000000000 --- a/src/common/platforms/arm/arm_nsleep100.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <math.h> - -#include "mgos.h" -#include "mgos_system.h" - -void (*mgos_nsleep100)(uint32_t n); -uint32_t mgos_nsleep100_loop_count = 0; -/* Provided by arm_nsleep100_{m4,m7}.S for M4 and M7 respectively. */ -extern void mgos_nsleep100_impl(uint32_t n); - -void mgos_nsleep100_cal(void) { - uint32_t cpu_freq = mgos_get_cpu_freq(); - /* # of instruction cycles per 100 ns */ - mgos_nsleep100_loop_count = - roundf((100.0f / 1000000000.0f) / (1.0f / cpu_freq)); - mgos_nsleep100 = mgos_nsleep100_impl; -} diff --git a/src/common/platforms/arm/arm_nsleep100_m3.S b/src/common/platforms/arm/arm_nsleep100_m3.S deleted file mode 100644 index 0ce16bf52d7ef49a4c66143e99ccc1d9b412b36f..0000000000000000000000000000000000000000 --- a/src/common/platforms/arm/arm_nsleep100_m3.S +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2014-2019 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.arch armv7e-m -.syntax unified -.thumb - -/* These are required to satisfy TI linker. */ -.eabi_attribute Tag_ABI_align_needed, 1 -.eabi_attribute Tag_ABI_align_preserved, 1 - -.global mgos_nsleep100_impl -.global mgos_nsleep100_loop_count - -.section .text.IRAM.mgos_nsleep100_impl -.type mgos_nsleep100_impl, %function -.align 4 - -mgos_nsleep100_impl: - ldr r3, =mgos_nsleep100_loop_count - ldr r3, [r3] - mul r0, r3 - mov r1, #6 - udiv r0, r0, r1 - cbz r0, xxx -lxx: - subs r0, #1 - bne lxx -xxx: - bx lr -.align 4 -.size mgos_nsleep100_impl, . - mgos_nsleep100_impl diff --git a/src/common/platforms/arm/arm_nsleep100_m4.S b/src/common/platforms/arm/arm_nsleep100_m4.S deleted file mode 100644 index 45cc32b30ebb8822cda8433b7c6bea6e2036e785..0000000000000000000000000000000000000000 --- a/src/common/platforms/arm/arm_nsleep100_m4.S +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.arch armv7e-m -.syntax unified -.thumb - -/* These are required to satisfy TI linker. */ -.eabi_attribute Tag_ABI_align_needed, 1 -.eabi_attribute Tag_ABI_align_preserved, 1 - -.global mgos_nsleep100_impl -.global mgos_nsleep100_loop_count - -#if defined(TARGET_IS_CC3200) || defined(TARGET_IS_CC3220) -.section .iram.mgos_nsleep100_impl -#else -.section .text.IRAM.mgos_nsleep100_impl -#endif -.type mgos_nsleep100_impl, %function -.align 4 - -mgos_nsleep100_impl: - ldr r3, =mgos_nsleep100_loop_count - ldr r3, [r3] - mul r0, r3 -#if defined(STM32L4) - mov r1, #3 -#else - mov r1, #6 -#endif - udiv r0, r0, r1 - cbz r0, mgos_nsleep100_impl_out -mgos_nsleep100_impl_loop: - subs r0, #1 - bne mgos_nsleep100_impl_loop -mgos_nsleep100_impl_out: - bx lr -.align 4 -.size mgos_nsleep100_impl, . - mgos_nsleep100_impl diff --git a/src/common/platforms/arm/arm_nsleep100_m7.S b/src/common/platforms/arm/arm_nsleep100_m7.S deleted file mode 100644 index be6da6f7b536533bcb242e36435eaf01f011f4df..0000000000000000000000000000000000000000 --- a/src/common/platforms/arm/arm_nsleep100_m7.S +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.arch armv7e-m -.syntax unified -.thumb - -/* These are required to satisfy TI linker. */ -.eabi_attribute Tag_ABI_align_needed, 1 -.eabi_attribute Tag_ABI_align_preserved, 1 - -.global mgos_nsleep100_impl -.global mgos_nsleep100_loop_count - -.section .text.IRAM.mgos_nsleep100_impl -.type mgos_nsleep100_impl, %function -.align 4 - -mgos_nsleep100_impl: - ldr r3, =mgos_nsleep100_loop_count - ldr r3, [r3] - /* Because of speculative fetch, the core loop only takes 1 cycle. */ - muls r0, r3 - cbz r0, xxx -lxx: - subs r0, #1 - bne lxx -xxx: - bx lr -.align 4 -.size mgos_nsleep100_impl, . - mgos_nsleep100_impl diff --git a/src/common/platforms/cc3200/cc3200.ld b/src/common/platforms/cc3200/cc3200.ld deleted file mode 100644 index a2df648c7ca6ecab9d553e8333f07daefc4dec5f..0000000000000000000000000000000000000000 --- a/src/common/platforms/cc3200/cc3200.ld +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** -* -* GCC Linker script for CC3200. Based on TI's example "blinky.ld". -* -* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ -* -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* -* Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the -* distribution. -* -* Neither the name of Texas Instruments Incorporated nor the names of -* its contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -******************************************************************************/ - -ORG = DEFINED(ORG) ? ORG : 0x20004000; -RAM_SIZE = DEFINED(RAM_SIZE) ? RAM_SIZE : 0x3C000; - -MEMORY -{ - /* SRAM size of 240KB for cc3200 ES 1.33 device onward */ - SRAM (rwx) : ORIGIN = ORG, LENGTH = RAM_SIZE -} - -SECTIONS -{ - .text : - { - _text = .; - KEEP(*(.intvecs)) - *(.text*) - *(.rodata*) - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(8); - _etext = .; - } > SRAM - - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } > SRAM - - __init_data = .; - - .data : AT(__init_data) - { - _data = .; - *(.data*) - . = ALIGN (8); - _edata = .; - } > SRAM - - .bss : - { - _bss = .; - *(.bss*) - *(COMMON) - _ebss = .; - } > SRAM - - .heap : - { - _heap = .; - . = . + (LENGTH(SRAM) - SIZEOF(.text) - SIZEOF(.ARM) - SIZEOF(.data) - SIZEOF(.bss)); - . = ALIGN(8); - _eheap = .; - - } > SRAM -} diff --git a/src/common/platforms/cc3200/cc3200_libc.c b/src/common/platforms/cc3200/cc3200_libc.c index 5262917b337f50ea45284e2388751cd482762dd3..ff6a3218309f88eebcbab3618bbb12215d913e02 100644 --- a/src/common/platforms/cc3200/cc3200_libc.c +++ b/src/common/platforms/cc3200/cc3200_libc.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if CS_PLATFORM == CS_P_CC3200 diff --git a/src/common/platforms/cc3200/cc3200v1p32.cmd b/src/common/platforms/cc3200/cc3200v1p32.cmd deleted file mode 100644 index 3b17d0757650d6b7ce9be3be8c7a3bfd133bce93..0000000000000000000000000000000000000000 --- a/src/common/platforms/cc3200/cc3200v1p32.cmd +++ /dev/null @@ -1,82 +0,0 @@ -//***************************************************************************** -// cc3200v1p32.cmd -// -// CCS linker configuration file for cc3200 ES 1.32. -// -// Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ -// -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the -// distribution. -// -// Neither the name of Texas Instruments Incorporated nor the names of -// its contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -//***************************************************************************** - - ---retain=g_pfnVectors - -//***************************************************************************** -// The following command line options are set as part of the CCS project. -// If you are building using the command line, or for some reason want to -// define them here, you can uncomment and modify these lines as needed. -// If you are using CCS for building, it is probably better to make any such -// modifications in your CCS project and leave this file alone. -//***************************************************************************** - - -//***************************************************************************** -// The starting address of the application. Normally the interrupt vectors -// must be located at the beginning of the application. -//***************************************************************************** -#define RAM_BASE 0x20004000 - -/* System memory map */ - -MEMORY -{ - /* Application uses internal RAM for program and data */ - SRAM_CODE (RWX) : origin = 0x20004000, length = 0x2F000 - SRAM_DATA (RWX) : origin = 0x20033000, length = 0xD000 -} - -/* Section allocation in memory */ - -SECTIONS -{ - .intvecs: > RAM_BASE - .init_array : > SRAM_CODE - .vtable : > SRAM_CODE - .text : > SRAM_CODE - .const : > SRAM_CODE - .cinit : > SRAM_CODE - .pinit : > SRAM_CODE - .data : > SRAM_DATA - .bss : > SRAM_DATA - .sysmem : > SRAM_DATA - .stack : > SRAM_DATA(HIGH) -} - diff --git a/src/common/platforms/cc3200/gcc.mk b/src/common/platforms/cc3200/gcc.mk deleted file mode 100644 index 4f39e78965a6b44f8ec738a30b1f0a247d4430b1..0000000000000000000000000000000000000000 --- a/src/common/platforms/cc3200/gcc.mk +++ /dev/null @@ -1,52 +0,0 @@ -APP_LDFLAGS ?= -CC_WRAPPER ?= -GENFILES_LIST ?= -CC = arm-none-eabi-gcc -CXX = arm-none-eabi-g++ -AR = arm-none-eabi-ar -NM = arm-none-eabi-nm - -IPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 -VPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 - -C_CXX_FLAGS = -mthumb -mcpu=cortex-m4 -ffunction-sections -fdata-sections \ - -MD -Os -ggdb -Wall -Werror -Dgcc -CFLAGS += -std=c99 $(C_CXX_FLAGS) -CXXFLAGS += -std=g++11 $(C_CXX_FLAGS) - -AR = arm-none-eabi-ar -LD = arm-none-eabi-ld -OBJCOPY = arm-none-eabi-objcopy -LIBGCC := ${shell ${CC} -mthumb ${CFLAGS} -print-libgcc-file-name} -LIBC := ${shell ${CC} ${CFLAGS} -print-file-name=libc.a} -LIBM := ${shell ${CC} ${CFLAGS} -print-file-name=libm.a} - -# Disable certain warnings on SDK sources, we have no control over them anyway. -# We also force-include platform.h which resolves some symbol conflicts -# between system includes and simplelink.h -$(SDK_OBJS): CFLAGS += -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable -Wno-builtin-macro-redefined -$(SDK_OBJS): CFLAGS += -include common/platform.h - -# cc flags,file -define cc - $(vecho) "GCC $2" - $(Q) $(CC_WRAPPER) $(CC) -c $1 -o $@ $2 -endef -define cxx - $(vecho) "G++ $2" - $(Q) $(CC_WRAPPER) $(CXX) -c $1 -o $@ $2 -endef - -# ar files -define ar - $(vecho) "AR $@" - $(Q) $(AR) cru $@ $1 -endef - -# link script,flags,objs -define link - $(vecho) "LD $@" - $(Q) $(CC_WRAPPER) $(LD) \ - --gc-sections -o $@ -T $1 $2 $3 \ - $(LIBM) $(LIBC) $(LIBGCC) -endef diff --git a/src/common/platforms/cc3200/ti.mk b/src/common/platforms/cc3200/ti.mk deleted file mode 100644 index cbfc2f1761eed91c99b771ffde1459c3e6e21c86..0000000000000000000000000000000000000000 --- a/src/common/platforms/cc3200/ti.mk +++ /dev/null @@ -1,52 +0,0 @@ -IPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/CCS/ARM_CM3 -VPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/CCS/ARM_CM3 - -CC_WRAPPER ?= -CC = $(TOOLCHAIN)/bin/armcl -AR = $(TOOLCHAIN)/bin/armar -NM = nm -GENFILES_LIST ?= - -C_CXX_FLAGS = -Dccs -I$(TOOLCHAIN)/include -TI_C_CXX_FLAGS = -mv7M4 --little_endian --code_state=16 --float_support=vfplib --abi=eabi \ - -O4 --opt_for_speed=0 --unaligned_access=on --small_enum \ - --gen_func_subsections=on --diag_wrap=off --display_error_number \ - --emit_warnings_as_errors -CFLAGS += --c99 $(TI_C_CXX_FLAGS) $(C_CXX_FLAGS) -CXXFLAGS += $(TI_C_CXX_FLAGS) $(C_CXX_FLAGS) - -# cc flags,file -define cc - $(vecho) "TICC $2" - $(Q) $(CC_WRAPPER) $(CC) -c --preproc_with_compile -ppd=$@.d $1 --output_file=$@ $2 -endef -define cxx - $(vecho) "TICXX $2" - $(Q) $(CC_WRAPPER) $(CC) -c --preproc_with_compile -ppd=$@.d $1 --output_file=$@ $2 -endef - -# asm flags,file -define asm - $(vecho) "TIASM $2" - $(Q) $(CC_WRAPPER) $(CC) -c $1 --output_file=$@ $2 -endef - -# ar files -define ar - $(vecho) "TIAR $@" - $(Q) $(AR) qru $@ $1 -endef - -# link script,flags,objs -define link - $(vecho) "TILD $@" - $(Q) $(CC_WRAPPER) $(CC) \ - -mv7M4 --code_state=16 --float_support=vfplib --abi=eabi --little_endian \ - --run_linker \ - --generate_dead_funcs_list=$@.garbage.xml \ - -i $(TOOLCHAIN)/lib \ - --reread_libs --warn_sections --display_error_number \ - --unused_section_elimination=on \ - -o $@ --map_file=$@.map --xml_link_info=$@.map.xml \ - $2 $1 $3 -endef diff --git a/src/common/platforms/esp/esptool.py b/src/common/platforms/esp/esptool.py deleted file mode 100755 index 9592f6deae5200559730ad7e9d281be80e4af686..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp/esptool.py +++ /dev/null @@ -1,2133 +0,0 @@ -#!/usr/bin/env python -# NB: Before sending a PR to change the above line to '#!/usr/bin/env python2', please read https://github.com/themadinventor/esptool/issues/21 -# -# ESP8266 & ESP32 ROM Bootloader Utility -# https://github.com/themadinventor/esptool -# -# Copyright (C) 2014-2016 Fredrik Ahlberg, Angus Gratton, Espressif Systems (Shanghai) PTE LTD, other contributors as noted. -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin -# Street, Fifth Floor, Boston, MA 02110-1301 USA. - -import argparse -import hashlib -import inspect -import json -import os -import serial -import struct -import subprocess -import sys -import time -import base64 -import zlib - -__version__ = "2.0-dev" - - -MAX_UINT32 = 0xffffffff -MAX_UINT24 = 0xffffff - - -def check_supported_function(func, check_func): - """ - Decorator implementation that wraps a check around an ESPLoader - bootloader function to check if it's supported. - - This is used to capture the multidimensional differences in - functionality between the ESP8266 & ESP32 ROM loaders, and the - software stub that runs on both. Not possible to do this cleanly - via inheritance alone. - """ - def inner(*args, **kwargs): - obj = args[0] - if check_func(obj): - return func(*args, **kwargs) - else: - raise NotImplementedInROMError(obj) - return inner - - -def stub_function_only(func): - """ Attribute for a function only supported in the software stub loader """ - return check_supported_function(func, lambda o: o.IS_STUB) - - -def stub_and_esp32_function_only(func): - """ Attribute for a function only supported by software stubs or ESP32 ROM """ - return check_supported_function(func, lambda o: o.IS_STUB or o.CHIP_NAME == "ESP32") - - -def esp8266_function_only(func): - """ Attribute for a function only supported on ESP8266 """ - return check_supported_function(func, lambda o: o.CHIP_NAME == "ESP8266") - - -class ESPLoader(object): - """ Base class providing access to ESP ROM & softtware stub bootloaders. - Subclasses provide ESP8266 & ESP32 specific functionality. - - Don't instantiate this base class directly, either instantiate a subclass or - call ESPLoader.detect_chip() which will interrogate the chip and return the - appropriate subclass instance. - - """ - CHIP_NAME = "Espressif device" - IS_STUB = False - - DEFAULT_PORT = "/dev/ttyUSB0" - - # Commands supported by ESP8266 ROM bootloader - ESP_FLASH_BEGIN = 0x02 - ESP_FLASH_DATA = 0x03 - ESP_FLASH_END = 0x04 - ESP_MEM_BEGIN = 0x05 - ESP_MEM_END = 0x06 - ESP_MEM_DATA = 0x07 - ESP_SYNC = 0x08 - ESP_WRITE_REG = 0x09 - ESP_READ_REG = 0x0a - - # Some comands supported by ESP32 ROM bootloader (or -8266 w/ stub) - ESP_SPI_SET_PARAMS = 0x0B - ESP_SPI_ATTACH = 0x0D - ESP_CHANGE_BAUDRATE = 0x0F - ESP_FLASH_DEFL_BEGIN = 0x10 - ESP_FLASH_DEFL_DATA = 0x11 - ESP_FLASH_DEFL_END = 0x12 - ESP_SPI_FLASH_MD5 = 0x13 - - # Some commands supported by stub only - ESP_ERASE_FLASH = 0xD0 - ESP_ERASE_REGION = 0xD1 - ESP_READ_FLASH = 0xD2 - ESP_GET_FLASH_ID = 0xD3 - - # Maximum block sized for RAM and Flash writes, respectively. - ESP_RAM_BLOCK = 0x1800 - ESP_FLASH_BLOCK = 0x400 - - FLASH_WRITE_SIZE = ESP_FLASH_BLOCK - - # Default baudrate. The ROM auto-bauds, so we can use more or less whatever we want. - ESP_ROM_BAUD = 115200 - - # First byte of the application image - ESP_IMAGE_MAGIC = 0xe9 - - # Initial state for the checksum routine - ESP_CHECKSUM_MAGIC = 0xef - - # Flash sector size, minimum unit of erase. - ESP_FLASH_SECTOR = 0x1000 - - UART_DATA_REG_ADDR = 0x60000078 - - # Memory addresses - IROM_MAP_START = 0x40200000 - IROM_MAP_END = 0x40300000 - - # The number of bytes in the UART response that signify command status - STATUS_BYTES_LENGTH = 2 - - def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD, do_connect=True): - """Base constructor for ESPLoader bootloader interaction - - Don't call this constructor, either instantiate ESP8266ROM - or ESP32ROM, or use ESPLoader.detect_chip(). - - This base class has all of the instance methods for bootloader - functionality supported across various chips & stub - loaders. Subclasses replace the functions they don't support - with ones which throw NotImplementedInROMError(). - - """ - if isinstance(port, serial.Serial): - self._port = port - else: - self._port = serial.Serial(port) - self._slip_reader = slip_reader(self._port) - # setting baud rate in a separate step is a workaround for - # CH341 driver on some Linux versions (this opens at 9600 then - # sets), shouldn't matter for other platforms/drivers. See - # https://github.com/themadinventor/esptool/issues/44#issuecomment-107094446 - self._port.baudrate = baud - if do_connect: - self.connect() - - @staticmethod - def detect_chip(port=DEFAULT_PORT, baud=ESP_ROM_BAUD): - """Use serial access to detect the chip type. - - We use the UART's datecode register for this, it's mapped at - the same address on ESP8266 & ESP32 so we can use one - memory read and compare to the datecode register for each chip - type. - - """ - detect_port = ESPLoader(port, baud, True) - sys.stdout.write('Detecting chip type... ') - date_reg = detect_port.read_reg(ESPLoader.UART_DATA_REG_ADDR) - - for cls in [ESP8266ROM, ESP32ROM]: - if date_reg == cls.DATE_REG_VALUE: - # don't connect a second time - inst = cls(detect_port._port, baud, False) - print '%s' % inst.CHIP_NAME - return inst - print '' - raise FatalError("Unexpected UART datecode value 0x%08x. Failed to autodetect chip type." % date_reg) - - """ Read a SLIP packet from the serial port """ - def read(self): - r = self._slip_reader.next() - return r - - """ Write bytes to the serial port while performing SLIP escaping """ - def write(self, packet): - buf = '\xc0' \ - + (packet.replace('\xdb','\xdb\xdd').replace('\xc0','\xdb\xdc')) \ - + '\xc0' - self._port.write(buf) - - """ Calculate checksum of a blob, as it is defined by the ROM """ - @staticmethod - def checksum(data, state=ESP_CHECKSUM_MAGIC): - for b in data: - state ^= ord(b) - return state - - """ Send a request and read the response """ - def command(self, op=None, data="", chk=0): - if op is not None: - pkt = struct.pack('<BBHI', 0x00, op, len(data), chk) + data - self.write(pkt) - - # tries to get a response until that response has the - # same operation as the request or a retries limit has - # exceeded. This is needed for some esp8266s that - # reply with more sync responses than expected. - for retry in xrange(100): - p = self.read() - if len(p) < 8: - continue - (resp, op_ret, len_ret, val) = struct.unpack('<BBHI', p[:8]) - if resp != 1: - continue - data = p[8:] - if op is None or op_ret == op: - return val, data - - raise FatalError("Response doesn't match request") - - def check_command(self, op_description, op=None, data="", chk=0): - """ - Execute a command with 'command', check the result code and throw an appropriate - FatalError if it fails. - - Returns the "result" of a successful command. - """ - val, data = self.command(op, data, chk) - - # things are a bit weird here, bear with us - - # the status bytes are the last 2/4 bytes in the data (depending on chip) - if len(data) < self.STATUS_BYTES_LENGTH: - raise FatalError("Failed to %s. Only got %d byte status response." % (op_description, len(data))) - status_bytes = data[-self.STATUS_BYTES_LENGTH:] - # we only care if the first one is non-zero. If it is, the second byte is a reason. - if status_bytes[0] != '\0': - raise FatalError.WithResult('Failed to %s' % op_description, status_bytes) - - # if we had more data than just the status bytes, return it as the result - # (this is used by the md5sum command, maybe other commands?) - if len(data) > self.STATUS_BYTES_LENGTH: - return data[:-self.STATUS_BYTES_LENGTH] - else: # otherwise, just return the 'val' field which comes from the reply header (this is used by read_reg) - return val - - def flush_input(self): - self._port.flushInput() - self._slip_reader = slip_reader(self._port) - - def sync(self): - """ Perform a connection test """ - self.command(self.ESP_SYNC, '\x07\x07\x12\x20' + 32 * '\x55') - for i in xrange(7): - self.command() - - def connect(self): - """ Try connecting repeatedly until successful, or giving up """ - print 'Connecting...' - - for _ in xrange(10): - # issue reset-to-bootloader: - # RTS = either CH_PD or nRESET (both active low = chip in reset) - # DTR = GPIO0 (active low = boot to flasher) - self._port.setDTR(False) - self._port.setRTS(True) - time.sleep(0.05) - self._port.setDTR(True) - self._port.setRTS(False) - time.sleep(0.05) - self._port.setDTR(False) - - self._port.timeout = 0.1 - last_exception = None - for _ in xrange(4): - try: - self.flush_input() - self._port.flushOutput() - self.sync() - self._port.timeout = 5 - return - except FatalError as e: - last_exception = e - time.sleep(0.05) - raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_exception)) - - """ Read memory address in target """ - def read_reg(self, addr): - # we don't call check_command here because read_reg() function is called - # when detecting chip type, and the way we check for success (STATUS_BYTES_LENGTH) is different - # for different chip types (!) - val, data = self.command(self.ESP_READ_REG, struct.pack('<I', addr)) - if data[0] != '\0': - raise FatalError.WithResult("Failed to read register address %08x" % addr, data) - return val - - """ Write to memory address in target """ - def write_reg(self, addr, value, mask=0xFFFFFFFF, delay_us=0): - return self.check_command("write target memory", self.ESP_WRITE_REG, - struct.pack('<IIII', addr, value, mask, delay_us)) - - """ Start downloading an application image to RAM """ - def mem_begin(self, size, blocks, blocksize, offset): - return self.check_command("enter RAM download mode", self.ESP_MEM_BEGIN, - struct.pack('<IIII', size, blocks, blocksize, offset)) - - """ Send a block of an image to RAM """ - def mem_block(self, data, seq): - return self.check_command("write to target RAM", self.ESP_MEM_DATA, - struct.pack('<IIII', len(data), seq, 0, 0) + data, - self.checksum(data)) - - """ Leave download mode and run the application """ - def mem_finish(self, entrypoint=0): - return self.check_command("leave RAM download mode", self.ESP_MEM_END, - struct.pack('<II', int(entrypoint == 0), entrypoint)) - - """ Start downloading to Flash (performs an erase) """ - def flash_begin(self, size, offset): - old_tmo = self._port.timeout - num_blocks = (size + self.ESP_FLASH_BLOCK - 1) / self.ESP_FLASH_BLOCK - erase_size = self.get_erase_size(offset, size) - - self._port.timeout = 20 - t = time.time() - self.check_command("enter Flash download mode", self.ESP_FLASH_BEGIN, - struct.pack('<IIII', erase_size, num_blocks, self.ESP_FLASH_BLOCK, offset)) - if size != 0: - print "Took %.2fs to erase flash block" % (time.time() - t) - self._port.timeout = old_tmo - - """ Write block to flash """ - def flash_block(self, data, seq): - self.check_command("write to target Flash after seq %d" % seq, - self.ESP_FLASH_DATA, - struct.pack('<IIII', len(data), seq, 0, 0) + data, - self.checksum(data)) - - """ Leave flash mode and run/reboot """ - def flash_finish(self, reboot=False): - pkt = struct.pack('<I', int(not reboot)) - self.check_command("leave Flash mode", self.ESP_FLASH_END, pkt) - - """ Run application code in flash """ - def run(self, reboot=False): - # Fake flash begin immediately followed by flash end - self.flash_begin(0, 0) - self.flash_finish(reboot) - - """ Read SPI flash manufacturer and device id """ - def flash_id(self): - SPIFLASH_RDID = 0x9F - return self.run_spiflash_command(SPIFLASH_RDID, b"", 24) - - def parse_flash_size_arg(self, arg): - try: - return self.FLASH_SIZES[arg] - except KeyError: - raise FatalError("Flash size '%s' is not supported by this chip type. Supported sizes: %s" - % (arg, ", ".join(self.FLASH_SIZES.keys()))) - - """ Abuse the loader protocol to force flash to be left in write mode """ - @esp8266_function_only - def flash_unlock_dio(self): - # Enable flash write mode - self.flash_begin(0, 0) - # Reset the chip rather than call flash_finish(), which would have - # write protected the chip again (why oh why does it do that?!) - self.mem_begin(0,0,0,0x40100000) - self.mem_finish(0x40000080) - - def _upload_ram(self, offs, data): - length = len(data) - blocks = (length + self.ESP_RAM_BLOCK - 1) / self.ESP_RAM_BLOCK - self.mem_begin(length, blocks, self.ESP_RAM_BLOCK, offs) - for seq in range(blocks): - from_offs = seq * self.ESP_RAM_BLOCK - to_offs = from_offs + self.ESP_RAM_BLOCK - self.mem_block(data[from_offs:to_offs], seq) - - def run_custom_stub(self, stub, params, read_output=True): - stub = dict(stub) - stub['code'] = unhexify(stub['code']) - if 'data' in stub: - stub['data'] = unhexify(stub['data']) - - if stub['num_params'] != len(params): - raise FatalError('Stub requires %d params, %d provided' - % (stub['num_params'], len(params))) - - params = struct.pack('<' + ('I' * stub['num_params']), *params) - pc = params + stub['code'] - - # Upload - self._upload_ram(stub['params_start'], pc) - if 'data' in stub: - self._upload_ram(stub['data_start'], stub['data']) - self.mem_finish(stub['entry']) - - if read_output: - print >>sys.stderr, 'Stub executed, reading response:' - while True: - p = self.read() - print hexify(p) - if p == '': - return - - def run_stub(self, stub=None): - if stub is None: - if self.IS_STUB: - raise FatalError("Not possible for a stub to load another stub (memory likely to overlap.)") - stub = self.STUB_CODE - - # Upload - print "Uploading stub..." - for field in ['text', 'data']: - if field in stub: - self._upload_ram(stub[field + "_start"], stub[field]) - print "Running stub..." - self.mem_finish(stub['entry']) - - p = self.read() - if p != 'OHAI': - raise FatalError("Failed to start stub. Unexpected response: %s" % p) - print "Stub running..." - return self.STUB_CLASS(self) - - @stub_and_esp32_function_only - def flash_defl_begin(self, size, compsize, offset): - """ Start downloading compressed data to Flash (performs an erase) """ - old_tmo = self._port.timeout - num_blocks = (compsize + self.ESP_FLASH_BLOCK - 1) / self.ESP_FLASH_BLOCK - erase_blocks = (size + self.ESP_FLASH_BLOCK - 1) / self.ESP_FLASH_BLOCK - - self._port.timeout = 20 - t = time.time() - print "Compressed %d bytes to %d..." % (size, compsize) - self.check_command("enter compressed flash mode", self.ESP_FLASH_DEFL_BEGIN, - struct.pack('<IIII', erase_blocks * self.ESP_FLASH_BLOCK, num_blocks, self.ESP_FLASH_BLOCK, offset)) - if size != 0 and not self.IS_STUB: - # (stub erases as it writes, but ROM loaders erase on begin) - print "Took %.2fs to erase flash block" % (time.time() - t) - self._port.timeout = old_tmo - - """ Write block to flash, send compressed """ - @stub_and_esp32_function_only - def flash_defl_block(self, data, seq): - self.check_command("write compressed data to flash after seq %d" % seq, - self.ESP_FLASH_DEFL_DATA, struct.pack('<IIII', len(data), seq, 0, 0) + data, self.checksum(data)) - - """ Leave compressed flash mode and run/reboot """ - @stub_and_esp32_function_only - def flash_defl_finish(self, reboot=False): - pkt = struct.pack('<I', int(not reboot)) - self.check_command("leave compressed flash mode", self.ESP_FLASH_DEFL_END, pkt) - self.in_bootloader = False - - @stub_and_esp32_function_only - def flash_md5sum(self, addr, size): - # the MD5 command returns additional bytes in the standard - # command reply slot - res = self.check_command('calculate md5sum', self.ESP_SPI_FLASH_MD5, struct.pack('<IIII', addr, size, 0, 0)) - - if len(res) == 32: - return res # already hex formatted - elif len(res) == 16: - return hexify(res).lower() - else: - raise FatalError("MD5Sum command returned unexpected result: %r" % res) - - @stub_and_esp32_function_only - def change_baud(self, baud): - print "Changing baud rate to %d" % baud - self.command(self.ESP_CHANGE_BAUDRATE, struct.pack('<II', baud, 0)) - print "Changed." - self._port.baudrate = baud - time.sleep(0.05) # get rid of crap sent during baud rate change - self.flush_input() - - @stub_function_only - def erase_flash(self): - oldtimeout = self._port.timeout - # depending on flash chip model the erase may take this long (maybe longer!) - self._port.timeout = 128 - try: - self.check_command("erase flash", self.ESP_ERASE_FLASH) - finally: - self._port.timeout = oldtimeout - - @stub_function_only - def erase_region(self, offset, size): - if offset % self.ESP_FLASH_SECTOR != 0: - raise FatalError("Offset to erase from must be a multiple of 4096") - if size % self.ESP_FLASH_SECTOR != 0: - raise FatalError("Size of data to erase must be a multiple of 4096") - self.check_command("erase region", self.ESP_ERASE_REGION, struct.pack('<II', offset, size)) - - @stub_function_only - def read_flash(self, offset, length, progress_fn=None): - # issue a standard bootloader command to trigger the read - self.check_command("read flash", self.ESP_READ_FLASH, - struct.pack('<IIII', - offset, - length, - self.ESP_FLASH_BLOCK, - 64)) - # now we expect (length / block_size) SLIP frames with the data - data = '' - while len(data) < length: - p = self.read() - data += p - self.write(struct.pack('<I', len(data))) - if progress_fn and (len(data) % 1024 == 0 or len(data) == length): - progress_fn(len(data), length) - if progress_fn: - progress_fn(len(data), length) - if len(data) > length: - raise FatalError('Read more than expected') - digest_frame = self.read() - if len(digest_frame) != 16: - raise FatalError('Expected digest, got: %s' % hexify(digest_frame)) - expected_digest = hexify(digest_frame).upper() - digest = hashlib.md5(data).hexdigest().upper() - if digest != expected_digest: - raise FatalError('Digest mismatch: expected %s, got %s' % (expected_digest, digest)) - return data - - def flash_spi_attach(self,is_hspi,is_legacy): - """Send SPI attach command to enable the SPI flash pins - - ESP8266 ROM does this when you send flash_begin, ESP32 ROM - has it as a SPI command. - """ - # last 3 bytes in ESP_SPI_ATTACH argument are reserved values - arg = struct.pack('<IBBBB', 1 if is_hspi else 0, 1 if is_legacy else 0, 0, 0, 0) - self.check_command("configure SPI flash pins", ESP32ROM.ESP_SPI_ATTACH, arg) - - def flash_set_parameters(self, size): - """Tell the ESP bootloader the parameters of the chip - - Corresponds to the "flashchip" data structure that the ROM - has in RAM. - - 'size' is in bytes. - - All other flash parameters are currently hardcoded (on ESP8266 - these are mostly ignored by ROM code, on ESP32 I'm not sure.) - """ - fl_id = 0 - total_size = size - block_size = 64 * 1024 - sector_size = 4 * 1024 - page_size = 256 - status_mask = 0xffff - self.check_command("set SPI params", ESP32ROM.ESP_SPI_SET_PARAMS, - struct.pack('<IIIIII', fl_id, total_size, block_size, sector_size, page_size, status_mask)) - - def run_spiflash_command(self, spiflash_command, data=b"", read_bits=0): - """Run an arbitrary SPI flash command. - - This function uses the "USR_COMMAND" functionality in the ESP - SPI hardware, rather than the precanned commands supported by - hardware. So the value of spiflash_command is an actual command - byte, sent over the wire. - - After writing command byte, writes 'data' to MOSI and then - reads back 'read_bits' of reply on MISO. Result is a number. - """ - - # SPI_USR register flags - SPI_USR_COMMAND = (1 << 31) - SPI_USR_MISO = (1 << 28) - SPI_USR_MOSI = (1 << 27) - - # SPI registers, base address differs ESP32 vs 8266 - base = self.SPI_REG_BASE - SPI_CMD_REG = base + 0x00 - SPI_USR_REG = base + 0x1C - SPI_USR1_REG = base + 0x20 - SPI_USR2_REG = base + 0x24 - SPI_W0_REG = base + self.SPI_W0_OFFS - - # following two registers are ESP32 only - if self.SPI_HAS_MOSI_DLEN_REG: - # ESP32 has a more sophisticated wayto set up "user" commands - def set_data_lengths(mosi_bits, miso_bits): - SPI_MOSI_DLEN_REG = base + 0x28 - SPI_MISO_DLEN_REG = base + 0x2C - if mosi_bits > 0: - self.write_reg(SPI_MOSI_DLEN_REG, mosi_bits - 1) - if miso_bits > 0: - self.write_reg(SPI_MISO_DLEN_REG, miso_bits - 1) - else: - - def set_data_lengths(mosi_bits, miso_bits): - SPI_DATA_LEN_REG = SPI_USR1_REG - SPI_MOSI_BITLEN_S = 17 - SPI_MISO_BITLEN_S = 8 - mosi_mask = 0 if (mosi_bits == 0) else (mosi_bits - 1) - miso_mask = 0 if (miso_bits == 0) else (miso_bits - 1) - self.write_reg(SPI_DATA_LEN_REG, - (miso_mask << SPI_MISO_BITLEN_S) | ( - mosi_mask << SPI_MOSI_BITLEN_S)) - - # SPI peripheral "command" bitmasks for SPI_CMD_REG - SPI_CMD_USR = (1 << 18) - - # shift values - SPI_USR2_DLEN_SHIFT = 28 - - if read_bits > 32: - raise FatalError("Reading more than 32 bits back from a SPI flash operation is unsupported") - if len(data) > 64: - raise FatalError("Writing more than 64 bytes of data with one SPI command is unsupported") - - data_bits = len(data) * 8 - flags = SPI_USR_COMMAND - if read_bits > 0: - flags |= SPI_USR_MISO - if data_bits > 0: - flags |= SPI_USR_MOSI - set_data_lengths(data_bits, read_bits) - self.write_reg(SPI_USR_REG, flags) - self.write_reg(SPI_USR2_REG, - (7 << SPI_USR2_DLEN_SHIFT) | spiflash_command) - if data_bits == 0: - self.write_reg(SPI_W0_REG, 0) # clear data register before we read it - else: - if len(data) % 4 != 0: # pad to 32-bit multiple - data += b'\0' * (4 - (len(data) % 4)) - words = struct.unpack("I" * (len(data) / 4), data) - next_reg = SPI_W0_REG - for word in words: - self.write_reg(next_reg, word) - next_reg += 4 - self.write_reg(SPI_CMD_REG, SPI_CMD_USR) - - def wait_done(): - for _ in xrange(10): - if (self.read_reg(SPI_CMD_REG) & SPI_CMD_USR) == 0: - return - raise FatalError("SPI command did not complete in time") - wait_done() - - status = self.read_reg(SPI_W0_REG) - return status - - def read_status(self, num_bytes=2): - """Read up to 24 bits (num_bytes) of SPI flash status register contents - via RDSR, RDSR2, RDSR3 commands - - Not all SPI flash supports all three commands. The upper 1 or 2 - bytes may be 0xFF. - """ - SPIFLASH_RDSR = 0x05 - SPIFLASH_RDSR2 = 0x35 - SPIFLASH_RDSR3 = 0x15 - - status = 0 - shift = 0 - for cmd in [SPIFLASH_RDSR, SPIFLASH_RDSR2, SPIFLASH_RDSR3][0:num_bytes]: - status += self.run_spiflash_command(cmd, read_bits=8) << shift - shift += 8 - return status - - def write_status(self, new_status, num_bytes=2, set_non_volatile=False): - """Write up to 24 bits (num_bytes) of new status register - - num_bytes can be 1, 2 or 3. - - Not all flash supports the additional commands to write the - second and third byte of the status register. When writing 2 - bytes, esptool also sends a 16-byte WRSR command (as some - flash types use this instead of WRSR2.) - - If the set_non_volatile flag is set, non-volatile bits will - be set as well as volatile ones (WREN used instead of WEVSR). - - """ - SPIFLASH_WRSR = 0x01 - SPIFLASH_WRSR2 = 0x31 - SPIFLASH_WRSR3 = 0x11 - SPIFLASH_WEVSR = 0x50 - SPIFLASH_WREN = 0x06 - SPIFLASH_WRDI = 0x04 - - enable_cmd = SPIFLASH_WREN if set_non_volatile else SPIFLASH_WEVSR - - # try using a 16-bit WRSR (not supported by all chips) - # this may be redundant, but shouldn't hurt - if num_bytes == 2: - self.run_spiflash_command(enable_cmd) - self.run_spiflash_command(SPIFLASH_WRSR, struct.pack("<H", new_status)) - - # also try using individual commands (also not supported by all chips for num_bytes 2 & 3) - for cmd in [SPIFLASH_WRSR, SPIFLASH_WRSR2, SPIFLASH_WRSR3][0:num_bytes]: - self.run_spiflash_command(enable_cmd) - self.run_spiflash_command(cmd, struct.pack("B", new_status & 0xFF)) - new_status >>= 8 - - self.run_spiflash_command(SPIFLASH_WRDI) - - -class ESP8266ROM(ESPLoader): - """ Access class for ESP8266 ROM bootloader - """ - CHIP_NAME = "ESP8266" - IS_STUB = False - - DATE_REG_VALUE = 0x00062000 - - # OTP ROM addresses - ESP_OTP_MAC0 = 0x3ff00050 - ESP_OTP_MAC1 = 0x3ff00054 - ESP_OTP_MAC3 = 0x3ff0005c - - SPI_REG_BASE = 0x60000200 - SPI_W0_OFFS = 0x40 - SPI_HAS_MOSI_DLEN_REG = False - - FLASH_SIZES = { - '512KB':0x00, - '256KB':0x10, - '1MB':0x20, - '2MB':0x30, - '4MB':0x40, - '2MB-c1': 0x50, - '4MB-c1':0x60, - '4MB-c2':0x70} - - def flash_spi_attach(self, is_spi, is_legacy): - pass # not implemented in ROM, but OK to silently skip - - def flash_set_parameters(self, size): - pass # not implemented in ROM, but OK to silently skip - - def chip_id(self): - """ Read Chip ID from OTP ROM - see http://esp8266-re.foogod.com/wiki/System_get_chip_id_%28IoT_RTOS_SDK_0.9.9%29 """ - id0 = self.read_reg(self.ESP_OTP_MAC0) - id1 = self.read_reg(self.ESP_OTP_MAC1) - return (id0 >> 24) | ((id1 & MAX_UINT24) << 8) - - def read_mac(self): - """ Read MAC from OTP ROM """ - mac0 = self.read_reg(self.ESP_OTP_MAC0) - mac1 = self.read_reg(self.ESP_OTP_MAC1) - mac3 = self.read_reg(self.ESP_OTP_MAC3) - if (mac3 != 0): - oui = ((mac3 >> 16) & 0xff, (mac3 >> 8) & 0xff, mac3 & 0xff) - elif ((mac1 >> 16) & 0xff) == 0: - oui = (0x18, 0xfe, 0x34) - elif ((mac1 >> 16) & 0xff) == 1: - oui = (0xac, 0xd0, 0x74) - else: - raise FatalError("Unknown OUI") - return oui + ((mac1 >> 8) & 0xff, mac1 & 0xff, (mac0 >> 24) & 0xff) - - def get_erase_size(self, offset, size): - """ Calculate an erase size given a specific size in bytes. - - Provides a workaround for the bootloader erase bug.""" - - sectors_per_block = 16 - sector_size = self.ESP_FLASH_SECTOR - num_sectors = (size + sector_size - 1) / sector_size - start_sector = offset / sector_size - - head_sectors = sectors_per_block - (start_sector % sectors_per_block) - if num_sectors < head_sectors: - head_sectors = num_sectors - - if num_sectors < 2 * head_sectors: - return (num_sectors + 1) / 2 * sector_size - else: - return (num_sectors - head_sectors) * sector_size - - -class ESP8266StubLoader(ESP8266ROM): - """ Access class for ESP8266 stub loader, runs on top of ROM. - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - IS_STUB = True - - def __init__(self, rom_loader): - self._port = rom_loader._port - self.flush_input() # resets _slip_reader - -ESP8266ROM.STUB_CLASS = ESP8266StubLoader - - -class ESP32ROM(ESPLoader): - """Access class for ESP32 ROM bootloader - - """ - CHIP_NAME = "ESP32" - IS_STUB = False - - DATE_REG_VALUE = 0x15122500 - - IROM_MAP_START = 0x400d0000 - IROM_MAP_END = 0x40400000 - DROM_MAP_START = 0x3F400000 - DROM_MAP_END = 0x3F700000 - - # ESP32 uses a 4 byte status reply - STATUS_BYTES_LENGTH = 4 - - SPI_REG_BASE = 0x60002000 - EFUSE_REG_BASE = 0x6001a000 - - SPI_W0_OFFS = 0x80 - SPI_HAS_MOSI_DLEN_REG = True - - FLASH_SIZES = { - '1MB':0x00, - '2MB':0x10, - '4MB':0x20, - '8MB':0x30, - '16MB':0x40 - } - - def read_efuse(self, n): - """ Read the nth word of the ESP3x EFUSE region. """ - return self.read_reg(self.EFUSE_REG_BASE + (4 * n)) - - def chip_id(self): - word16 = self.read_efuse(16) - word17 = self.read_efuse(17) - return ((word17 & MAX_UINT24) << 24) | (word16 >> 8) & MAX_UINT24 - - def read_mac(self): - """ Read MAC from EFUSE region """ - word16 = self.read_efuse(16) - word17 = self.read_efuse(17) - word18 = self.read_efuse(18) - word19 = self.read_efuse(19) - wifi_mac = (((word17 >> 16) & 0xff), ((word17 >> 8) & 0xff), ((word17 >> 0) & 0xff), - ((word16 >> 24) & 0xff), ((word16 >> 16) & 0xff), ((word16 >> 8) & 0xff)) - bt_mac = (((word19 >> 16) & 0xff), ((word19 >> 8) & 0xff), ((word19 >> 0) & 0xff), - ((word18 >> 24) & 0xff), ((word18 >> 16) & 0xff), ((word18 >> 8) & 0xff)) - return (wifi_mac,bt_mac) - - def get_erase_size(self, offset, size): - return size - - -class ESP32StubLoader(ESP32ROM): - """ Access class for ESP32 stub loader, runs on top of ROM. - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self._port = rom_loader._port - self.flush_input() # resets _slip_reader - -ESP32ROM.STUB_CLASS = ESP32StubLoader - - -class ESPBOOTLOADER(object): - """ These are constants related to software ESP bootloader, working with 'v2' image files """ - - # First byte of the "v2" application image - IMAGE_V2_MAGIC = 0xea - - # First 'segment' value in a "v2" application image, appears to be a constant version value? - IMAGE_V2_SEGMENT = 4 - - -def LoadFirmwareImage(chip, filename): - """ Load a firmware image. Can be for ESP8266 or ESP32. ESP8266 images will be examined to determine if they are - original ROM firmware images (ESPFirmwareImage) or "v2" OTA bootloader images. - - Returns a BaseFirmwareImage subclass, either ESPFirmwareImage (v1) or OTAFirmwareImage (v2). - """ - with open(filename, 'rb') as f: - if chip == 'esp32': - return ESP32FirmwareImage(f) - else: # Otherwise, ESP8266 so look at magic to determine the image type - magic = ord(f.read(1)) - f.seek(0) - if magic == ESPLoader.ESP_IMAGE_MAGIC: - return ESPFirmwareImage(f) - elif magic == ESPBOOTLOADER.IMAGE_V2_MAGIC: - return OTAFirmwareImage(f) - else: - raise FatalError("Invalid image magic number: %d" % magic) - - -class ImageSegment(object): - """ Wrapper class for a segment in an ESP image - (very similar to a section in an ELFImage also) """ - def __init__(self, addr, data, file_offs=None): - self.addr = addr - # pad all ImageSegments to at least 4 bytes length - pad_mod = len(data) % 4 - if pad_mod != 0: - data += "\x00" * (4 - pad_mod) - self.data = data - self.file_offs = file_offs - self.include_in_checksum = True - - def copy_with_new_addr(self, new_addr): - """ Return a new ImageSegment with same data, but mapped at - a new address. """ - return ImageSegment(new_addr, self.data, 0) - - def __repr__(self): - r = "len 0x%05x load 0x%08x" % (len(self.data), self.addr) - if self.file_offs is not None: - r += " file_offs 0x%08x" % (self.file_offs) - return r - - -class ELFSection(ImageSegment): - """ Wrapper class for a section in an ELF image, has a section - name as well as the common properties of an ImageSegment. """ - def __init__(self, name, addr, data): - super(ELFSection, self).__init__(addr, data) - self.name = name - - def __repr__(self): - return "%s %s" % (self.name, super(ELFSection, self).__repr__()) - - -class BaseFirmwareImage(object): - SEG_HEADER_LEN = 8 - - """ Base class with common firmware image functions """ - def __init__(self): - self.segments = [] - self.entrypoint = 0 - - def load_common_header(self, load_file, expected_magic): - (magic, segments, self.flash_mode, self.flash_size_freq, self.entrypoint) = struct.unpack('<BBBBI', load_file.read(8)) - - if magic != expected_magic or segments > 16: - raise FatalError('Invalid firmware image magic=%d segments=%d' % (magic, segments)) - return segments - - def load_segment(self, f, is_irom_segment=False): - """ Load the next segment from the image file """ - file_offs = f.tell() - (offset, size) = struct.unpack('<II', f.read(8)) - self.warn_if_unusual_segment(offset, size, is_irom_segment) - segment_data = f.read(size) - if len(segment_data) < size: - raise FatalError('End of file reading segment 0x%x, length %d (actual length %d)' % (offset, size, len(segment_data))) - segment = ImageSegment(offset, segment_data, file_offs) - self.segments.append(segment) - return segment - - def warn_if_unusual_segment(self, offset, size, is_irom_segment): - if not is_irom_segment: - if offset > 0x40200000 or offset < 0x3ffe0000 or size > 65536: - print('WARNING: Suspicious segment 0x%x, length %d' % (offset, size)) - - def save_segment(self, f, segment, checksum=None): - """ Save the next segment to the image file, return next checksum value if provided """ - f.write(struct.pack('<II', segment.addr, len(segment.data))) - f.write(segment.data) - if checksum is not None: - return ESPLoader.checksum(segment.data, checksum) - - def read_checksum(self, f): - """ Return ESPLoader checksum from end of just-read image """ - # Skip the padding. The checksum is stored in the last byte so that the - # file is a multiple of 16 bytes. - align_file_position(f, 16) - return ord(f.read(1)) - - def calculate_checksum(self): - """ Calculate checksum of loaded image, based on segments in - segment array. - """ - checksum = ESPLoader.ESP_CHECKSUM_MAGIC - for seg in self.segments: - if seg.include_in_checksum: - checksum = ESPLoader.checksum(seg.data, checksum) - return checksum - - def append_checksum(self, f, checksum): - """ Append ESPLoader checksum to the just-written image """ - align_file_position(f, 16) - f.write(struct.pack('B', checksum)) - - def write_common_header(self, f, segments): - f.write(struct.pack('<BBBBI', ESPLoader.ESP_IMAGE_MAGIC, len(segments), - self.flash_mode, self.flash_size_freq, self.entrypoint)) - - def is_irom_addr(self, addr): - """ Returns True if an address starts in the irom region. - Valid for ESP8266 only. - """ - return ESP8266ROM.IROM_MAP_START <= addr < ESP8266ROM.IROM_MAP_END - - def get_irom_segment(self): - irom_segments = [s for s in self.segments if self.is_irom_addr(s.addr)] - if len(irom_segments) > 0: - if len(irom_segments) != 1: - raise FatalError('Found %d segments that could be irom0. Bad ELF file?' % len(irom_segments)) - return irom_segments[0] - return None - - def get_non_irom_segments(self): - irom_segment = self.get_irom_segment() - return [s for s in self.segments if s != irom_segment] - - -class ESPFirmwareImage(BaseFirmwareImage): - """ 'Version 1' firmware image, segments loaded directly by the ROM bootloader. """ - - ROM_LOADER = ESP8266ROM - - def __init__(self, load_file=None): - super(ESPFirmwareImage, self).__init__() - self.flash_mode = 0 - self.flash_size_freq = 0 - self.version = 1 - - if load_file is not None: - segments = self.load_common_header(load_file, ESPLoader.ESP_IMAGE_MAGIC) - - for _ in xrange(segments): - self.load_segment(load_file) - self.checksum = self.read_checksum(load_file) - - def default_output_name(self, input_file): - """ Derive a default output name from the ELF name. """ - return input_file + '-' - - def save(self, basename): - """ Save a set of V1 images for flashing. Parameter is a base filename. """ - # IROM data goes in its own plain binary file - irom_segment = self.get_irom_segment() - if irom_segment is not None: - with open("%s0x%05x.bin" % (basename, irom_segment.addr - ESP8266ROM.IROM_MAP_START), "wb") as f: - f.write(irom_segment.data) - - # everything but IROM goes at 0x00000 in an image file - normal_segments = self.get_non_irom_segments() - with open("%s0x00000.bin" % basename, 'wb') as f: - self.write_common_header(f, normal_segments) - checksum = ESPLoader.ESP_CHECKSUM_MAGIC - for segment in normal_segments: - checksum = self.save_segment(f, segment, checksum) - self.append_checksum(f, checksum) - - -class OTAFirmwareImage(BaseFirmwareImage): - """ 'Version 2' firmware image, segments loaded by software bootloader stub - (ie Espressif bootloader or rboot) - """ - - ROM_LOADER = ESP8266ROM - - def __init__(self, load_file=None): - super(OTAFirmwareImage, self).__init__() - self.version = 2 - if load_file is not None: - segments = self.load_common_header(load_file, ESPBOOTLOADER.IMAGE_V2_MAGIC) - if segments != ESPBOOTLOADER.IMAGE_V2_SEGMENT: - # segment count is not really segment count here, but we expect to see '4' - print 'Warning: V2 header has unexpected "segment" count %d (usually 4)' % segments - - # irom segment comes before the second header - # - # the file is saved in the image with a zero load address - # in the header, so we need to calculate a load address - irom_segment = self.load_segment(load_file, True) - # for actual mapped addr, add ESP8266ROM.IROM_MAP_START + flashing_Addr + 8 - irom_segment.addr = 0 - irom_segment.include_in_checksum = False - - first_flash_mode = self.flash_mode - first_flash_size_freq = self.flash_size_freq - first_entrypoint = self.entrypoint - # load the second header - - segments = self.load_common_header(load_file, ESPLoader.ESP_IMAGE_MAGIC) - - if first_flash_mode != self.flash_mode: - print('WARNING: Flash mode value in first header (0x%02x) disagrees with second (0x%02x). Using second value.' - % (first_flash_mode, self.flash_mode)) - if first_flash_size_freq != self.flash_size_freq: - print('WARNING: Flash size/freq value in first header (0x%02x) disagrees with second (0x%02x). Using second value.' - % (first_flash_size_freq, self.flash_size_freq)) - if first_entrypoint != self.entrypoint: - print('WARNING: Entrypoint address in first header (0x%08x) disagrees with second header (0x%08x). Using second value.' - % (first_entrypoint, self.entrypoint)) - - # load all the usual segments - for _ in xrange(segments): - self.load_segment(load_file) - self.checksum = self.read_checksum(load_file) - - def default_output_name(self, input_file): - """ Derive a default output name from the ELF name. """ - irom_segment = self.get_irom_segment() - if irom_segment is not None: - irom_offs = irom_segment.addr - ESP8266ROM.IROM_MAP_START - else: - irom_offs = 0 - return "%s-0x%05x.bin" % (os.path.splitext(input_file)[0], - irom_offs & ~(ESPLoader.ESP_FLASH_SECTOR - 1)) - - def save(self, filename): - with open(filename, 'wb') as f: - # Save first header for irom0 segment - f.write(struct.pack('<BBBBI', ESPBOOTLOADER.IMAGE_V2_MAGIC, ESPBOOTLOADER.IMAGE_V2_SEGMENT, - self.flash_mode, self.flash_size_freq, self.entrypoint)) - - irom_segment = self.get_irom_segment() - if irom_segment is not None: - # save irom0 segment, make sure it has load addr 0 in the file - irom_segment = irom_segment.copy_with_new_addr(0) - self.save_segment(f, irom_segment) - - # second header, matches V1 header and contains loadable segments - normal_segments = self.get_non_irom_segments() - self.write_common_header(f, normal_segments) - checksum = ESPLoader.ESP_CHECKSUM_MAGIC - for segment in normal_segments: - checksum = self.save_segment(f, segment, checksum) - self.append_checksum(f, checksum) - - -class ESP32FirmwareImage(BaseFirmwareImage): - """ ESP32 firmware image is very similar to V1 ESP8266 image, - except with an additional 16 byte reserved header at top of image, - and because of new flash mapping capabilities the flash-mapped regions - can be placed in the normal image (just @ 64kB padded offsets). - """ - - ROM_LOADER = ESP32ROM - - def __init__(self, load_file=None): - super(ESP32FirmwareImage, self).__init__() - self.flash_mode = 0 - self.flash_size_freq = 0 - self.version = 1 - self.additional_header = '\x00' * 16 - - if load_file is not None: - segments = self.load_common_header(load_file, ESPLoader.ESP_IMAGE_MAGIC) - self.additional_header = load_file.read(16) - - for i in xrange(segments): - self.load_segment(load_file) - self.checksum = self.read_checksum(load_file) - - def is_flash_addr(self, addr): - return (ESP32ROM.IROM_MAP_START <= addr < ESP32ROM.IROM_MAP_END) \ - or (ESP32ROM.DROM_MAP_START <= addr < ESP32ROM.DROM_MAP_END) - - def default_output_name(self, input_file): - """ Derive a default output name from the ELF name. """ - return "%s.bin" % (os.path.splitext(input_file)[0]) - - def warn_if_unusual_segment(self, offset, size, is_irom_segment): - pass # TODO: add warnings for ESP32 segment offset/size combinations that are wrong - - def save(self, filename): - padding_segments = 0 - with open(filename, 'wb') as f: - self.write_common_header(f, self.segments) - f.write(self.additional_header) - - checksum = ESPLoader.ESP_CHECKSUM_MAGIC - last_addr = None - for segment in sorted(self.segments, key=lambda s:s.addr): - # IROM/DROM segment flash mappings need to align on - # 64kB boundaries. - # - # TODO: intelligently order segments to reduce wastage - # by squeezing smaller DRAM/IRAM segments into the - # 64kB padding space. - IROM_ALIGN = 65536 - - # check for multiple ELF sections that live in the same flash mapping region. - # this is usually a sign of a broken linker script, but if you have a legitimate - # use case then let us know (we can merge segments here, but as a rule you probably - # want to merge them in your linker script.) - if last_addr is not None and self.is_flash_addr(last_addr) \ - and self.is_flash_addr(segment.addr) and segment.addr // IROM_ALIGN == last_addr // IROM_ALIGN: - raise FatalError(("Segment loaded at 0x%08x lands in same 64KB flash mapping as segment loaded at 0x%08x. " + - "Can't generate binary. Suggest changing linker script or ELF to merge sections.") % - (segment.addr, last_addr)) - last_addr = segment.addr - - if self.is_flash_addr(segment.addr): - # Actual alignment required for the segment header: positioned so that - # after we write the next 8 byte header, file_offs % IROM_ALIGN == segment.addr % IROM_ALIGN - # - # (this is because the segment's vaddr may not be IROM_ALIGNed, more likely is aligned - # IROM_ALIGN+0x10 to account for longest possible header. - align_past = (segment.addr % IROM_ALIGN) - self.SEG_HEADER_LEN - assert (align_past + self.SEG_HEADER_LEN) == (segment.addr % IROM_ALIGN) - - # subtract SEG_HEADER_LEN a second time, as the padding block has a header as well - pad_len = (IROM_ALIGN - (f.tell() % IROM_ALIGN)) + align_past - self.SEG_HEADER_LEN - if pad_len < 0: - pad_len += IROM_ALIGN - if pad_len > 0: - null = ImageSegment(0, '\x00' * pad_len, f.tell()) - checksum = self.save_segment(f, null, checksum) - padding_segments += 1 - # verify that after the 8 byte header is added, were are at the correct offset relative to the segment's vaddr - assert (f.tell() + 8) % IROM_ALIGN == segment.addr % IROM_ALIGN - checksum = self.save_segment(f, segment, checksum) - self.append_checksum(f, checksum) - # kinda hacky: go back to the initial header and write the new segment count - # that includes padding segments. Luckily(?) this header is not checksummed - f.seek(1) - f.write(chr(len(self.segments) + padding_segments)) - - -class ELFFile(object): - SEC_TYPE_PROGBITS = 0x01 - SEC_TYPE_STRTAB = 0x03 - - def __init__(self, name): - # Load sections from the ELF file - self.name = name - self.symbols = None - with open(self.name, 'rb') as f: - self._read_elf_file(f) - - def get_section(self, section_name): - for s in self.sections: - if s.name == section_name: - return s - raise ValueError("No section %s in ELF file" % section_name) - - def _read_elf_file(self, f): - # read the ELF file header - LEN_FILE_HEADER = 0x34 - try: - (ident,_type,machine,_version, - self.entrypoint,_phoff,shoff,_flags, - _ehsize, _phentsize,_phnum,_shentsize, - _shnum,shstrndx) = struct.unpack("<16sHHLLLLLHHHHHH", f.read(LEN_FILE_HEADER)) - except struct.error as e: - raise FatalError("Failed to read a valid ELF header from %s: %s" % (self.name, e)) - - if ident[0] != '\x7f' or ident[1:4] != 'ELF': - raise FatalError("%s has invalid ELF magic header" % self.name) - if machine != 0x5e: - raise FatalError("%s does not appear to be an Xtensa ELF file. e_machine=%04x" % (self.name, machine)) - self._read_sections(f, shoff, shstrndx) - - def _read_sections(self, f, section_header_offs, shstrndx): - f.seek(section_header_offs) - section_header = f.read() - LEN_SEC_HEADER = 0x28 - if len(section_header) == 0: - raise FatalError("No section header found at offset %04x in ELF file." % section_header_offs) - if len(section_header) % LEN_SEC_HEADER != 0: - print 'WARNING: Unexpected ELF section header length %04x is not mod-%02x' % (len(section_header),LEN_SEC_HEADER) - - # walk through the section header and extract all sections - section_header_offsets = range(0, len(section_header), LEN_SEC_HEADER) - - def read_section_header(offs): - name_offs,sec_type,_flags,lma,sec_offs,size = struct.unpack_from("<LLLLLL", section_header[offs:]) - return (name_offs, sec_type, lma, size, sec_offs) - all_sections = [read_section_header(offs) for offs in section_header_offsets] - prog_sections = [s for s in all_sections if s[1] == ELFFile.SEC_TYPE_PROGBITS] - - # search for the string table section - if not shstrndx * LEN_SEC_HEADER in section_header_offsets: - raise FatalError("ELF file has no STRTAB section at shstrndx %d" % shstrndx) - _,sec_type,_,sec_size,sec_offs = read_section_header(shstrndx * LEN_SEC_HEADER) - if sec_type != ELFFile.SEC_TYPE_STRTAB: - print 'WARNING: ELF file has incorrect STRTAB section type 0x%02x' % sec_type - f.seek(sec_offs) - string_table = f.read(sec_size) - - # build the real list of ELFSections by reading the actual section names from the - # string table section, and actual data for each section from the ELF file itself - def lookup_string(offs): - raw = string_table[offs:] - return raw[:raw.index('\x00')] - - def read_data(offs,size): - f.seek(offs) - return f.read(size) - - prog_sections = [ELFSection(lookup_string(n_offs), lma, read_data(offs, size)) for (n_offs, _type, lma, size, offs) in prog_sections - if lma != 0] - self.sections = prog_sections - - def _fetch_symbols(self): - if self.symbols is not None: - return - self.symbols = {} - try: - tool_nm = "nm" - proc = subprocess.Popen([tool_nm, self.name], stdout=subprocess.PIPE) - except OSError: - print "Error calling %s, do you have Xtensa toolchain in PATH?" % tool_nm - sys.exit(1) - for l in proc.stdout: - fields = l.strip().split() - try: - if fields[0] == "U": - print "Warning: ELF binary has undefined symbol %s" % fields[1] - continue - if fields[0] == "w": - continue # can skip weak symbols - self.symbols[fields[2]] = int(fields[0], 16) - except ValueError: - raise FatalError("Failed to strip symbol output from nm: %s" % fields) - - def get_symbol_addr(self, sym): - self._fetch_symbols() - return self.symbols[sym] - - -def slip_reader(port): - """Generator to read SLIP packets from a serial port. - Yields one full SLIP packet at a time, raises exception on timeout or invalid data. - - Designed to avoid too many calls to serial.read(1), which can bog - down on slow systems. - """ - partial_packet = None - in_escape = False - while True: - waiting = port.inWaiting() - read_bytes = port.read(1 if waiting == 0 else waiting) - if read_bytes == '': - raise FatalError("Timed out waiting for packet %s" % ("header" if partial_packet is None else "content")) - for b in read_bytes: - if partial_packet is None: # waiting for packet header - if b == '\xc0': - partial_packet = "" - else: - raise FatalError('Invalid head of packet (%r)' % b) - elif in_escape: # part-way through escape sequence - in_escape = False - if b == '\xdc': - partial_packet += '\xc0' - elif b == '\xdd': - partial_packet += '\xdb' - else: - raise FatalError('Invalid SLIP escape (%r%r)' % ('\xdb', b)) - elif b == '\xdb': # start of escape sequence - in_escape = True - elif b == '\xc0': # end of packet - yield partial_packet - partial_packet = None - else: # normal byte in packet - partial_packet += b - - -def arg_auto_int(x): - return int(x, 0) - - -def div_roundup(a, b): - """ Return a/b rounded up to nearest integer, - equivalent result to int(math.ceil(float(int(a)) / float(int(b))), only - without possible floating point accuracy errors. - """ - return (int(a) + int(b) - 1) / int(b) - - -def align_file_position(f, size): - """ Align the position in the file to the next block of specified size """ - align = (size - 1) - (f.tell() % size) - f.seek(align, 1) - - -def flash_size_bytes(size): - """ Given a flash size of the type passed in args.flash_size - (ie 512KB or 1MB) then return the size in bytes. - """ - if "MB" in size: - return int(size[:size.index("MB")]) * 1024 * 1024 - elif "KB" in size: - return int(size[:size.index("KB")]) * 1024 - else: - raise FatalError("Unknown size %s" % size) - - -def hexify(s): - return ''.join('%02X' % ord(c) for c in s) - - -def unhexify(hs): - s = '' - for i in range(0, len(hs) - 1, 2): - s += chr(int(hs[i] + hs[i + 1], 16)) - return s - - -class FatalError(RuntimeError): - """ - Wrapper class for runtime errors that aren't caused by internal bugs, but by - ESP8266 responses or input content. - """ - def __init__(self, message): - RuntimeError.__init__(self, message) - - @staticmethod - def WithResult(message, result): - """ - Return a fatal error object that appends the hex values of - 'result' as a string formatted argument. - """ - message += " (result was %s)" % ", ".join(hex(ord(x)) for x in result) - return FatalError(message) - - -class NotImplementedInROMError(FatalError): - """ - Wrapper class for the error thrown when a particular ESP bootloader function - is not implemented in the ROM bootloader. - """ - def __init__(self, bootloader): - FatalError.__init__(self, "%s ROM does not support this function." % bootloader.CHIP_NAME) - -# "Operation" commands, executable at command line. One function each -# -# Each function takes either two args (<ESPLoader instance>, <args>) or a single <args> -# argument. - - -def load_ram(esp, args): - image = LoadFirmwareImage(esp, args.filename) - - print 'RAM boot...' - for (offset, size, data) in image.segments: - print 'Downloading %d bytes at %08x...' % (size, offset), - sys.stdout.flush() - esp.mem_begin(size, div_roundup(size, esp.ESP_RAM_BLOCK), esp.ESP_RAM_BLOCK, offset) - - seq = 0 - while len(data) > 0: - esp.mem_block(data[0:esp.ESP_RAM_BLOCK], seq) - data = data[esp.ESP_RAM_BLOCK:] - seq += 1 - print 'done!' - - print 'All segments done, executing at %08x' % image.entrypoint - esp.mem_finish(image.entrypoint) - - -def read_mem(esp, args): - print '0x%08x = 0x%08x' % (args.address, esp.read_reg(args.address)) - - -def write_mem(esp, args): - esp.write_reg(args.address, args.value, args.mask, 0) - print 'Wrote %08x, mask %08x to %08x' % (args.value, args.mask, args.address) - - -def dump_mem(esp, args): - f = file(args.filename, 'wb') - for i in xrange(args.size / 4): - d = esp.read_reg(args.address + (i * 4)) - f.write(struct.pack('<I', d)) - if f.tell() % 1024 == 0: - print '\r%d bytes read... (%d %%)' % (f.tell(), - f.tell() * 100 / args.size), - sys.stdout.flush() - print 'Done!' - - -def write_flash(esp, args): - """Write data to flash - """ - flash_mode = {'qio':0, 'qout':1, 'dio':2, 'dout': 3}[args.flash_mode] - flash_size_freq = esp.parse_flash_size_arg(args.flash_size) - flash_size_freq += {'40m':0, '26m':1, '20m':2, '80m': 0xf}[args.flash_freq] - flash_info = struct.pack('BB', flash_mode, flash_size_freq) - - # verify file sizes fit in flash - flash_end = flash_size_bytes(args.flash_size) - for address, argfile in args.addr_filename: - argfile.seek(0,2) # seek to end - if address + argfile.tell() > flash_end: - raise FatalError(("File %s (length %d) at offset %d will not fit in %d bytes of flash. " + - "Use --flash-size argument, or change flashing address.") - % (argfile.name, argfile.tell(), address, flash_end)) - argfile.seek(0) - - for address, argfile in args.addr_filename: - print 'Erasing flash...' - image = argfile.read() - # Update header with flash parameters - if address == 0 and image[0] == '\xe9': - image = image[0:2] + flash_info + image[4:] - calcmd5 = hashlib.md5(image).hexdigest() - uncsize = len(image) - if args.compress: - uncimage = image - image = zlib.compress(uncimage, 9) - blocks = div_roundup(len(image), esp.FLASH_WRITE_SIZE) - esp.flash_defl_begin(len(uncimage),len(image), address) - else: - blocks = div_roundup(len(image), esp.FLASH_WRITE_SIZE) - esp.flash_begin(blocks * esp.FLASH_WRITE_SIZE, address) - argfile.seek(0) # in case we need it again - seq = 0 - written = 0 - t = time.time() - header_block = None - while len(image) > 0: - print '\rWriting at 0x%08x... (%d %%)' % (address + seq * esp.FLASH_WRITE_SIZE, 100 * (seq + 1) / blocks), - sys.stdout.flush() - block = image[0:esp.FLASH_WRITE_SIZE] - if args.compress: - esp.flash_defl_block(block, seq) - else: - # Pad the last block - block = block + '\xff' * (esp.FLASH_WRITE_SIZE - len(block)) - esp.flash_block(block, seq) - image = image[esp.FLASH_WRITE_SIZE:] - seq += 1 - written += len(block) - t = time.time() - t - speed_msg = "" - if args.compress: - if t > 0.0: - speed_msg = " (effective %.1f kbit/s)" % (uncsize / t * 8 / 1000) - print '\rWrote %d bytes (%d compressed) at 0x%08x in %.1f seconds%s...' % (uncsize, written, address, t, speed_msg) - else: - if t > 0.0: - speed_msg = " (%.1f kbit/s)" % (written / t * 8 / 1000) - print '\rWrote %d bytes at 0x%08x in %.1f seconds%s...' % (written, address, t, speed_msg) - res = esp.flash_md5sum(address, uncsize) - if res != calcmd5: - print 'File md5: %s' % calcmd5 - print 'Flash md5: %s' % res - raise FatalError("MD5 of file does not match data in flash!") - else: - print 'Hash of data verified.' - print '\nLeaving...' - if args.flash_mode == 'dio' and esp.CHIP_NAME == "ESP8266": - esp.flash_unlock_dio() - else: - esp.flash_begin(0, 0) - if args.compress: - esp.flash_defl_finish(False) - else: - esp.flash_finish(False) - if args.verify: - print 'Verifying just-written flash...' - verify_flash(esp, args, header_block) - - -def image_info(args): - image = LoadFirmwareImage(args.chip, args.filename) - print('Image version: %d' % image.version) - print('Entry point: %08x' % image.entrypoint) if image.entrypoint != 0 else 'Entry point not set' - print '%d segments' % len(image.segments) - print - idx = 0 - for seg in image.segments: - idx += 1 - print 'Segment %d: %r' % (idx, seg) - calc_checksum = image.calculate_checksum() - print 'Checksum: %02x (%s)' % (image.checksum, - 'valid' if image.checksum == calc_checksum else 'invalid - calculated %02x' % calc_checksum) - - -def make_image(args): - image = ESPFirmwareImage() - if len(args.segfile) == 0: - raise FatalError('No segments specified') - if len(args.segfile) != len(args.segaddr): - raise FatalError('Number of specified files does not match number of specified addresses') - for (seg, addr) in zip(args.segfile, args.segaddr): - data = file(seg, 'rb').read() - image.segments.append(ImageSegment(addr, data)) - image.entrypoint = args.entrypoint - image.save(args.output) - - -def elf2image(args): - e = ELFFile(args.input) - if args.chip == 'auto': # Default to ESP8266 for backwards compatibility - print "Creating image for ESP8266..." - args.chip == 'esp8266' - - if args.chip == 'esp32': - image = ESP32FirmwareImage() - elif args.version == '1': # ESP8266 - image = ESPFirmwareImage() - else: - image = OTAFirmwareImage() - image.entrypoint = e.entrypoint - image.segments = e.sections # ELFSection is a subclass of ImageSegment - image.flash_mode = {'qio':0, 'qout':1, 'dio':2, 'dout': 3}[args.flash_mode] - image.flash_size_freq = image.ROM_LOADER.FLASH_SIZES[args.flash_size] - image.flash_size_freq += {'40m':0, '26m':1, '20m':2, '80m': 0xf}[args.flash_freq] - - if args.output is None: - args.output = image.default_output_name(args.input) - image.save(args.output) - - -def read_mac(esp, args): - mac = esp.read_mac() - print 'MAC: %s' % ':'.join(map(lambda x: '%02x' % x, mac)) - - -def chip_id(esp, args): - chipid = esp.chip_id() - print 'Chip ID: 0x%08x' % chipid - - -def erase_flash(esp, args): - print 'Erasing flash (this may take a while)...' - t = time.time() - esp.erase_flash() - print 'Chip erase completed successfully in %.1fs' % (time.time() - t) - - -def erase_region(esp, args): - print 'Erasing region (may be slow depending on size)...' - t = time.time() - esp.erase_region(args.address, args.size) - print 'Erase completed successfully in %.1f seconds.' % (time.time() - t) - - -def run(esp, args): - esp.run() - - -def flash_id(esp, args): - flash_id = esp.flash_id() - print 'Manufacturer: %02x' % (flash_id & 0xff) - print 'Device: %02x%02x' % ((flash_id >> 8) & 0xff, (flash_id >> 16) & 0xff) - - -def read_flash(esp, args): - if args.no_progress: - flash_progress = None - else: - def flash_progress(progress, length): - msg = '%d (%d %%)' % (progress, progress * 100.0 / length) - padding = '\b' * len(msg) - if progress == length: - padding = '\n' - sys.stdout.write(msg + padding) - sys.stdout.flush() - t = time.time() - data = esp.read_flash(args.address, args.size, flash_progress) - t = time.time() - t - print ('\rRead %d bytes at 0x%x in %.1f seconds (%.1f kbit/s)...' - % (len(data), args.address, t, len(data) / t * 8 / 1000)) - file(args.filename, 'wb').write(data) - - -def verify_flash(esp, args, flash_params=None): - differences = False - for address, argfile in args.addr_filename: - image = argfile.read() - argfile.seek(0) # rewind in case we need it again - if address == 0 and image[0] == '\xe9' and flash_params is not None: - image = image[0:2] + flash_params + image[4:] - image_size = len(image) - print 'Verifying 0x%x (%d) bytes @ 0x%08x in flash against %s...' % (image_size, image_size, address, argfile.name) - # Try digest first, only read if there are differences. - digest = esp.flash_md5sum(address, image_size) - expected_digest = hashlib.md5(image).hexdigest() - if digest == expected_digest: - print '-- verify OK (digest matched)' - continue - else: - differences = True - if getattr(args, 'diff', 'no') != 'yes': - print '-- verify FAILED (digest mismatch)' - continue - - flash = esp.read_flash(address, image_size) - assert flash != image - diff = [i for i in xrange(image_size) if flash[i] != image[i]] - print '-- verify FAILED: %d differences, first @ 0x%08x' % (len(diff), address + diff[0]) - for d in diff: - print ' %08x %02x %02x' % (address + d, ord(flash[d]), ord(image[d])) - if differences: - raise FatalError("Verify failed.") - - -def read_flash_status(esp, args): - print ('Status value: 0x%04x' % esp.read_status(args.bytes)) - - -def write_flash_status(esp, args): - fmt = "0x%%0%dx" % (args.bytes * 2) - args.value = args.value & ((1 << (args.bytes * 8)) - 1) - print (('Initial flash status: ' + fmt) % esp.read_status(args.bytes)) - print (('Setting flash status: ' + fmt) % args.value) - esp.write_status(args.value, args.bytes, args.non_volatile) - print (('After flash status: ' + fmt) % esp.read_status(args.bytes)) - - -def version(args): - print __version__ - - -def wrap_stub(args): - e = ELFFile(args.input) - - stub = { - 'params_start': e.get_symbol_addr('_params_start'), - 'code': e.get_section('.text').data, - 'code_start': e.get_symbol_addr('_code_start'), - 'entry': e.get_symbol_addr(args.entry), - } - try: - stub['data'] = e.get_section('.data').data - stub['data_start'] = e.get_symbol_addr('_data_start') - except ValueError: - pass - # No data section, that's fine - bss_size, bss_start = 0, 0 - try: - bss_start = e.get_symbol_addr('_bss_start') - bss_size = e.get_symbol_addr('_bss_end') - bss_start - except ValueError: - pass - params_len = e.get_symbol_addr('_params_end') - stub['params_start'] - if params_len % 4 != 0: - raise FatalError('Params must be dwords') - stub['num_params'] = params_len / 4 - - # Pad code with NOPs to mod 4. - if len(stub['code']) % 4 != 0: - stub['code'] += (4 - (len(stub['code']) % 4)) * '\0' - - print >>sys.stderr, ( - 'Stub params: %d @ 0x%08x, code: %d @ 0x%08x, bss: %d @ 0x%08x, data: %d @ 0x%08x, entry: %s @ 0x%x' % ( - params_len, stub['params_start'], - len(stub['code']), stub['code_start'], - bss_size, bss_start, - len(stub.get('data', '')), stub.get('data_start', 0), - args.entry, stub['entry'])) - - jstub = dict(stub) - jstub['code'] = hexify(stub['code']) - if 'data' in stub: - jstub['data'] = hexify(stub['data']) - print json.dumps(jstub) - - -def run_stub(esp, args): - esp.run_custom_stub(json.load(open(args.input)), args.params, read_output=True) - -# -# End of operations functions -# - - -def main(): - parser = argparse.ArgumentParser(description='esptool.py v%s - ESP8266 ROM Bootloader Utility' % __version__, prog='esptool') - - parser.add_argument('--chip', '-c', - help='Target chip type', - choices=['auto', 'esp8266', 'esp31', 'esp32'], - default=os.environ.get('ESPTOOL_CHIP', 'auto')) - - parser.add_argument( - '--port', '-p', - help='Serial port device', - default=os.environ.get('ESPTOOL_PORT', ESPLoader.DEFAULT_PORT)) - - parser.add_argument( - '--baud', '-b', - help='Serial port baud rate used when flashing/reading', - type=arg_auto_int, - default=os.environ.get('ESPTOOL_BAUD', ESPLoader.ESP_ROM_BAUD)) - - parser.add_argument( - '--no-stub', - help="Disable launching the flasher stub, only talk to ROM bootloader. Some features will not be available.", - action='store_true') - - subparsers = parser.add_subparsers( - dest='operation', - help='Run esptool {command} -h for additional help') - - parser_load_ram = subparsers.add_parser( - 'load_ram', - help='Download an image to RAM and execute') - parser_load_ram.add_argument('filename', help='Firmware image') - - parser_dump_mem = subparsers.add_parser( - 'dump_mem', - help='Dump arbitrary memory to disk') - parser_dump_mem.add_argument('address', help='Base address', type=arg_auto_int) - parser_dump_mem.add_argument('size', help='Size of region to dump', type=arg_auto_int) - parser_dump_mem.add_argument('filename', help='Name of binary dump') - - parser_read_mem = subparsers.add_parser( - 'read_mem', - help='Read arbitrary memory location') - parser_read_mem.add_argument('address', help='Address to read', type=arg_auto_int) - - parser_write_mem = subparsers.add_parser( - 'write_mem', - help='Read-modify-write to arbitrary memory location') - parser_write_mem.add_argument('address', help='Address to write', type=arg_auto_int) - parser_write_mem.add_argument('value', help='Value', type=arg_auto_int) - parser_write_mem.add_argument('mask', help='Mask of bits to write', type=arg_auto_int) - - def add_spi_flash_subparsers(parent): - """ Add common parser arguments for SPI flash properties """ - parent.add_argument('--flash_freq', '-ff', help='SPI Flash frequency', - choices=['40m', '26m', '20m', '80m'], - default=os.environ.get('ESPTOOL_FF', '40m')) - parent.add_argument('--flash_mode', '-fm', help='SPI Flash mode', - choices=['qio', 'qout', 'dio', 'dout'], - default=os.environ.get('ESPTOOL_FM', 'qio')) - parent.add_argument('--flash_size', '-fs', help='SPI Flash size in MegaBytes (1MB, 2MB, 4MB, 8MB, 16M)' - ' plus ESP8266-only (256KB, 512KB, 2MB-c1, 4MB-c1, 4MB-2)', - action=FlashSizeAction, - default=os.environ.get('ESPTOOL_FS', '1MB')) - parent.add_argument('--ucIsHspi', '-ih', help='Config SPI PORT/PINS (Espressif internal feature)',action='store_true') - parent.add_argument('--ucIsLegacy', '-il', help='Config SPI LEGACY (Espressif internal feature)',action='store_true') - - parser_write_flash = subparsers.add_parser( - 'write_flash', - help='Write a binary blob to flash') - parser_write_flash.add_argument('addr_filename', metavar='<address> <filename>', help='Address followed by binary filename, separated by space', - action=AddrFilenamePairAction) - add_spi_flash_subparsers(parser_write_flash) - parser_write_flash.add_argument('--no-progress', '-p', help='Suppress progress output', action="store_true") - parser_write_flash.add_argument('--verify', help='Verify just-written data (only necessary if very cautious, data is already CRCed', action='store_true') - parser_write_flash.add_argument('--compress', '-z', help='Compress data in transfer',action="store_true") - - subparsers.add_parser( - 'run', - help='Run application code in flash') - - parser_image_info = subparsers.add_parser( - 'image_info', - help='Dump headers from an application image') - parser_image_info.add_argument('filename', help='Image file to parse') - - parser_make_image = subparsers.add_parser( - 'make_image', - help='Create an application image from binary files') - parser_make_image.add_argument('output', help='Output image file') - parser_make_image.add_argument('--segfile', '-f', action='append', help='Segment input file') - parser_make_image.add_argument('--segaddr', '-a', action='append', help='Segment base address', type=arg_auto_int) - parser_make_image.add_argument('--entrypoint', '-e', help='Address of entry point', type=arg_auto_int, default=0) - - parser_elf2image = subparsers.add_parser( - 'elf2image', - help='Create an application image from ELF file') - parser_elf2image.add_argument('input', help='Input ELF file') - parser_elf2image.add_argument('--output', '-o', help='Output filename prefix (for version 1 image), or filename (for version 2 single image)', type=str) - parser_elf2image.add_argument('--version', '-e', help='Output image version', choices=['1','2'], default='1') - add_spi_flash_subparsers(parser_elf2image) - - subparsers.add_parser( - 'read_mac', - help='Read MAC address from OTP ROM') - - subparsers.add_parser( - 'chip_id', - help='Read Chip ID from OTP ROM') - - subparsers.add_parser( - 'flash_id', - help='Read SPI flash manufacturer and device ID') - - parser_read_status = subparsers.add_parser( - 'read_flash_status', - help='Read SPI flash status register') - - parser_read_status.add_argument('--bytes', help='Number of bytes to read (1-3)', type=int, choices=[1,2,3], default=2) - - parser_write_status = subparsers.add_parser( - 'write_flash_status', - help='Write SPI flash status register') - - parser_write_status.add_argument('--non-volatile', help='Write non-volatile bits (use with caution)', action='store_true') - parser_write_status.add_argument('--bytes', help='Number of status bytes to write (1-3)', type=int, choices=[1,2,3], default=2) - parser_write_status.add_argument('value', help='New value', type=arg_auto_int) - - parser_read_flash = subparsers.add_parser( - 'read_flash', - help='Read SPI flash content') - parser_read_flash.add_argument('address', help='Start address', type=arg_auto_int) - parser_read_flash.add_argument('size', help='Size of region to dump', type=arg_auto_int) - parser_read_flash.add_argument('filename', help='Name of binary dump') - parser_read_flash.add_argument('--no-progress', '-p', help='Suppress progress output', action="store_true") - - parser_verify_flash = subparsers.add_parser( - 'verify_flash', - help='Verify a binary blob against flash') - parser_verify_flash.add_argument('addr_filename', help='Address and binary file to verify there, separated by space', - action=AddrFilenamePairAction) - parser_verify_flash.add_argument('--diff', '-d', help='Show differences', - choices=['no', 'yes'], default='no') - - subparsers.add_parser( - 'erase_flash', - help='Perform Chip Erase on SPI flash') - - parser_erase_region = subparsers.add_parser( - 'erase_region', - help='Erase a region of the flash') - parser_erase_region.add_argument('address', help='Start address (must be multiple of 4096)', type=arg_auto_int) - parser_erase_region.add_argument('size', help='Size of region to erase (must be multiple of 4096)', type=arg_auto_int) - - subparsers.add_parser( - 'version', help='Print esptool version') - - parser_wrap_stub = subparsers.add_parser('wrap_stub', help='Wrap stub and output a JSON object') - parser_wrap_stub.add_argument('input') - parser_wrap_stub.add_argument('--entry', default='stub_main') - - parser_run_stub = subparsers.add_parser('run_stub', help='Run stub on a device') - parser_run_stub.add_argument('--entry', default='stub_main') - parser_run_stub.add_argument('input') - parser_run_stub.add_argument('params', nargs='*', type=arg_auto_int) - - # internal sanity check - every operation matches a module function of the same name - for operation in subparsers.choices.keys(): - assert operation in globals(), "%s should be a module function" % operation - - args = parser.parse_args() - - # operation function can take 1 arg (args), 2 args (esp, arg) - # or be a member function of the ESPLoader class. - - operation_func = globals()[args.operation] - operation_args,_,_,_ = inspect.getargspec(operation_func) - if operation_args[0] == 'esp': # operation function takes an ESPLoader connection object - initial_baud = min(ESPLoader.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate - chip_constructor_fun = { - 'auto': ESPLoader.detect_chip, - 'esp8266': ESP8266ROM, - 'esp32': ESP32ROM, - }[args.chip] - esp = chip_constructor_fun(args.port, initial_baud) - - if not args.no_stub and args.operation != 'run_stub': - esp = esp.run_stub() - - if args.baud > initial_baud: - esp.change_baud(args.baud) - # TODO: handle a NotImplementedInROMError - - # override common SPI flash parameter stuff as required - if hasattr(args, "ucIsHspi"): - print "Attaching SPI flash..." - esp.flash_spi_attach(args.ucIsHspi,args.ucIsLegacy) - else: - esp.flash_spi_attach(0, 0) - if hasattr(args, "flash_size"): - print "Configuring flash size..." - esp.flash_set_parameters(flash_size_bytes(args.flash_size)) - - operation_func(esp, args) - else: - operation_func(args) - - -class FlashSizeAction(argparse.Action): - """ Custom flash size parser class to support backwards compatibility with megabit size arguments. - - (At next major relase, remove deprecated sizes and this can become a 'normal' choices= argument again.) - """ - def __init__(self, option_strings, dest, nargs=1, **kwargs): - super(FlashSizeAction, self).__init__(option_strings, dest, nargs, **kwargs) - - def __call__(self, parser, namespace, values, option_string=None): - try: - value = { - '2m': '256KB', - '4m': '512KB', - '8m': '1MB', - '16m': '2MB', - '32m': '4MB', - '16m-c1': '2MB-c1', - '32m-c1': '4MB-c1', - '32m-c2': '4MB-c2' - }[values[0]] - print("WARNING: Flash size arguments in megabits like '%s' are deprecated." % (values[0])) - print("Please use the equivalent size '%s'." % (value)) - print("Megabit arguments may be removed in a future release.") - except KeyError: - value = values[0] - - known_sizes = dict(ESP8266ROM.FLASH_SIZES) - known_sizes.update(ESP32ROM.FLASH_SIZES) - if value not in known_sizes: - raise argparse.ArgumentError(self, '%s is not a known flash size. Known sizes: %s' % (value, ", ".join(known_sizes.keys()))) - setattr(namespace, self.dest, value) - - -class AddrFilenamePairAction(argparse.Action): - """ Custom parser class for the address/filename pairs passed as arguments """ - def __init__(self, option_strings, dest, nargs='+', **kwargs): - super(AddrFilenamePairAction, self).__init__(option_strings, dest, nargs, **kwargs) - - def __call__(self, parser, namespace, values, option_string=None): - # validate pair arguments - pairs = [] - for i in range(0,len(values),2): - try: - address = int(values[i],0) - except ValueError as e: - raise argparse.ArgumentError(self,'Address "%s" must be a number' % values[i]) - try: - argfile = open(values[i + 1], 'rb') - except IOError as e: - raise argparse.ArgumentError(self, e) - except IndexError: - raise argparse.ArgumentError(self,'Must be pairs of an address and the binary filename to write there') - pairs.append((address, argfile)) - setattr(namespace, self.dest, pairs) - -# Binary stub code (see flasher_stub dir for source & details) -ESP8266ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNrFXPt/08aW/1ckJ+RhQjsjydIohF7HCSZw4XMhNCm967YZvaBc2k1c74ayufu3r85LGsk2gb72h4BnNJrHmfP4njNn9D/bi/L9Ynvf2569r8zsvQrqP3Uxe6+VU1BLBfkzun4vr/+q2ftceVC7U/8Tet7m+QSq\ -4XkKPw7rf2yn4S409OuqpFP9mMbi0gmUzhedFjDPsP6rx9UBTiPyNtRsXjdSvfnp9rdR3d9V+Te38ZiGkD/q1iUIzEnTEHlgeZK6XZXCynCwRy/qePbewsv16vKRUAHqJ1D50K2ZvU8D+F0TowyEalFnzWmHKrhT\ -579Ai52nRIkqnG1v0HBEmJrgZcZTi5liamfP86LzuhaGKaGJTCKHLl/t1WsocOTxWV2pmxGDLfhXqc3zkCdYwqIqBc1UU2zafwsjwutlp3qSE2md3Q1pd81TL4T69KnZ2x/s7jFz5cZvaa+XN9nI7wteg1pi07qQ\ -1kuySAzY8/wu/zJ9tojc8ngsv57+i1/QnU5N0ylwMa/f5ZMi7dCwriARW0Bd6sNbukMeYK2BUAj+FsAeN/hCWXWaDmCzkfAF1Hvegvgsh32GSVhoX1M/jee8F8QODV/Ur4yPaMHc5ytgXXhu4PmTsOZUHQopgCF1\ -Vlxc0E9+JXsJ/z552M7rGNlF3gSWxjXCmur3aj2Thgd1bZEzH9EPGBVaVPstl7+Beb+QFvgqMDLQIG4l1dEmUZf9piK+neqoq4BgBihz+wOSHBW2TH/K213TK89rsbEwk5gEqohZZAvFUmY6Wy0SCwwM+w6MsIqR\ -1X1WPy3n1DOx0EWGGw+bXBWyWGFAaZNzA9tvwBNaLzsOpy6QYZBOCSkjNXrYjor6Y8T7SjOTZoaH1+vmV1CDlns/eX69OYLENCKFEgRdB/uwf85O48hK1Ay8zhQyIKCsEAuYPinN+kWfNx1/BB/fre60SpyWlbkM\ -hIizxRVaAzZBRd5fPJLtHk20nVj7Pr1mVtHsCnjKyhy8/tRwv8SAqfcnyFyHb5eUE+sgIGekDg7TzcZS70aNKPCfHnl7h9D861OU7t1j3vXRyk194NJipGpVbsLbNbmQtvn9yi1cuoX6tyH9S4KT/x1/RU4dNEpT\ -LqS63fqlrStTgCZ1k8UVsFetb1Ilapu0Ky6moFnTTofr11+50hDPFqwNCqJkXjNeVvH2Ql0FTFACxfQzIIliZl/qFm16M48H3IV65rF8FcvvFLC6khQUSEGuzp+CUPtirYN2WdoOuKMlpmtQCVvYkFsD39Kwwshx\ -R/hzInzBCABoDVRtObgwL2A8IH+rCbxlxnjj7v3CLbx3CzddFjGqW077ZSOCMi5EBdu2jrkm73ONdTDN7eyjbQVWJnZNfZfqaCaaTd8jDaRtSBjN8mSRDaNTVmtV8A7arNOsPvEYVJbAbwF1amKAioo3C17NVr7a\ -oAQ0cMMXMNSxWM74QJpasdi4yjdkJRD1xNQjKNmsdHgdgECGjAdGvZJ3wx1hqrNfwc50hSEL+nO0xNk88Hsa2OQZryuavCNMDSCBQEi9mGIkjKpxPTBS9AAGAdBEEAUp0x3dLklDPXXL0LydxdkrMpCFLeG5bup/\ -hHpgmd6E/RbD1Dywgxu0TRuSwes5DnH5pXBRiD5PZzNbyYKeCMe/YPVOg0/K1gTlq8iYFc2soP+4NvkGN+yFsAHrf9qdE1pkFoP6DxruvAFF6J2p5z8ATROGCiX038ylehIPjlh1Z8c0fWLc+u0yZDSRpVvHgIoN\ -+hgPeHDRTCZewa1GrdBMsKVF4sgTbuUKDSkKer4Hb8qK9DUr6XaNh+2ukneFTDTZhGePEsfeKeVtsJ5JMmercD+nrZ4G5ZL+Js349EkPL7YgRPa5dNQSWzBy73Xuf828m74YIurFIuouNmyoiPJDRn26a51B56Nj\ -Ue3sgec+IPcddtzavju7Q9tSqq8811StMm8mbwBDtDub8Zs1QYb3duH3zgHTA2xZEbCCSQ+YQC3RVhgRdvb/cXL4mFAfO22brAwQLqx0HXULqZqYAE626zZqNV7GMfJSzQrb7pP/qqtSorQzF5oBFiAsYTtPOl6q\ -t+uMUW+pKfCdV05QA8jYvA3WyJZSANhEg9w41Wgqs7Zfi+hMrfSzPYE0Sj0HMXcKOnC6cD1ua5yCrpoV1NtnUycS004oEnnl2SlndqrzMGKvDAoZrGPUw2JVdyUNjbEgoxvX8Gd5U3iFDcd7TxtYKdKXRY/5V55/\ -0QBRgkpYKAzBzzdN3QlZPQIXiqxOXXi6xXWGuwTjwGEZECTLYKHFFQO7gfGmIwxFTUAiLBjswIKfHliIR5AdcDQ/GUeyFkQMjLT9fZCgcmDxM/kQvKD86KGYAJ/CJ6BUoE8UbbTk+HS45wYv2OeVoVR+yuZ/JdBI\ -GINadnLdkJ+KvG7sq9HkK7QHjsdqvkhWPF9Zr085BkbM9IL9n/KqtRXUccZTlJ6WTKkW7eeDLSydEIZAG4jBdOM8ThDTCeztOqHNEEJ4JhJ66sGLI6wZDewAWAP6NU3QImj7MoC/tVYDr5rMFjt7ndkE9ds9PxPB\ -ZrnCeQfh0lAw4vijHhi1BKpk2HDgjs+qr9bDEGfyGUtXZCwAwmiOitrY8XtLBotpumY+MuE06Tcgti4K5igBuBgYDSjoxHSO96F9EqT0NHWeTt/RI1AiFbdXMcKW6khs+T+xuCFP77N+jt912THrjTqb4TPAeDRW\ -2bYt3Dl8x/Ux6y2dd3oy8ZfNJBVpHN1poOJIGtS9NcR54sZkNLyAoC6XKncKm25bJW2p82/baeuC3EqNEaKQcV/8DyFEXW0qmXXz+GlXLNNieSsBOgJqSRlpmfiksT4Qh0AwuCTO56ekHkE8kRFw9l9QE5M/8zAA\ -ef6SxkPsHoAOfuXEuCLXVngeefgwXLKkwM7Z3lUEwGBExCTqS/F+vqKVoBcerByAFnO9YiXzles4Z8EDesWBo/tKak4ystXSPY+N8Cfw+6gSYAvTYVE2TU/KeYzOk4T94mHn6ZTkFx7VzTropt+DlR7uuMHgQqYd\ -tHG7Zv4xea0tP+PgZg8s6iltWl4xiqRYbaMduJs05LCfFqsGrgZGJwKXy44m7Y4A/CnL8QB6Tb6AYU55kqPWseQf4G7iuYcWVZNcnKGCPYbK58ceNMAY0Tj0YHq56M9cy9IBEgMGhCg1YRafrAJQpyWGQyGb5yZw\ -nhkOLIbBRE4XTpnNYgecAlgl6ZbNQ804almnEeZ49vOS8E657ahtR+9N+bBJdZiqbZ0vuQ/VP1qHCOk+WsW+Pcej9xx9FyWHHYbd87KueSjFnrHQS8binNROkQx6lgL8UB34s23Yu3Ir+L6atOtCcAMHRPGrZVSJ\ -epheLyVGHmBxNP3abe6zD0QxwO2luPCeL+6DOjwcoouy2W+E8dV7FKIYrIq7hxTGw9WXK+AQ6NN2SnhiGSDACid4evkKrBXQN0VUMz2S5qutfYimPvQCOn3C8wsSv4dt/EbFD3hzPoJXBgxXFcs5ybC9y7wHPJeO\ -XDXqc5iq1C1dMzlCgygbuARVkTF6CfHULJj7dzN7hx6y4t5OBLJScNkE2CCwwMmjH6Rnf3TFUgcna4F/9/LvrO7tMXkpgJkK+6/M7mIne2MOYwMpwXM2GE+fgqBF14SiicN+pgmAi1bmGJAAvQ3bokc772A0uzW3\ -m9jr8OAliDvETrBB9AZDlS26YNUbAapGh4eUJAWaiBaoVfzSVcdttAfCSYD04X8DWKmAfzBCkvztProamyB2P3v4e4uNIGi1miqg7PMNwO263qEZDQHWPBVsGz3OvuNztYKMKCqFjL07jpKXUSCemH9OvYCeziuc\ -lavruII6m7ocErTHIZ13YQU/0aJpARSihMEPdqYOrsQu57SmO88TXNPjdkkq/FaWouIvWFPL/ON2/g9780/bQysRBeVPnEY5NvLHXIX6Cbz84A1tjVF3QGreDiZWndoos1/CBoHsE9eiR6WX0RVt8cRXp36U+fiS\ -HxJvk8SV5Gt5FR945P/93ItEMo0H1i98/jV4ItmZhMOuGOIzqtUj9JXRcXqdOAdSo/GYI+tkSccgMaGqgG/yKfcWL5HfBx1Y7B2lROopBdQopUH+eBOq+MEYN3HXdXX7zMY8OvB2WDpzWp/KISMFAjRVkWbCrNRT\ -bmnIZncD2c6BrLBhBDFgzlkkbSr/Lsaiq8FHKkFuTMY8GLcxfaWuqGtggdrIbe6C2+z5h7t0lARCV4aHHBIDaFicn26ghdxEbQAnGzUtNj5Ci7ShxS4HLvOXDG4r64hSs2zzpyw77yybFTgsg7OPxrxa2Cx9A1vo\ -0YtatbBMx88IVsAhvYGz4o8ufi4rRx8H+8klOSb665ZuYgmKyslcrkHDlG8HcBJbAr4Dm9RssmFamENZdi/GlRwcfjr3a/aGcj4TRzGY7+bUQ8YAotXJPuc+5If3YZKNins7eDIQ+tCUeVxU7QgVD9FWvw2fhHAa\ -oE1DY59Xlh8G0mcufcryhZwaj63iaQvNJCKTatCyZTZbpIPZAqy4ojBEVSOLxf1gtth30YamPsE4qia7JKb5Ui5Rh3B7v0wllMcYDZnsAOl951OZ7CA8J0Na8hFV1yd0jcefpl4kAq9YoAycqprGjFOgvWG2TnLF\ -wdGUQ/7Bsh7ZpdAMnvGpuQ9xzayaP5QJnjmROjRCzzjfQh0BNLjYQICwzXlYCW9E2TVd6DCV+YoJGJyAaSbAhDJd8jbqbg/w0kJ81V/bo7QVeygpDDFFLZeMjkwB9w4iOsXc330OS6E0rg/wzzWf3ul/w6BQiqUU\ -35ODzxxokpA9nyPe6pr0ed+gz/1ADDmZcDDnMF7+4eyy4qgBjARaA5Us0q6W8vm076D1VoNHErzsFLdhi4Me6MT5LY8NXoNIoe/gszYpJlDXnKCN1i8JZ1YVvUWJ526G15qgPDRpl1ivuF430C2ZSGxy0hwxhtcE\ -NiuIg+XBJZ2TSGg1jSYTaTngs0c8y6Iwr8TcgXPyRd+TnZw0r5LUGSNdjAI6wyjNPh8pgPOdSH/V8GR+3L7MaB1DTPFPPZcXqAucVBVvIVzLAogm/TaFswLeYEQyPGcV8f+kdcpStI7P8fJCFIGzxkM+dC8k0wo7\ -Bdilx1PeaCBbiW6n8trQ2wqccIIcCd3lT0JvC16HaD4md+FZewwqXPt8FiuOECQ+1ms4xUOsHrNmts+ssmM1O3bBNJrmRGzFg/S3QDHAd+ekOPLg/wmSYKy1OGRrmbsMWdNZbQ43D0lnS+iKkGhruRuYWhPdJ0Bd\ -4YGvDpOY4v06D3FnQEJjcFP11Y27I5dzYGuU9PHlezBZkLqRvAK/RB+L/1PbMO1u2dxieFLT4Vlfx8y2D0GdFkSB4WzbSbjBGHPWf8f/mR0/CBLJ1Ia7EzrvNMpJVOixSC2SumaQHYjbobLG3GMe0AQgp3pg7+ES\ -vmjtpMtOpsnCdJcwxEh/6OoklBY12RBGP4asa/hZT+IL2k707SMZB7hN71Lii2OeGRxgeGeOdK5Llmx8asB2QgnO31PIuqgIWKH63eUUPXtckZYDWGuaBAuQh022Iw3R9VfNhi8kA1GHHily+DOc06cx5QS8r1gS\ -rNeY7ZBzb6sMnDloZVIZFncwtYZDCUJBiO4hagTgYClDXaK8E4va8RgOTsO5NZeJx0ForQObBH488RM6op77cWB3xqE38c3lFbL+8dzGE2seUYwHIDQaWMA5SaIvT2gpqTpuQ8njsZ7YndYNpdTHcZutbvVU5j6p\ -FzT+BTqY+DuwNeHkGyjN+YAPj94SSv42sdeYs/o1yK5Mo/E1vsz7C7DB4JAD7MabNNG5UkFyCZGE9QyqlKBe/CUs/vIYmH8uqSLjR8ipUIv91777ol7WhA6WNWcn2qie9+BrVOrOWDUhgXjXNfHqn0of1oQGBZA3\ -Zi1h1GnnfgKMYS5xByjRWxnF0pniJMbIR5chaYQ0eNnqxTR1JUSn7TFGlstpvH9va7cNYttETlcYX4jKDjj7LXCPvxAJDmnmNh7Io122iJhqiOkyMLHoivVPNty4HDDhmvMG5g5UbDGH1fT4sRaheUS5XRLYdg+a\ -sUEypuO+hOuC5ojGCcTxYmyzmF2K3KCXnt/whaHW6GJgB6Qmp6sT0ROgsg2J2EEb/QPWL0O2j9nkbg2FAPoimItYfcbidR5s9jORPu7CUyIYe/HpX+jFtxsfOJ5p4vgViRuTxB4n7QGEye51xgjbpAPGQJs46oZH\ -A9+lWYm51ehCZ10W+tbln8DlH1RZyhP+QWOuUg19o9A7J0G06RjY53RwG/Hm60xQZNRyAGDOhgMGaBtoAgMeCDkAb1Y848T7uL0EVhMX3NBaDrea43saIuwgO+fIFQG2Dn04pYCMQ9hnQClgQxAyaAka5HJc7ziD\ -W32ndMLZNwrdNNCoJrwIRFoSTv7D7LSfxJbAlNeiOp0LrvkPBlSY9ZDL8CkmZNC5R4OsBpYDeH8TIfjUGJbON86JL8RldbF+IwTJaiGYrpCAzi2KwN9cloWWD5Vp5CJ5AEP57Bvlsqkp9ZATNjaWD2t0it1dQ3fL\ -5ICpXcPeX8Mih9eYaANJihD6qnl86wl1s+gwCSl54hPuU8u1hhCAicFrEAhd87fH+8cB3927zQsn3zJ3IV4N6sgV/1C5sG3a9xKuOBszm+CGafQDdTCk7cYz6ulPwCevWVzkjCNYyVov2ROvKv2fMCUfrmfly+cB\ -uAql/7c/7XrO/iuE4zSdCU8n/BD6Z1SPso90w1SFvAts+x65z7nIAKwwop6FKf0CoAhsV9kdPr2OM4rVmPhlq+AbG1nSTUnxgtgKhZzjGY8aEd59nopVbfJyJAsldi5odu3uDofX4XCwwmR2gJpRx9hmf4qxnd5u\ -aVnBYvpfRAeVv9XSVp9sae98jpL5hY8yGSIhxCxWWdv4L7S25o+3tqxPgmWDe8jJpC3vjMXOtbyDLpF3wbxDN2S8XQ23KA3twMJhgPCGLKFx9l1nGx0LiJrt4jWCWzS9+xDxsdUYACrQNY1l86dNtkDfyC5FSjxH\ -T1KexWvBr9PHrSyJNsasEjYv6EeqW4KxmRsFFge5wctwwJyAL5e22Y4tT0iGwYa3ji+W9oadykw1e3PIF+3s/qCzTcrZJqXrrSGpadKPctoJnW3e8N3PHt7B3JBGDuftxqX6A4z3AYVyWTKPBAHJ5uANlZ+cY801\ -O0RkVWEPt3ckQtvJSkKiKvM2vfUC1hj7wKXnZImeV69hcU8Ga50TqMZ8YVt7XY+ZrJWTIWyTJpCis0c3DtRLcOGXYsIxgeoSPcsPMJoGHGUbSn9o0GULMQcY+CnQgiCQA0eArtQP6hGDh246eYfM4x6ZA9GeZz+1\ -e8Xn9tKTvns2fS2iRaJdMbNAzC6zQmWMgA4BE+GxGuSc0QnV2wHn5m5K3Dd7m0FVnAFa0jHA1BhEsjjmechZg0IxN+t09gZCVj7itmzJ03DqOSK4EhcGPXXdRsGDvrpuQM49PkDrg0RWr6S8VQcg2g4iDDtgULSy\ -E+91Id0KxCdxIxcu0KZFgi72e1ghpwTDq01R5eg7NaYUkvRUJaHJnBPetL4Ys04HJlT64kfBA9FrxgPBxAknOsBAJxeY3/ioFWKD+8vZjx1I0KxjSNJgkG9c55uswgXy7gmsDRhQRW+PMfzWBF3SSBTPMbsxWX43\ -hC2gg6e4CweUWmIz167eymmGOc3icR37pQ2TpX8Ak/XZS61CCEi+NgmbrwGuRQiZixCerUUIEdZM8Uwi9NRqE3TFiQTpOp6auDzVxZiGvrrwWDdfpWhwQgqJXRVP1MaNJy7kiVt2IITI7LAWIR7JZkcrQMIa3Xh4\ -LtoLLfP+MR60TOzm4df0ADTAfoR3HNA51jFfEEVEUEw+nbmWEsq6/JUxukWU8ceyWHa7EnsNGiyfL6mvpPMCBRkcJSang62tEwpfOtYHCZdKDmeWofOsKAMyrx23PTmRyS7Q/7nEvtEVCOxQHXnfiP57/tAjRDY8\ -fgQ5mZiaHcg1HLz4v/eSIuR4/e3gpc/GCm9JbKbZ9IfVG+Oc+Jfp3B86Tv4eBuzxCFyTgQLGINylhhuOa6+z6wEa5LkdoqUVCc8ySUSqPYvmRtpEIFLGYYJi8tCt11jUUgzuh1gR3D8DgYnF/xGFx+xuOY8G77tQ\ -/zSpCjZvJJUaK/XbMwbputXbeKRZundTAQSkO4yjE04eQUDxjri1zdP6Cj0wPFT65GDnHs2J3LDpWw6yrAv4jP68tK2y1Ri/IWWLVxdJQs2Dzz3f3uPjIaIDRi3+Qke0l09Dh6KQoL4iXWvaWvdbltg7Ct4jKNB6\ -3JM/cpX6GxJ1nVUnPBAbJBwefft42h73FHI3vDtrH6/Q7W2kWXsF0KznZjBdkQ9fpEgxV4hQY73wIVztnYO4AOyKfoVfP5I1NViFYR/4Mbohkav4Szg5+yj4ISTFF0kiMf9j/qpIAd9bQJBtn/NHDFAj5M+fgxtG\ -+bSdNNqIsGEb9/o34zY5n85/pYRaDvrt9JIrnANGvNxknTr9z+9Jd4AYNbVwPmvPVjwI1z2I1j0YrXsQr3uQ9B5gwSAGteE1AujLjUMg9YDoneGl4YtOpljgKvjBftPTcF/w8TWsBa6o4pVki19CqYmPoUo6ya8N\ -2Ze0EacEs/kafmcvarJLRNbKdfd7fFQuN8xsL+ZJB/K0W5dkjXMKJn4pB2+23tHveJtBr5oHxLwZXNLM5aZS2L8LgveCfDg+QeRnz74lTVCyjgM2BUQHp1A2uCGjgOpBeJYTA2BB+JLp3V1CfuunSI8E9N5AGj7G\ -eW3m393BZOBK7qYN5LICX6TR30O73Q0zm199x2SCv/DyoD1h1aNMbmBg9kyB+uHiDsPU7Pvn33v47YcRnpzMnw9APeZznllyj793h1QtqQ3S/y5/v6Di5LT8hIIE9A2K5mAb7v7jV/MaM12K11QQqMibKK/c/Ul2\ -8QpL3ModJj6V0FfuhC1TDAkN2htV3Vti0JzNCh9jNG3TeoQp55VY+rSe0xbdNOsf8EPE7LZ/KblarpQUBXpriXM9ukoNdDd8JQl5nm7HwTcS1D0PDvHgYK6ZjOYPTOErRubbrHEPXlR4x6Xs0kzRtesIbwiF8GEL\ -Q/eE8IrXK4Y7OUIzSdZoLrVhMn5GH254amYzjzSACZBQo3O+fI261YiHnBaYH3AX4ORm+00Kcqw9SvtP5cNude/13E+evprN3rx7f9NMBT5A1SesfAVDvt5RNncFec9D9qq0WbFV1C8nUcp2m4P+1xmby2p8lcTw\ -OV9lT+VOGuaTfMNhqqydTwqJhk02jgpJMeBXLLY492O0tclpPE2QYCKfY4OkkmCIgGFXPn3XSXyVljm2nC1kZGxN2rLz3SVpX6xq336frnmHwndY3N7ztgu7sD/8srBz+LaoVkmYBCoIFD+p6wa9L140dwwj53Oj\ -oeOks+0T+JRZULH45Y16AvRzRI+pMnQKmp3BuvCEF4Kx29wpyLXx/guomOf48w3tav1rW3KE+m07BWShlc3kZnNduOab2Pj5qcoprOv3O2KHpTYzEnT6GEkozsz4RzpnrX/d5zR6fDHilz++gnWFI7pfttxGGZdw\ -HA/CApp8eQKmoBkeUSrR9Z9MaeaDUsgVO+OVat3gf2Kh1rgysyxtfmJWb7OM3qdy3LvGDQer7mdMOuVRr9xJNG+/uoJ/vc+z6N7YmLzkfmtDud+qaAuHbsH2PvXT6zPXK76tq3vtde950CuHvXLUK8e9sumV825Z\ -9+ajO+09t9Bp6X6vR18sf7znT/vTt5SDz+Sh23jqNh7rl+NbysktZfPR8uIjpZ8/Uup+/mdVOf9oef4x2bn173PlNv4sGi0+Y939mVe3aIHezHVvJrpHRd3pb8Mt3HULnW47GVVHbuGlW+hsyC89TdObp+2V8165\ -DFdIif4LpfjP1gK/V0v8Xi3ye7XM79VCt5U/80+r9nu+jQQmKHmU5zhqr57zQd2cqcZfJGokbZWNW7vSQQ134fP6LhCOklRFCoBw+fNi/mtTGajY/Pv/ALbA9mA=\ -"""))) -ESP32ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNqNWnlz1MgV/ypjge0ZY9huaUZquTblA3YwhlQwWYyBSWVbLSlma9cF3qmyIWw+e/pd6pZGTuWPAamP16/f8XuH/O/ddXO33j2Y7K7uWjPx/8wP4UnhU368ulP+sdT+tfa/dnXn1IQGjVmt/b/wpB5enNIsrrT/\ -z0oN9BQtkJ9WwoGKnqKfEY6ahZ920ZkVPSs/ptLu7Bke3PG0tcFcckX0+HUKZ1zc9JZMgQbQ1WYCA3O4RqLGb6DUEbHYBP507nnkY4GXpo74dgNZlSWwEA8Y5Onr/VLrfjo8m8Fc6w6JgPxwYj6J1Lwl3KQJ3RL4\ -Npl/XsBljFxmD0ZWd3YhUpf1IKN2XvgpeMlNcpSBSj0R51iCmT+p1cxBLixHgxpWZpfJtn/Ngsjgym179NYv0HS5csG0QaDtPUKEyVr3Jk/6Cj9F4a5hyemJegbjL05Ok7OsTAbCNixIsEnkUg0MFF/K+SNwlUO6\ -r61Y8magEjOP34+O5OmVv4zs0T26hugGVc2B5+OgGL7QJdg/zIN62rMTG2TLK+AiuVJr0KVbrf2CpqEF1ZgsrSFVWXiGXeB6JZta6Scqy06hmXk27YZNu9sIPlDGpl0hLuDakvdZRIu7MgV34zP4BzfWnr4rgQT9\ -YKwj59LLaEdFEg73SF/wbEQbeU757OgcU4ARHQ7FILfU4ZY1yWuXeNfAf04QpNR3v9QQMZiAS/rJ9abndmg1cH0w4/lSyN2PErPAW512QAjQB/yk8UaRkaqyC68B8LGceK5zhsha9UzgPZ3fR559kmMHd3SMZbXY\ -mvagGFNyWsvzdcUuzabSRM7VrXFLhpSBoExMhImLo7f5/yBY85r55hq6GF3jIGVcSsOZQEPedZVw7EHumQO0zJ54RCg2Egpajh3hEYUF7pBNmhBnN7bm97Eex095voxfvB3W4KQLjzO1eQJX9E+li4YB0UCo/iXf\ -2qLTATkFYtsRxsWWz4Ps6S6vn3pqVU3w7upgnGMq8jHnun8e7fRMOYhPuC8b7jvD4OLUxd9JYjYCnCqiBX5nLUuwGRF+BD6I6pXs2RZ2H0NEElknoBQ3lPxVLO3P8cs6frkbKEX3AvS/0J0oerJvAZ9X7GVbNmA9\ -ykQCsm0Zd8wLNl64R1GJEPZX1+DC5kbW3aOIgB7PEZrJg/MfIyvN+xgTdntzdwiE55LenNFSbX3MNiWlDCb/IYJd5N8Lq8zIyDVjvzFEtQMR9eIec3LlyC0ceZmLcJqwsEwxffkHPDtegeKqIl/nUyo+BZIcSddE\ -Apvm6dSmeZ7denCo/K+eH4PXwYrXnolCLvsMUo/5c38F64hwlxiJMnLRMAnFxVlNPqICSXU8cfCCh5iH/h4RVCFJ1lVEmCVe5T9xSoae8J1dC/FT0XYIdyAYf7Ob1fUH/wBpTvpS4PHt5lXAHcFG24YEAnGyqnd+\ -Ssj7LELyL3D6hFwC/ZVZtvm4z1o95rOsMEx99gFWUDv6PuB8s0MbUR72HbHH97/m4bJYdGNrThIsu27xCSx0STCKETMPCVSMECgKSbrV68eIwBQjjkkV6DlSDIBO9PzD5cHb16vVMWcUiqsKl8uih+98udIWHqiq\ -drPSsEhkAvKfQBjJJveHQOMOEo4289nPU9i492AG/03nVE2VwxBn+vXZESMfJlP28PQhBxlETLgsiFltE7B03qSZJTdk6S+d/FPC9YZzR9ySclDmpBrgRfP/MA/6r1yElGlUb2Vj6a0RxU56qdJVFCNaiS1bwZ9a\ -NWKc6gFVTeMJQcdPI/YFzBv143E57YqVmTlIJvvH7IfZ7BSYAbhQ5aXoaQHxqZQMe/TMjQrwb6fHLyDuUylB0lwf8THDckaqyV7ByABrejnHUS8B2Q1vclLIt7GwUTgMTw0Hvd/20EhMylbj3D4+vaL/AO4XbGUY\ -IeQF6sqS7E+Rjnz+ctmFz1dkK7hUz4lWzsAPNVRTwNW0PMxIPSiNOUxLAZr3a2v6QbBNXyZFSqEYDNJpMB33kmDIoQlaxqNmi1O4huqsuo0aFm5vB/790FnfJw59WtAsNrItStVasCOwTQyLoZxNPfJhZc9jaSWm\ -d75proR0YFGVZYCo681lwHHFZuuiorrWU7aQaJBoNsKdBB8zErEspGTNG4iSj/y1HL5qkd3BTa8xA2VUPuzN4DD5STdahlFd3ADCqhvO4XV6vlrjkC7PW4rHupAMP5NlmHaAQ+nP2aR9ChybpFdBZ+X5Zo6O6NJs\ -liCOs1HgyFRkHoLZZvxwjgJQOVU5Z0oGQBfKHijbdNE/H1HP9msHyHjtyLiLc7Aev0uxzE5g3NfJChIWhoMc195mJU2W8aTJf6VJz+Ki7XYg/kFm6QPme3xGpECPL9kWaWdnmP6aHd3lRxjmlMq/urCq7p/+UYoT\ -XqJdf/5xx52i9EH3r5bKvD/lidDC1oHUkrog6etaRtIeha14seLFdPhFYFtnFK8r85ijYYZRz+WvSDyUCHNBWrE1ufxBaICSS337A2u56+WWRCBIKY9Jw2aj5rmgFEGB0ddgr7iH01LjnhIBagBfXIJ9HPzKGJhF\ -ByhqMeEZxcgZFivLz+iUX+5ggaJszqmiAMQ9+LYckBSei3a0SvRZ1ibL0sNollnfdlTRSXB5gJa9GFlAZc6ywAVdzd+G+geyrVKMLZemRNjpZ2vRzDBKDMhYFSt/uR3FSf00ZASK/HodGZHLb1lpSGpPMpfEvOf2\ -jqG4bzh7dtzm6voxAIlQZyEYcf9LFjRt12H6RlABSC9Vka782RW2nBSqepcSmK4rsuD1KddlaTBaYUdrQZOCaFkbvgxQc0gJuqlbTvLU7eQzNbpc3F3SQUol5m3ZkvyIhPllDyTZyY35KVhi7hSOKWTaQKeJ3Mik\ -zxHZ37GpLwQ8ILEqOPcEdZsiNqHgyi6uJHFs4MGm6m/EY8ymPa5pyrSDhAOX7JwCbnWajTworOHZfou9a04UE2rHblOLFONKaOuOxolPwyBxQVeuTRQkREEIXB1A3sL6aqf4yMj/V3S0D6F2Q/DVRRMjqYaSywFW\ -St5p9Y6k80+G2DBNYPjxJmS4zvomX46/cYJTVeQABLiwc3ZP1zDj5q3eHut8nfWTYovfQFJwhYRTEfkqUps3FIStlB5QZcfFMUX/tB/9gVGN3bBq0vdb2OIqcngM7nNJUw/jwJ1FvpiyY2l2rI4aJFgF1wxYjZDx\ -6UauZiEkYVcYbBbNIIVcVd1YGmoU5kUzOwVAc+VqN9TQSA88uOYuG3ivXdxxOQbup7eIVZSw4RWc02K9xXoqubZzkk05SlThaq2McW9EFZsa8yh9De61Dbj5hVwV+imWRQ3GUpUwC3JyiqEbYBv0Zg2jqisnZFWw\ -qQKm8kmgAGZc84eHqIdQ896WgKXhRhNUbBT4JlRWgftJ10vEhpZTxRKbEV/OPac2EJW9HRRM8cvdCTtyTkqg7IPgThoV1NKVerKY/QzDmIpdQLrTECG42TwJgLkJKTJZAgV/CGbo0+SCineXxc42lnLyeLE5rhgi\ -0brZfLpW+JCGGI8iwZZyLoznz4DIXWJSyKKxE8LRsprD9+jaLp8NHBrS/QpBbUGHi9hiwCW3n4vPk/MvpIWVEqhaF1V6mZQlwGlBbCLcLwR5e0CyuMEDTNoEKzB8yxZzS/RxxP2vV/RWm0flNAQmPMZky+8RnHaX\ -c+aEEaqB+NQiorugraoZ0Qp+Cv+T6kYjV/iPdJ2SEOI6cHO/c15D1QIkAQWpifz7F7BULj8Rzpp+Mwg3u/w31GIaVWJfg0gppt7ILcl6E0IHNH00sK4Pg26WhDCHAT7D73iGIzm3n/A7SSl/WgDel30nV6d2yw67\ -mNmBjtli2e8odzle/OVKTR9QwVAaSOddMmOR52z08QYnSzktcYx05cZ3CYREuYGRGyDtJJxOG76TZOhld3+yW9u1/ecfa3sDfw2iVZEtFnlmFM/QX4hI5wbWw9+NxOvnWabzufEzzfX65ms3mKl0/ud/AYyHY9Q=\ -"""))) - -if __name__ == '__main__': - try: - main() - except FatalError as e: - print '\nA fatal error occurred: %s' % e - sys.exit(2) diff --git a/src/common/platforms/esp/slip.c b/src/common/platforms/esp/slip.c deleted file mode 100644 index 13b980e9828d305d18d7d3f701dbbe4736edfb7e..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp/slip.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "rom_functions.h" - -void SLIP_send(uint8_t *pkt, uint32_t size) { - send_packet(pkt, size); -} - -uint32_t SLIP_recv(void *pkt, uint32_t max_len) { - uint8_t c; - uint32_t len = 0; - uint8_t *p = (uint8_t *) pkt; - do { - c = uart_rx_one_char_block(); - } while (c != '\xc0'); - while (len < max_len) { - c = uart_rx_one_char_block(); - if (c == '\xc0') return len; - if (c == '\xdb') { - c = uart_rx_one_char_block(); - if (c == '\xdc') { - c = '\xc0'; - } else if (c == '\xdd') { - c = '\xdb'; - } else { - len = 0; - break; /* Bad esc sequence. */ - } - } - *p++ = c; - len++; - } - do { - c = uart_rx_one_char_block(); - } while (c != '\xc0'); - return len; -} diff --git a/src/common/platforms/esp/slip.h b/src/common/platforms/esp/slip.h deleted file mode 100644 index 53100a0eb89a6fc4ad5b7585af8ad54fea1cdb60..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp/slip.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CS_COMMON_PLATFORMS_ESP8266_STUBS_SLIP_H_ -#define CS_COMMON_PLATFORMS_ESP8266_STUBS_SLIP_H_ - -#include <inttypes.h> - -void SLIP_send(const void *pkt, uint32_t size); -uint32_t SLIP_recv(void *pkt, uint32_t max_len); - -#endif /* CS_COMMON_PLATFORMS_ESP8266_STUBS_SLIP_H_ */ diff --git a/src/common/platforms/esp/stub_flasher.c b/src/common/platforms/esp/stub_flasher.c deleted file mode 100644 index 51f1ffa71d84eafbcef94166e4baee87c9e3f3b6..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp/stub_flasher.c +++ /dev/null @@ -1,579 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "stub_flasher.h" - -#include <stdint.h> -#include <string.h> - -#include "rom_functions.h" - -#if defined(ESP8266) -#include "eagle_soc.h" -#include "ets_sys.h" -#include "miniz.c" -#elif defined(ESP32) -#include "rom/efuse.h" -#include "rom/miniz.h" -#include "rom/spi_flash.h" -#include "soc/uart_reg.h" -#include "led.h" -#endif - -#include "slip.h" -#include "uart.h" - -/* Param: baud rate. */ -uint32_t params[2] __attribute__((section(".params"))); - -#define FLASH_BLOCK_SIZE 65536 -#define FLASH_SECTOR_SIZE 4096 -#define FLASH_PAGE_SIZE 256 - -/* These consts should be in sync with flasher_client.go */ -#define NUM_BUFS 4 -#define BUF_SIZE 4096 -#define FLASH_WRITE_SIZE BUF_SIZE - -#define UART_RX_INTS (UART_RXFIFO_FULL_INT_ENA | UART_RXFIFO_TOUT_INT_ENA) - -extern uint32_t _bss_start, _bss_end; - -#ifdef ESP8266 -#define REG_SPI_BASE(i) (0x60000200 - i * 0x100) - -#define SPI_CMD_REG(i) (REG_SPI_BASE(i) + 0x0) -#define SPI_FLASH_WREN (BIT(30)) -#define SPI_FLASH_RDID (BIT(28)) -#define SPI_FLASH_SE (BIT(24)) -#define SPI_FLASH_BE (BIT(23)) - -#define SPI_ADDR_REG(i) (REG_SPI_BASE(i) + 0x4) - -#define SPI_USER_REG(i) (REG_SPI_BASE(i) + 0x1C) - -#define SPI_W0_REG(i) (REG_SPI_BASE(i) + 0x40) -#endif - -enum read_state { - READ_WAIT_START = 0, - READ_FLAGS, - READ_DATA, - READ_UNESCAPE, - READ_ERROR, -}; - -struct data_buf { - uint32_t len; - uint8_t data[BUF_SIZE]; - uint8_t flags; -}; - -#define FLAG_COMPRESSED 1 - -struct uart_buf { - enum read_state state; - struct data_buf bufs[NUM_BUFS]; - uint32_t bri, bwi; - uint32_t ps; -}; - -static inline uint32_t ccount(void) { - uint32_t r; - __asm volatile("rsr.ccount %0" : "=a"(r)); - return r; -} - -struct write_progress { - uint32_t num_written; - uint32_t buf_level; - uint8_t digest[16]; -}; - -struct write_result { - uint32_t wait_time; - uint32_t decomp_time; - uint32_t write_time; - uint32_t erase_time; - uint32_t total_time; - uint8_t digest[16]; -}; - -static struct uart_buf ub; -static uint32_t inflate_buf[TINFL_LZ_DICT_SIZE / sizeof(uint32_t)]; - -static void next_write_buf(void) { - ub.bwi++; - if (ub.bwi == NUM_BUFS) ub.bwi = 0; - ub.bufs[ub.bwi].len = 0; - ub.bufs[ub.bwi].flags = 0; -} - -static void add_byte(uint8_t byte) { - struct data_buf *buf = &ub.bufs[ub.bwi]; - if (buf->len < BUF_SIZE) { - buf->data[buf->len++] = byte; - ub.ps++; - } -} - -void uart_isr(void *arg) { - uint32_t int_st = READ_PERI_REG(UART_INT_ST_REG(0)); - uint8_t fifo_len, i; - while ((fifo_len = READ_PERI_REG(UART_STATUS_REG(0))) > 0) { - for (i = 0; i < fifo_len; i++) { - uint8_t byte = READ_PERI_REG(UART_FIFO_REG(0)); - switch (ub.state) { - case READ_WAIT_START: { - if (byte == 0xc0) { - ub.state = READ_FLAGS; - ub.ps = 0; - } - break; - } - case READ_FLAGS: - case READ_DATA: { - struct data_buf *buf = &ub.bufs[ub.bwi]; - if (byte == 0xdb) { - ub.state = READ_UNESCAPE; - } else if (byte == 0xc0) { - next_write_buf(); - if (ub.ps == 0) { - /* Empty packet, sender aborted. */ - ub.state = READ_ERROR; - SET_PERI_REG_MASK(UART_INT_ENA_REG(0), 0); - goto out; - } else { - ub.state = READ_WAIT_START; - } - } else { - if (ub.state == READ_FLAGS) { - buf->flags = byte; - ub.state = READ_DATA; - } else { - add_byte(byte); - } - } - break; - } - case READ_UNESCAPE: { - if (byte == 0xdc) { - byte = 0xc0; - } else if (byte == 0xdd) { - byte = 0xdb; - } else { - ub.state = READ_ERROR; - SET_PERI_REG_MASK(UART_INT_ENA_REG(0), 0); - goto out; - } - add_byte(byte); - ub.state = READ_DATA; - break; - } - case READ_ERROR: { - goto out; - } - } - } - } -out: - WRITE_PERI_REG(UART_INT_CLR_REG(0), int_st); - (void) arg; -} - -size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, - const void *pSrc_buf, size_t src_buf_len, - int flags); -#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) -#define TINFL_FLAG_PARSE_ZLIB_HEADER 1 - -#if defined(ESP8266) -int esp_rom_spiflash_erase_start(uint32_t addr, uint32_t cmd) { - SPI_write_enable(flashchip); - WRITE_PERI_REG(SPI_ADDR_REG(0), addr); - WRITE_PERI_REG(SPI_CMD_REG(0), cmd); - while (READ_PERI_REG(SPI_CMD_REG(0)) & cmd) { - } - return 0; -} -#elif defined(ESP32) -extern esp_rom_spiflash_chip_t g_rom_spiflash_chip; - -esp_rom_spiflash_result_t esp_rom_spiflash_erase_start(uint32_t addr, - uint32_t cmd) { - esp_rom_spiflash_chip_t *spi = &g_rom_spiflash_chip; - esp_rom_spiflash_wait_idle(spi); - - REG_CLR_BIT(PERIPHS_SPI_FLASH_USRREG, SPI_USR_DUMMY); - REG_SET_FIELD(PERIPHS_SPI_FLASH_USRREG1, SPI_USR_ADDR_BITLEN, - ESP_ROM_SPIFLASH_W_SIO_ADDR_BITSLEN); - - WRITE_PERI_REG(PERIPHS_SPI_FLASH_CMD, SPI_FLASH_WREN); - while (READ_PERI_REG(PERIPHS_SPI_FLASH_CMD) != 0) { - } - - WRITE_PERI_REG(PERIPHS_SPI_FLASH_ADDR, addr); - WRITE_PERI_REG(PERIPHS_SPI_FLASH_CMD, cmd); - - return ESP_ROM_SPIFLASH_RESULT_OK; -} -#endif - -int do_flash_write(uint32_t addr, uint32_t len, uint32_t erase) { - int ret = 0; - uint32_t num_erased = 0; - struct MD5Context ctx; - MD5Init(&ctx); - - if (addr % FLASH_SECTOR_SIZE != 0) return 0x32; - if (len % FLASH_SECTOR_SIZE != 0) return 0x33; - if (esp_rom_spiflash_unlock() != 0) return 0x34; - - memset(&ub, 0, sizeof(ub)); - memset(&inflate_buf, 0, sizeof(inflate_buf)); - ets_isr_attach(ETS_UART0_INUM, uart_isr, &ub); - uint32_t saved_conf1 = READ_PERI_REG(UART_CONF1_REG(0)); - /* Reduce frequency of UART interrupts */ - WRITE_PERI_REG(UART_CONF1_REG(0), UART_RX_TOUT_EN | - (20 << UART_RX_TOUT_THRHD_S) | - (100 << UART_RXFIFO_FULL_THRHD_S)); - SET_PERI_REG_MASK(UART_INT_ENA_REG(0), UART_RX_INTS); - ets_isr_unmask(1 << ETS_UART0_INUM); - - struct write_result wr; - memset(&wr, 0, sizeof(wr)); - - struct write_progress wp = {.num_written = 0, .buf_level = 0}; - wp.buf_level = (uint32_t) &addr; - SLIP_send(&wp, sizeof(wp)); - wr.total_time = ccount(); - while (wp.num_written < len) { - /* Prepare the space ahead. */ - uint32_t start_count = ccount(); - while (erase && num_erased < wp.num_written + FLASH_WRITE_SIZE) { - const uint32_t num_left = (len - num_erased); - if (num_left >= FLASH_BLOCK_SIZE && addr % FLASH_BLOCK_SIZE == 0) { - if (esp_rom_spiflash_erase_start(addr, SPI_FLASH_BE) != 0) { - ret = 0x35; - goto out; - } - num_erased += FLASH_BLOCK_SIZE; - } else { - /* len % FLASH_SECTOR_SIZE == 0 is enforced, no further checks needed */ - if (esp_rom_spiflash_erase_start(addr, SPI_FLASH_SE) != 0) { - ret = 0x36; - goto out; - } - num_erased += FLASH_SECTOR_SIZE; - } - } - wr.erase_time += ccount() - start_count; - start_count = ccount(); - /* Wait for data to arrive. */ - wp.buf_level = 0; - for (int i = 0; i < NUM_BUFS; i++) wp.buf_level += ub.bufs[i].len; - volatile uint32_t *bwi = &ub.bwi; - while (*bwi == ub.bri && ub.state != READ_ERROR) { - } - struct data_buf *buf = &ub.bufs[ub.bri]; - if (ub.state == READ_ERROR) { - ret = 0x37; - goto out; - } - wr.wait_time += ccount() - start_count; - start_count = ccount(); - uint32_t *data = (uint32_t *) buf->data; - uint32_t write_len = buf->len; - if (buf->flags & FLAG_COMPRESSED) { - data = inflate_buf; - write_len = tinfl_decompress_mem_to_mem( - &inflate_buf[0], sizeof(inflate_buf), buf->data, write_len, - TINFL_FLAG_PARSE_ZLIB_HEADER); - if (write_len == TINFL_DECOMPRESS_MEM_TO_MEM_FAILED) { - ret = 0x40; - goto out; - } - } - wr.decomp_time += ccount() - start_count; - MD5Update(&ctx, (uint8_t *) data, write_len); - start_count = ccount(); - wr.erase_time += ccount() - start_count; - start_count = ccount(); - if (esp_rom_spiflash_write(addr, data, write_len) != 0) { - ret = 0x38; - goto out; - } - wr.write_time += ccount() - start_count; - buf->len = 0; - ub.bri++; - if (ub.bri == NUM_BUFS) ub.bri = 0; - addr += write_len; - wp.num_written += write_len; - struct MD5Context ctx2; - memcpy(&ctx2, &ctx, sizeof(ctx)); - MD5Final(wp.digest, &ctx2); - SLIP_send(&wp, sizeof(wp)); - } - - MD5Final(wr.digest, &ctx); - - wr.total_time = ccount() - wr.total_time; - SLIP_send(&wr, sizeof(wr)); - -out: - WRITE_PERI_REG(UART_CONF1_REG(0), saved_conf1); - ets_isr_mask(1 << ETS_UART0_INUM); - return ret; -} - -int do_flash_read(uint32_t addr, uint32_t len, uint32_t block_size, - uint32_t max_in_flight) { - uint8_t buf[FLASH_SECTOR_SIZE]; - uint8_t digest[16]; - struct MD5Context ctx; - uint32_t num_sent = 0, num_acked = 0; - if (block_size > sizeof(buf)) return 0x52; - MD5Init(&ctx); - while (num_acked < len) { - while (num_sent < len && num_sent - num_acked < max_in_flight) { - uint32_t n = len - num_sent; - if (n > block_size) n = block_size; - if (esp_rom_spiflash_read(addr, (uint32_t *) buf, n) != 0) return 0x53; - send_packet(buf, n); - MD5Update(&ctx, buf, n); - addr += n; - num_sent += n; - } - { - if (SLIP_recv(&num_acked, sizeof(num_acked)) != 4) return 0x54; - if (num_acked > num_sent) return 0x55; - } - } - MD5Final(digest, &ctx); - send_packet(digest, sizeof(digest)); - return 0; -} - -int do_flash_digest(uint32_t addr, uint32_t len, uint32_t digest_block_size) { - uint8_t buf[FLASH_SECTOR_SIZE]; - uint8_t digest[16]; - uint32_t read_block_size = - digest_block_size ? digest_block_size : sizeof(buf); - struct MD5Context ctx; - if (digest_block_size > sizeof(buf)) return 0x62; - MD5Init(&ctx); - while (len > 0) { - uint32_t n = len; - struct MD5Context block_ctx; - MD5Init(&block_ctx); - if (n > read_block_size) n = read_block_size; - if (esp_rom_spiflash_read(addr, (uint32_t *) buf, n) != 0) return 0x63; - MD5Update(&ctx, buf, n); - if (digest_block_size > 0) { - MD5Update(&block_ctx, buf, n); - MD5Final(digest, &block_ctx); - send_packet(digest, sizeof(digest)); - } - addr += n; - len -= n; - } - MD5Final(digest, &ctx); - send_packet(digest, sizeof(digest)); - return 0; -} - -int do_flash_read_chip_id(void) { - uint32_t chip_id = 0; - WRITE_PERI_REG(SPI_CMD_REG(0), SPI_FLASH_RDID); - while (READ_PERI_REG(SPI_CMD_REG(0)) & SPI_FLASH_RDID) { - } - chip_id = READ_PERI_REG(SPI_W0_REG(0)) & 0xFFFFFF; - send_packet((uint8_t *) &chip_id, sizeof(chip_id)); - return 0; -} - -uint8_t cmd_loop(void) { - uint8_t cmd = 0x55; - do { - /* Reset FIFO to re-sync */ - SET_PERI_REG_MASK(UART_CONF0_REG(0), UART_RXFIFO_RST); - CLEAR_PERI_REG_MASK(UART_CONF0_REG(0), UART_RXFIFO_RST); - uint32_t args[4]; - uint32_t len = SLIP_recv(&cmd, 1); - if (len != 1) { - continue; - } - uint8_t resp = 0xff; - switch (cmd) { - case CMD_FLASH_WRITE: { - len = SLIP_recv(args, sizeof(args)); - if (len == 12) { - resp = do_flash_write(args[0] /* addr */, args[1] /* len */, - args[2] /* erase */); - } else { - resp = 0x41; - } - break; - } - case CMD_FLASH_READ: { - len = SLIP_recv(args, sizeof(args)); - if (len == 16) { - resp = do_flash_read(args[0] /* addr */, args[1], /* len */ - args[2] /* block_size */, - args[3] /* max_in_flight */); - } else { - resp = 0x51; - } - break; - } - case CMD_FLASH_DIGEST: { - len = SLIP_recv(args, sizeof(args)); - if (len == 12) { - resp = do_flash_digest(args[0] /* addr */, args[1], /* len */ - args[2] /* digest_block_size */); - } else { - resp = 0x61; - } - break; - } - case CMD_FLASH_READ_CHIP_ID: { - resp = do_flash_read_chip_id(); - break; - } - case CMD_FLASH_ERASE_CHIP: { - resp = esp_rom_spiflash_erase_chip(); - break; - } - case CMD_BOOT_FW: - case CMD_REBOOT: { - resp = 0; - SLIP_send(&resp, 1); - return cmd; - } - case CMD_ECHO: { - len = SLIP_recv(args, sizeof(args)); - SLIP_send(args, len); - resp = 0; - break; - } - case CMD_READ_REG: { - len = SLIP_recv(args, sizeof(args)); - if (len == 4) { - uint32_t value = READ_PERI_REG((uint32_t *) args[0]); - SLIP_send(&value, sizeof(value)); - resp = 0; - } else { - resp = 0x91; - } - break; - } - case CMD_WRITE_REG: { - len = SLIP_recv(args, sizeof(args)); - if (len == 8) { - WRITE_PERI_REG((uint32_t *) args[0], args[1]); - resp = 0; - } else { - resp = 0xa1; - } - break; - } - } - SLIP_send(&resp, 1); - } while (cmd != CMD_BOOT_FW && cmd != CMD_REBOOT); - return cmd; -} - -void stub_main1(void) { - uint32_t old_baud_rate = params[0], new_baud_rate = params[1]; - uint8_t last_cmd; - - /* This points at us right now, reset for next boot. */ - ets_set_user_start(0); - -/* Selects SPI functions for flash pins. */ -#if defined(ESP8266) - SelectSpiFunction(); - spi_flash_attach(); - SET_PERI_REG_MASK(0x3FF00014, 1); /* Switch to 160 MHz */ -#elif defined(ESP32) - esp_rom_spiflash_attach(ets_efuse_get_spiconfig(), 0 /* legacy */); -#endif - - esp_rom_spiflash_config_param( - 0 /* deviceId */, 16 * 1024 * 1024 /* chip_size */, FLASH_BLOCK_SIZE, - FLASH_SECTOR_SIZE, FLASH_PAGE_SIZE, 0xffff /* status_mask */); - - uint32_t old_div = 0; - if (new_baud_rate > 0) { - ets_delay_us(10000); - old_div = set_baud_rate(0, old_baud_rate, new_baud_rate); - } - - /* Give host time to get ready too. */ - ets_delay_us(50000); - -#ifdef BAUD_TEST - while (1) { - WRITE_PERI_REG(UART_FIFO_REG(0), 0x55); - } -#else - SLIP_send(&old_div, 4); -#endif - - last_cmd = cmd_loop(); - - ets_delay_us(10000); - - if (last_cmd == CMD_BOOT_FW) { -#if defined(ESP8266) - /* - * Find the return address in our own stack and change it. - * "flash_finish" it gets to the same point, except it doesn't need to - * patch up its RA: it returns from UartDwnLdProc, then from f_400011ac, - * then jumps to 0x4000108a, then checks strapping bits again (which will - * not have changed), and then proceeds to 0x400010a8. - */ - volatile uint32_t *sp = &old_baud_rate; - while (*sp != (uint32_t) 0x40001100) sp++; - *sp = 0x400010a8; - /* - * The following dummy asm fragment acts as a barrier, to make sure function - * epilogue, including return address loading, is added after our stack - * patching. - */ - __asm volatile("nop.n"); - return; /* To 0x400010a8 */ -#elif defined(ESP32) -/* TODO(rojer) */ -#endif - } else { - software_reset(); - } - /* Not reached */ -} - -/* miniz requires at least 12K of stack */ -uint32_t stack[3071]; -uint32_t stack_end; - -void stub_main(void) { - memset(&_bss_start, 0, (&_bss_end - &_bss_start)); - __asm volatile("movi a1, stack_end\n"); - stub_main1(); - // Keep the stack vars alive. - stack[0] = stack_end = 0xff; -} diff --git a/src/common/platforms/esp/stub_flasher.h b/src/common/platforms/esp/stub_flasher.h deleted file mode 100644 index dd1f948b0c17f4de777392aca114da095c8ab076..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp/stub_flasher.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef CS_COMMON_PLATFORMS_ESP8266_STUBS_STUB_FLASHER_H_ -#define CS_COMMON_PLATFORMS_ESP8266_STUBS_STUB_FLASHER_H_ - -enum stub_cmd { - /* - * Write to the SPI flash. - * - * Args: addr, len, erase; addr and len must be SECTOR_SIZE-aligned. - * If erase != 0, perform erase before writing. - * Input: Stream of data to be written, note: no SLIP encapsulation here. - * Output: SLIP packets with number of bytes written after every write. - * This can (and should) be used for flow control. Flasher will - * write in 1K chunks but will buffer up to 4K of data - * Use this feedback to keep buffer above 1K but below 4K. - * Final packet will contain MD5 digest of the data written. - */ - CMD_FLASH_WRITE = 1, - - /* - * Read from the SPI flash. - * - * Args: addr, len, block_size; no alignment requirements, block_size <= 4K. - * Input: None. - * Output: Packets of up to block_size with data. An acknowledgement is - *expected - * after every packet, in the form of a packet with total number of - * bytes received so far. - * Last packet is the MD5 digest of the data sent. - * - * Note: No flow control is performed, it is assumed that the host can cope - * with the inbound stream. - */ - CMD_FLASH_READ = 2, - - /* - * Compute MD5 digest of the specified flash region. - * - * Args: addr, len, digest_block_size; no alignment requirements. - * Input: None. - * Output: If block digests are not enabled (digest_block_size == 0), - * only overall digest is produced. - * Otherwise, there will be a separate digest for each block, - * the remainder (if any) and the overall digest at the end. - */ - CMD_FLASH_DIGEST = 3, - - /* - * Read flash chip ID. - * This is the JEDEC ID, containinf manufactirer, SPI mode and capacity. - * - * Args: None. - * Input: None. - * Output: 32 bit chip id (only 24 bits are meaningful). - */ - CMD_FLASH_READ_CHIP_ID = 4, - - /* - * Zap the whole chip at once. - * - * Args: None. - * Input: None. - * Output: None. - */ - CMD_FLASH_ERASE_CHIP = 5, - - /* - * Boots the firmware from flash. - * - * Args: None. - * Input: None. - * Output: None. - */ - CMD_BOOT_FW = 6, - - /* - * Reboot the CPU. - * Since strapping settings are not reset, this will reboot into whatever mode - * got us here, most likely UART loader. - * - * Args: None. - * Input: None. - * Output: None. - */ - CMD_REBOOT = 7, - - /* - * Echo the arguments back to the host. - * - * Args: variable. - * Input: None. - * Output: arguments. - */ - CMD_ECHO = 8, - - /* - * Read register value. - * - * Args: register address. - * Input: None. - * Output: register value. - */ - CMD_READ_REG = 9, - - /* - * Write register value. - * - * Args: register address, value. - * Input: None. - * Output: None. - */ - CMD_WRITE_REG = 10, -}; - -#endif /* CS_COMMON_PLATFORMS_ESP8266_STUBS_STUB_FLASHER_H_ */ diff --git a/src/common/platforms/esp31/rom/.gitattributes b/src/common/platforms/esp31/rom/.gitattributes deleted file mode 100644 index 1260bec9a9733234f84218f93abb45e14dd94e97..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp31/rom/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -rom.bin -nodiff diff --git a/src/common/platforms/esp31/rom/ESP31B_ROM.txt b/src/common/platforms/esp31/rom/ESP31B_ROM.txt deleted file mode 100644 index f4640cc66aa20ba3a668c700943867ffc2889667..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp31/rom/ESP31B_ROM.txt +++ /dev/null @@ -1,11917 +0,0 @@ - -rom.elf: file format elf32-xtensa-le - - -Disassembly of section .text: - -40000000 <_start>: -40000000: 49c500 s32e a0, a5, -16 -40000003: 49d510 s32e a1, a5, -12 -40000006: 49e520 s32e a2, a5, -8 -40000009: 49f530 s32e a3, a5, -4 -4000000c: 003400 rfwo -4000000f: 412800 srli a2, a0, 8 -40000012: 5138 l32i.n a3, a1, 20 -40000014: 6148 l32i.n a4, a1, 24 -40000016: 01d112 addmi a1, a1, 0x100 -40000019: 13d100 wsr.excsave1 a0 -4000001c: 034800 rsr.windowbase a0 -4000001f: 4080f0 rotw -1 -40000022: 03e620 rsr.ps a2 -40000025: 343820 extui a3, a2, 8, 4 -40000028: 303340 xor a3, a3, a4 -4000002b: 000846 j 40000050 <_XX_ExcVec50> - ... - -40000040 <_XX_Vec40>: -40000040: 09c500 l32e a0, a5, -16 -40000043: 09d510 l32e a1, a5, -12 -40000046: 09e520 l32e a2, a5, -8 -40000049: 09f530 l32e a3, a5, -4 -4000004c: 003500 rfwu - ... - -40000050 <_XX_ExcVec50>: -40000050: 03d140 rsr.excsave1 a4 -40000053: 113380 slli a3, a3, 8 -40000056: 302230 xor a2, a2, a3 -40000059: 13e620 wsr.ps a2 -4000005c: 002010 rsync -4000005f: dd74f7 bbci a4, 31, 40000040 <_XX_Vec40> -40000062: 4080f0 rotw -1 -40000065: 5778e7 bbci a8, 30, 400000c0 <_XX_ExcVec80+0x40> -40000068: 4080f0 rotw -1 -4000006b: 003446 j 40000140 <_WindowUnderflowHandler> - ... - -40000080 <_XX_ExcVec80>: -40000080: 49c900 s32e a0, a9, -16 -40000083: 09d100 l32e a0, a1, -12 -40000086: 49d910 s32e a1, a9, -12 -40000089: 49e920 s32e a2, a9, -8 -4000008c: 49f930 s32e a3, a9, -4 -4000008f: 498040 s32e a4, a0, -32 -40000092: 499050 s32e a5, a0, -28 -40000095: 49a060 s32e a6, a0, -24 -40000098: 49b070 s32e a7, a0, -20 -4000009b: 003400 rfwo - ... -400000be: 000000 ill -400000c1: 09c9 s32i.n a12, a9, 0 -400000c3: 09d910 l32e a1, a9, -12 -400000c6: 09e920 l32e a2, a9, -8 -400000c9: 09d170 l32e a7, a1, -12 -400000cc: 09f930 l32e a3, a9, -4 -400000cf: 098740 l32e a4, a7, -32 -400000d2: 099750 l32e a5, a7, -28 -400000d5: 09a760 l32e a6, a7, -24 -400000d8: 09b770 l32e a7, a7, -20 -400000db: 003500 rfwu - ... - -40000100 <_WindowOverflowHandler>: -40000100: 49cd00 s32e a0, a13, -16 -40000103: 09d100 l32e a0, a1, -12 -40000106: 49dd10 s32e a1, a13, -12 -40000109: 49ed20 s32e a2, a13, -8 -4000010c: 49fd30 s32e a3, a13, -4 -4000010f: 494040 s32e a4, a0, -48 -40000112: 495050 s32e a5, a0, -44 -40000115: 496060 s32e a6, a0, -40 -40000118: 497070 s32e a7, a0, -36 -4000011b: 498080 s32e a8, a0, -32 -4000011e: 499090 s32e a9, a0, -28 -40000121: 49a0a0 s32e a10, a0, -24 -40000124: 49b0b0 s32e a11, a0, -20 -40000127: 003400 rfwo - ... - -40000140 <_WindowUnderflowHandler>: -40000140: 09cd00 l32e a0, a13, -16 -40000143: 09dd10 l32e a1, a13, -12 -40000146: 09ed20 l32e a2, a13, -8 -40000149: 09d1b0 l32e a11, a1, -12 -4000014c: 09fd30 l32e a3, a13, -4 -4000014f: 094b40 l32e a4, a11, -48 -40000152: 095b50 l32e a5, a11, -44 -40000155: 096b60 l32e a6, a11, -40 -40000158: 097b70 l32e a7, a11, -36 -4000015b: 098b80 l32e a8, a11, -32 -4000015e: 099b90 l32e a9, a11, -28 -40000161: 09aba0 l32e a10, a11, -24 -40000164: 09bbb0 l32e a11, a11, -20 -40000167: 003500 rfwu - ... -4000017e: 200000 or a0, a0, a0 -40000181: a061d2 s32i a13, a1, 0x280 -40000184: 000002 l8ui a0, a0, 0 - ... -400001bf: d32000 movt a2, a0, b0 -400001c2: 02a061 l32r a6, 3ffc0c44 <_start-0x3f3bc> - ... -400001fd: 000000 ill -40000200: 61d420 xsr.excsave4 a2 -40000203: 0002a0 jx a2 - ... -4000023e: 200000 or a0, a0, a0 -40000241: a061d5 call4 3ffa0860 <_start-0x5f7a0> -40000244: 000002 l8ui a0, a0, 0 - ... -4000027f: d62000 excw -40000282: 827c13 excw -40000285: 005100 simcall -40000288: ffff06 j 40000288 <_WindowUnderflowHandler+0x148> - ... -400002bf: 371000 excw - ... - -40000300 <_XX_Vec400>: -40000300: 004100 break 1, 0 -40000303: fffe46 j 40000300 <_XX_Vec400> - ... -4000033e: 120000 andbc b0, b0, b0 -40000341: 29ffd1 l32r a13, 3ffcab40 <_start-0x354c0> -40000344: 513941 l32r a4, 3ffd4828 <_start-0x2b7d8> -40000347: f27e31 l32r a3, 3fffcd40 <_start-0x32c0> -4000034a: 03e820 rsr.exccause a2 -4000034d: a03230 addx4 a3, a2, a3 -40000350: 0338 l32i.n a3, a3, 0 -40000352: 6149 s32i.n a4, a1, 24 -40000354: 0003a0 jx a3 - ... -400003bf: 414000 srli a4, a0, 0 -400003c2: fe4600 excw -400003c5: ff .byte 0xff - ... -400003fe: 7c0000 excw -40000401: 6100d0 xsr.lbeg a13 -40000404: 0dc613 excw - ... -4000040f: 211f40 srai a1, a4, 15 -40000412: 002222 l32i a2, a2, 0 -40000415: e00000 subx4 a0, a0, a0 -40000418: 000494 excw -4000041b: 70d440 excw -4000041e: dc4000 excw -40000421: 0009 s32i.n a0, a0, 0 -40000423: 0ab040 depbits a4, a0, 0, 12 -40000426: 804000 add a4, a0, a0 -40000429: 000b addi.n a0, a0, -1 -4000042b: c20840 quou a0, a8, a4 -4000042e: ff .byte 0xff -4000042f: 3f .byte 0x3f -40000430: 000cc0 callx0 a12 -40000433: c20c40 quou a0, a12, a4 -40000436: ff .byte 0xff -40000437: 3f .byte 0x3f - ... -40000440: 000c movi.n a0, 0 -40000442: 13e400 wsr.intenable a0 -40000445: fff021 l32r a2, 40000408 <_XX_Vec400+0x108> -40000448: 03eb30 rsr.prid a3 -4000044b: 743030 extui a3, a3, 0, 8 -4000044e: 228c beqz.n a2, 40000454 <_XX_Vec400+0x154> -40000450: 03cc bnez.n a3, 40000454 <_XX_Vec400+0x154> -40000452: 0209 s32i.n a0, a2, 0 -40000454: ffee21 l32r a2, 4000040c <_XX_Vec400+0x10c> -40000457: 13e720 wsr.vecbase a2 -4000045a: 531c movi.n a3, 21 -4000045c: 136330 wsr.atomctl a3 -4000045f: 006120 rsil a2, 1 -40000462: ffeb21 l32r a2, 40000410 <_XX_Vec400+0x110> -40000465: ffeb51 l32r a5, 40000414 <_XX_Vec400+0x114> -40000468: ffec61 l32r a6, 40000418 <_XX_Vec400+0x118> -4000046b: 030c movi.n a3, 0 -4000046d: 027d mov.n a7, a2 -4000046f: 106650 and a6, a6, a5 -40000472: 000786 j 40000494 <_XX_Vec400+0x194> - ... -4000047d: 000000 ill -40000480: 506340 witlb a4, a3 -40000483: 002000 isync -40000486: f03d nop.n -40000488: 0020f0 nop -4000048b: c03350 sub a3, a3, a5 -4000048e: 14b3b6 bltui a3, 16, 400004a6 <_XX_Vec400+0x1a6> -40000491: 417470 srli a7, a7, 4 -40000494: 344070 extui a4, a7, 0, 4 -40000497: e51367 beq a3, a6, 40000480 <_XX_Vec400+0x180> -4000049a: 506340 witlb a4, a3 -4000049d: c03350 sub a3, a3, a5 -400004a0: edb3f6 bgeui a3, 16, 40000491 <_XX_Vec400+0x191> -400004a3: 002000 isync -400004a6: ffdb51 l32r a5, 40000414 <_XX_Vec400+0x114> -400004a9: 030c movi.n a3, 0 -400004ab: 027d mov.n a7, a2 -400004ad: 344070 extui a4, a7, 0, 4 -400004b0: 50e340 wdtlb a4, a3 -400004b3: c03350 sub a3, a3, a5 -400004b6: 417470 srli a7, a7, 4 -400004b9: f0b3f6 bgeui a3, 16, 400004ad <_XX_Vec400+0x1ad> -400004bc: 002030 dsync -400004bf: 03a032 movi a3, 3 -400004c2: 036120 rsr.memctl a2 -400004c5: 202230 or a2, a2, a3 -400004c8: 136120 wsr.memctl a2 -400004cb: ffd421 l32r a2, 4000041c <_XX_Vec400+0x11c> -400004ce: 02ac beqz.n a2, 400004f2 <_XX_Vec400+0x1f2> -400004d0: 0238 l32i.n a3, a2, 0 -400004d2: 1248 l32i.n a4, a2, 4 -400004d4: 2258 l32i.n a5, a2, 8 -400004d6: 0cc222 addi a2, a2, 12 -400004d9: 0fb347 bgeu a3, a4, 400004ec <_XX_Vec400+0x1ec> -400004dc: 0568 l32i.n a6, a5, 0 -400004de: 554b addi.n a5, a5, 4 -400004e0: 0369 s32i.n a6, a3, 0 -400004e2: 334b addi.n a3, a3, 4 -400004e4: f43347 bltu a3, a4, 400004dc <_XX_Vec400+0x1dc> -400004e7: fff946 j 400004d0 <_XX_Vec400+0x1d0> -400004ea: 560000 excw -400004ed: 56fe03 excw -400004f0: 00fdd5 call4 400014d0 <_l_strap_0x0x11_loader+0x7> -400004f3: 0c0020 excw -400004f6: 491011 l32r a1, 3ffd2938 <_start-0x2d6c8> -400004f9: 480013 excw -400004fc: 201013 excw - ... - -40000500 <_X_ResetVector>: -40000500: 000c movi.n a0, 0 -40000502: ffc741 l32r a4, 40000420 <_XX_Vec400+0x120> -40000505: 13d240 wsr.excsave2 a4 -40000508: ffc741 l32r a4, 40000424 <_XX_Vec400+0x124> -4000050b: 13d340 wsr.excsave3 a4 -4000050e: ffc641 l32r a4, 40000428 <_XX_Vec400+0x128> -40000511: 13d440 wsr.excsave4 a4 -40000514: ffc651 l32r a5, 4000042c <_XX_Vec400+0x12c> -40000517: 006542 s32i a4, a5, 0 -4000051a: ffc541 l32r a4, 40000430 <_XX_Vec400+0x130> -4000051d: 13d540 wsr.excsave5 a4 -40000520: ffc551 l32r a5, 40000434 <_XX_Vec400+0x134> -40000523: 006542 s32i a4, a5, 0 -40000526: 002845 call0 400007ac <_X_start> - ... - -40000700 <_c_stack>: -40000700: 000000 ill -40000703: 002040 excw -40000706: 480004 mula.da.ll.ldinc m0, a0, m0, a0 - -40000708 <_c_bss_start>: -40000708: cd48 l32i.n a4, a13, 48 -4000070a: ff .byte 0xff -4000070b: 3f .byte 0x3f - -4000070c <_c_bss_end>: -4000070c: ffe1d0 excw -4000070f: 3f .byte 0x3f -40000710: 6668 l32i.n a6, a6, 24 -40000712: 084000 excw -40000715: 3fffc1 l32r a12, 3ffd0714 <_start-0x2f8ec> -40000718: 000e40 excw -4000071b: c00840 sub a0, a8, a4 -4000071e: ff .byte 0xff -4000071f: 3f .byte 0x3f -40000720: 66b8 l32i.n a11, a6, 24 -40000722: 234000 sext a4, a0, 7 -40000725: 000500 excw -40000728: 000007 bnone a0, a0, 4000072c <_c_bss_end+0x20> -4000072b: 000580 ret -4000072e: 000000 ill -40000731: c00000 sub a0, a0, a0 - -40000734 <_c_0x3fffc210>: -40000734: ffc210 excw -40000737: 3f .byte 0x3f - -40000738 <_c_0x80000000>: -40000738: 000000 ill -4000073b: c21880 quou a1, a8, a8 -4000073e: ff .byte 0xff -4000073f: 3f .byte 0x3f -40000740: 66c8 l32i.n a12, a6, 24 -40000742: 004000 break 0, 0 -40000745: 078000 excw -40000748: 000aa1 l32r a10, 3ffc0770 <_start-0x3f890> -4000074b: 800040 add a0, a0, a4 -4000074e: 723800 excw -40000751: 000b addi.n a0, a0, -1 -40000753: d15040 mul16s a5, a0, a4 -40000756: ff .byte 0xff -40000757: 3f .byte 0x3f -40000758: c208 l32i.n a0, a2, 48 -4000075a: ff .byte 0xff -4000075b: 3f .byte 0x3f -4000075c: 050024 excw - ... - -40000760 <_c_0x40000000>: -40000760: 000000 ill -40000763: d6b040 excw -40000766: ff .byte 0xff -40000767: 3f .byte 0x3f -40000768: c20c movi.n a2, 12 -4000076a: ff .byte 0xff -4000076b: 3f .byte 0x3f -4000076c: 050025 call8 40005770 <_XX_unk5734+0x3c> -4000076f: 000000 ill -40000772: 408001 l32r a0, 3ffd0974 <_start-0x2f68c> -40000775: ffc8 l32i.n a12, a15, 60 -40000777: 3f .byte 0x3f -40000778: f42d break.n 4 -4000077a: 2d5851 l32r a5, 3ffcbcdc <_start-0x34324> -4000077d: 7f .byte 0x7f -4000077e: ff4c95 call4 3ffffc48 <_start-0x3b8> - -40000780 <_c_0x7fffffff>: -40000780: ff .byte 0xff -40000781: ff .byte 0xff -40000782: ff .byte 0xff -40000783: 7f .byte 0x7f -40000784: ffca30 excw -40000787: 3f .byte 0x3f -40000788: 0066b0 rsil a11, 6 -4000078b: fff040 excw -4000078e: fffb addi.n a15, a15, 15 -40000790: ff .byte 0xff -40000791: 000000 ill -40000794: 00ff00 excw - ... - -40000798 <_c_0x00ff0000>: -40000798: ff0000 excw -4000079b: 000000 ill -4000079e: 40ff00 nsau a0, a15 -400007a1: 404040 excw -400007a4: 808080 add a8, a0, a8 -400007a7: feff80 excw -400007aa: fe .byte 0xfe -400007ab: fe .byte 0xfe - -400007ac <_X_start>: -400007ac: 00a002 movi a0, 0 -400007af: ffd411 l32r a1, 40000700 <_c_stack> -400007b2: ffd431 l32r a3, 40000704 <_c_stack+0x4> -400007b5: f03d nop.n -400007b7: 13e630 wsr.ps a3 -400007ba: 002010 rsync -400007bd: ffd261 l32r a6, 40000708 <_c_bss_start> -400007c0: ffd371 l32r a7, 4000070c <_c_bss_end> -400007c3: 06b677 bgeu a6, a7, 400007cd <_X_start+0x21> -400007c6: 0609 s32i.n a0, a6, 0 -400007c8: 664b addi.n a6, a6, 4 -400007ca: f83677 bltu a6, a7, 400007c6 <_X_start+0x1a> -400007cd: 0098d5 call4 4000115c <_X_main> -400007d0: 120c movi.n a2, 1 -400007d2: 005100 simcall -400007d5: 0041f0 break 1, 15 -400007d8: fffd06 j 400007d0 <_X_start+0x24> -400007db: 413600 srli a3, a0, 6 -400007de: d2f600 quos a15, a6, a0 -400007e1: 2e .byte 0x2e -400007e2: 090c movi.n a9, 0 -400007e4: ffcd61 l32r a6, 40000718 <_c_bss_end+0xc> -400007e7: ffce41 l32r a4, 40000720 <_c_bss_end+0x14> -400007ea: ffcc81 l32r a8, 4000071c <_c_bss_end+0x10> -400007ed: ffc8a1 l32r a10, 40000710 <_c_bss_end+0x4> -400007f0: ffc9b1 l32r a11, 40000714 <_c_bss_end+0x8> -400007f3: 1152e0 slli a5, a2, 2 -400007f6: b5ba add.n a11, a5, a11 -400007f8: 833a30 moveqz a3, a10, a3 -400007fb: 558a add.n a5, a5, a8 -400007fd: 0b28 l32i.n a2, a11, 0 -400007ff: c073a0 sub a7, a3, a10 -40000802: 934670 movnez a4, a6, a7 -40000805: 0b39 s32i.n a3, a11, 0 -40000807: 0549 s32i.n a4, a5, 0 -40000809: c0a2a0 sub a10, a2, a10 -4000080c: 8329a0 moveqz a2, a9, a10 -4000080f: f01d retw.n -40000811: 020c movi.n a2, 0 -40000813: f01d retw.n -40000815: 000000 ill -40000818: 03b130 rsr.epc1 a3 -4000081b: 030120 rsr.lend a2 -4000081e: 333b addi.n a3, a3, 3 -40000820: 0c9237 bne a2, a3, 40000830 <_X_start+0x84> -40000823: 030220 rsr.lcount a2 -40000826: 628c beqz.n a2, 40000830 <_X_start+0x84> -40000828: 220b addi.n a2, a2, -1 -4000082a: 130220 wsr.lcount a2 -4000082d: 030030 rsr.lbeg a3 -40000830: 4128 l32i.n a2, a1, 16 -40000832: 13b130 wsr.epc1 a3 -40000835: 5138 l32i.n a3, a1, 20 -40000837: 056256 bnez a2, 40000891 <_X_start+0xe5> -4000083a: 396132 s32i a3, a1, 228 -4000083d: 3a6142 s32i a4, a1, 232 -40000840: 3b6152 s32i a5, a1, 236 -40000843: ffb831 l32r a3, 40000724 <_c_bss_end+0x18> -40000846: 03e620 rsr.ps a2 -40000849: 13e630 wsr.ps a3 -4000084c: 03b130 rsr.epc1 a3 -4000084f: 01d112 addmi a1, a1, 0x100 -40000852: 002010 rsync -40000855: 040c movi.n a4, 0 -40000857: 008136 entry a1, 64 -4000085a: 0001f5 call12 40000878 <_X_start+0xcc> -4000085d: ffb2e1 l32r a14, 40000728 <_c_bss_end+0x1c> -40000860: 0cea add.n a0, a12, a14 -40000862: f01d retw.n -40000864: 13e620 wsr.ps a2 -40000867: 020c movi.n a2, 0 -40000869: a548 l32i.n a4, a5, 40 -4000086b: 002010 rsync -4000086e: 13b130 wsr.epc1 a3 -40000871: 9538 l32i.n a3, a5, 36 -40000873: b558 l32i.n a5, a5, 44 -40000875: 003000 rfe -40000878: 006136 entry a1, 48 -4000087b: ffacc1 l32r a12, 4000072c <_c_bss_end+0x20> -4000087e: c0ca add.n a12, a0, a12 -40000880: 006136 entry a1, 48 -40000883: 00cd mov.n a12, a0 -40000885: 006136 entry a1, 48 -40000888: 00cd mov.n a12, a0 -4000088a: 002136 entry a1, 16 -4000088d: 0bbd mov.n a11, a11 -4000088f: f01d retw.n -40000891: f27c movi.n a2, -1 -40000893: 01d112 addmi a1, a1, 0x100 -40000896: 003000 rfe -40000899: 000000 ill -4000089c: 7159 s32i.n a5, a1, 28 -4000089e: ffa121 l32r a2, 40000724 <_c_bss_end+0x18> -400008a1: 03b130 rsr.epc1 a3 -400008a4: 61e620 xsr.ps a2 -400008a7: 0139 s32i.n a3, a1, 0 -400008a9: 1129 s32i.n a2, a1, 4 -400008ab: 3b2122 l32i a2, a1, 236 -400008ae: 01d112 addmi a1, a1, 0x100 -400008b1: 002010 rsync -400008b4: ff9f41 l32r a4, 40000730 <_c_bss_end+0x24> -400008b7: 203430 or a3, a4, a3 -400008ba: 904430 addx2 a4, a4, a3 -400008bd: 020136 entry a1, 0x100 -400008c0: 0061f0 rsil a15, 1 -400008c3: ff9ce1 l32r a14, 40000734 <_c_0x3fffc210> -400008c6: 03e2f0 rsr.interrupt a15 -400008c9: 03e4c0 rsr.intenable a12 -400008cc: 1ed8 l32i.n a13, a14, 4 -400008ce: 10ffc0 and a15, a15, a12 -400008d1: 0303c0 rsr.sar a12 -400008d4: 31d9 s32i.n a13, a1, 12 -400008d6: 092f16 beqz a15, 4000096c <_X_start+0x1c0> -400008d9: 21c9 s32i.n a12, a1, 8 -400008db: 8129 s32i.n a2, a1, 32 -400008dd: ffaf22 movi a2, -1 -400008e0: 40ffc0 nsau a12, a15 -400008e3: ff95f1 l32r a15, 40000738 <_c_0x80000000> -400008e6: 400c00 ssr a12 -400008e9: 91f0f0 srl a15, a15 -400008ec: 3022f0 xor a2, a2, a15 -400008ef: ff93d1 l32r a13, 4000073c <_c_0x80000000+0x4> -400008f2: 13e3f0 wsr.intclear a15 -400008f5: b0ccd0 addx8 a12, a12, a13 -400008f8: 402cd2 l32i a13, a12, 0x100 -400008fb: 0066f0 rsil a15, 6 -400008fe: 0ef8 l32i.n a15, a14, 0 -40000900: 1ed9 s32i.n a13, a14, 4 -40000902: 10ffd0 and a15, a15, a13 -40000905: 13e4f0 wsr.intenable a15 -40000908: 002010 rsync -4000090b: 0060f0 rsil a15, 0 -4000090e: 0302d0 rsr.lcount a13 -40000911: 0300f0 rsr.lbeg a15 -40000914: 91d9 s32i.n a13, a1, 36 -40000916: 0301d0 rsr.lend a13 -40000919: a1f9 s32i.n a15, a1, 40 -4000091b: b1d9 s32i.n a13, a1, 44 -4000091d: 0310d0 rsr.acclo a13 -40000920: 0311f0 rsr.acchi a15 -40000923: c1d9 s32i.n a13, a1, 48 -40000925: d1f9 s32i.n a15, a1, 52 -40000927: 0cd8 l32i.n a13, a12, 0 -40000929: 01fd mov.n a15, a1 -4000092b: 012ce2 l32i a14, a12, 4 -4000092e: 000df0 callx12 a13 -40000931: 91d8 l32i.n a13, a1, 36 -40000933: a1e8 l32i.n a14, a1, 40 -40000935: b1f8 l32i.n a15, a1, 44 -40000937: 1302d0 wsr.lcount a13 -4000093a: 1300e0 wsr.lbeg a14 -4000093d: 1301f0 wsr.lend a15 -40000940: c1d8 l32i.n a13, a1, 48 -40000942: d1e8 l32i.n a14, a1, 52 -40000944: 1310d0 wsr.acclo a13 -40000947: 1311e0 wsr.acchi a14 -4000094a: ff7ae1 l32r a14, 40000734 <_c_0x3fffc210> -4000094d: 03e2f0 rsr.interrupt a15 -40000950: 0066d0 rsil a13, 6 -40000953: 0ed8 l32i.n a13, a14, 0 -40000955: 31c8 l32i.n a12, a1, 12 -40000957: 10ddc0 and a13, a13, a12 -4000095a: 10ffd0 and a15, a15, a13 -4000095d: 01ff56 bnez a15, 40000980 <_X_start+0x1d4> -40000960: 8128 l32i.n a2, a1, 32 -40000962: 1ec9 s32i.n a12, a14, 4 -40000964: 21c8 l32i.n a12, a1, 8 -40000966: 13e4d0 wsr.intenable a13 -40000969: 0063d0 rsil a13, 3 -4000096c: ff7501 l32r a0, 40000740 <_c_0x80000000+0x8> -4000096f: ff70d1 l32r a13, 40000730 <_c_bss_end+0x24> -40000972: 1303c0 wsr.sar a12 -40000975: 2000d0 or a0, a0, a13 -40000978: 900d00 addx2 a0, a13, a0 -4000097b: 0063d0 rsil a13, 3 -4000097e: f01d retw.n -40000980: 40ffd0 nsau a13, a15 -40000983: ff6ec1 l32r a12, 4000073c <_c_0x80000000+0x4> -40000986: b0cdc0 addx8 a12, a13, a12 -40000989: 412ce2 l32i a14, a12, 0x104 -4000098c: 10ff20 and a15, a15, a2 -4000098f: 10ffe0 and a15, a15, a14 -40000992: ff68e1 l32r a14, 40000734 <_c_0x3fffc210> -40000995: f47f56 bnez a15, 400008e0 <_X_start+0x134> -40000998: ff68f1 l32r a15, 40000738 <_c_0x80000000> -4000099b: 400d00 ssr a13 -4000099e: 91d0f0 srl a13, a15 -400009a1: 412cf2 l32i a15, a12, 0x104 -400009a4: 13e3d0 wsr.intclear a13 -400009a7: 2022f0 or a2, a2, a15 -400009aa: 3022d0 xor a2, a2, a13 -400009ad: ffd1c6 j 400008f8 <_X_start+0x14c> -400009b0: 002136 entry a1, 16 -400009b3: 13e620 wsr.ps a2 -400009b6: 002010 rsync -400009b9: f01d retw.n -400009bb: 213600 srai a3, a0, 6 -400009be: 023d00 andb b3, b13, b0 -400009c1: ff5c41 l32r a4, 40000734 <_c_0x3fffc210> -400009c4: 006670 rsil a7, 6 -400009c7: 1428 l32i.n a2, a4, 4 -400009c9: 0458 l32i.n a5, a4, 0 -400009cb: 1439 s32i.n a3, a4, 4 -400009cd: 105530 and a5, a5, a3 -400009d0: 13e450 wsr.intenable a5 -400009d3: 13e670 wsr.ps a7 -400009d6: 002010 rsync -400009d9: f01d retw.n -400009db: d22000 quos a2, a0, a0 -400009de: d11261 l32r a6, 3fff4e28 <_start-0xb1d8> -400009e1: ff .byte 0xff -400009e2: 4129 s32i.n a2, a1, 16 -400009e4: ff5021 l32r a2, 40000724 <_c_bss_end+0x18> -400009e7: 6149 s32i.n a4, a1, 24 -400009e9: 7159 s32i.n a5, a1, 28 -400009eb: 13e620 wsr.ps a2 -400009ee: 002010 rsync -400009f1: 3b2122 l32i a2, a1, 236 -400009f4: 01d112 addmi a1, a1, 0x100 -400009f7: 03b240 rsr.epc2 a4 -400009fa: ff4d51 l32r a5, 40000730 <_c_bss_end+0x24> -400009fd: 204540 or a4, a5, a4 -40000a00: 904540 addx2 a4, a5, a4 -40000a03: 020136 entry a1, 0x100 -40000a06: 0062f0 rsil a15, 2 -40000a09: 03e2f0 rsr.interrupt a15 -40000a0c: 03e4c0 rsr.intenable a12 -40000a0f: ff4dd1 l32r a13, 40000744 <_c_0x80000000+0xc> -40000a12: 10ffc0 and a15, a15, a12 -40000a15: 10ffd0 and a15, a15, a13 -40000a18: 0303e0 rsr.sar a14 -40000a1b: 06ef16 beqz a15, 40000a8d <_X_start+0x2e1> -40000a1e: 21e9 s32i.n a14, a1, 8 -40000a20: 0302d0 rsr.lcount a13 -40000a23: 0300e0 rsr.lbeg a14 -40000a26: 91d9 s32i.n a13, a1, 36 -40000a28: 0301d0 rsr.lend a13 -40000a2b: a1e9 s32i.n a14, a1, 40 -40000a2d: b1d9 s32i.n a13, a1, 44 -40000a2f: 0310d0 rsr.acclo a13 -40000a32: 0311e0 rsr.acchi a14 -40000a35: c1d9 s32i.n a13, a1, 48 -40000a37: d1e9 s32i.n a14, a1, 52 -40000a39: 60c0f0 neg a12, a15 -40000a3c: 10ccf0 and a12, a12, a15 -40000a3f: 13e3c0 wsr.intclear a12 -40000a42: ff3ed1 l32r a13, 4000073c <_c_0x80000000+0x4> -40000a45: fe1c movi.n a14, 31 -40000a47: 40fcc0 nsau a12, a12 -40000a4a: c0fec0 sub a15, a14, a12 -40000a4d: 60f0f0 neg a15, a15 -40000a50: 1fcff2 addi a15, a15, 31 -40000a53: b0cfd0 addx8 a12, a15, a13 -40000a56: 0cd8 l32i.n a13, a12, 0 -40000a58: 1ce8 l32i.n a14, a12, 4 -40000a5a: 20f110 or a15, a1, a1 -40000a5d: 000df0 callx12 a13 -40000a60: 03e2f0 rsr.interrupt a15 -40000a63: 03e4c0 rsr.intenable a12 -40000a66: ff37d1 l32r a13, 40000744 <_c_0x80000000+0xc> -40000a69: 10ffc0 and a15, a15, a12 -40000a6c: 10ffd0 and a15, a15, a13 -40000a6f: fc6f56 bnez a15, 40000a39 <_X_start+0x28d> -40000a72: 91d8 l32i.n a13, a1, 36 -40000a74: a1e8 l32i.n a14, a1, 40 -40000a76: b1f8 l32i.n a15, a1, 44 -40000a78: 1302d0 wsr.lcount a13 -40000a7b: 1300e0 wsr.lbeg a14 -40000a7e: 1301f0 wsr.lend a15 -40000a81: c1d8 l32i.n a13, a1, 48 -40000a83: d1e8 l32i.n a14, a1, 52 -40000a85: 1310d0 wsr.acclo a13 -40000a88: 1311e0 wsr.acchi a14 -40000a8b: 21e8 l32i.n a14, a1, 8 -40000a8d: ff2e01 l32r a0, 40000748 <_c_0x80000000+0x10> -40000a90: ff28d1 l32r a13, 40000730 <_c_bss_end+0x24> -40000a93: 1303e0 wsr.sar a14 -40000a96: 2000d0 or a0, a0, a13 -40000a99: 900d00 addx2 a0, a13, a0 -40000a9c: 0063e0 rsil a14, 3 -40000a9f: f01d retw.n -40000aa1: 3b6522 s32i a2, a5, 236 -40000aa4: 4528 l32i.n a2, a5, 16 -40000aa6: 6548 l32i.n a4, a5, 24 -40000aa8: 7558 l32i.n a5, a5, 28 -40000aaa: 003210 rfi 2 -40000aad: 000000 ill -40000ab0: 61d320 xsr.excsave3 a2 -40000ab3: ffd112 addmi a1, a1, 0xffffff00 -40000ab6: 4129 s32i.n a2, a1, 16 -40000ab8: ff1b21 l32r a2, 40000724 <_c_bss_end+0x18> -40000abb: 6149 s32i.n a4, a1, 24 -40000abd: 7159 s32i.n a5, a1, 28 -40000abf: 13e620 wsr.ps a2 -40000ac2: 002010 rsync -40000ac5: 3b2122 l32i a2, a1, 236 -40000ac8: 01d112 addmi a1, a1, 0x100 -40000acb: 03b340 rsr.epc3 a4 -40000ace: ff1851 l32r a5, 40000730 <_c_bss_end+0x24> -40000ad1: 204540 or a4, a5, a4 -40000ad4: 904540 addx2 a4, a5, a4 -40000ad7: 020136 entry a1, 0x100 -40000ada: 0063f0 rsil a15, 3 -40000add: 03e2f0 rsr.interrupt a15 -40000ae0: 03e4c0 rsr.intenable a12 -40000ae3: ff1ad1 l32r a13, 4000074c <_c_0x80000000+0x14> -40000ae6: 10ffc0 and a15, a15, a12 -40000ae9: 10ffd0 and a15, a15, a13 -40000aec: 0303e0 rsr.sar a14 -40000aef: 06ef16 beqz a15, 40000b61 <_X_start+0x3b5> -40000af2: 21e9 s32i.n a14, a1, 8 -40000af4: 0302d0 rsr.lcount a13 -40000af7: 0300e0 rsr.lbeg a14 -40000afa: 91d9 s32i.n a13, a1, 36 -40000afc: 0301d0 rsr.lend a13 -40000aff: a1e9 s32i.n a14, a1, 40 -40000b01: b1d9 s32i.n a13, a1, 44 -40000b03: 0310d0 rsr.acclo a13 -40000b06: 0311e0 rsr.acchi a14 -40000b09: c1d9 s32i.n a13, a1, 48 -40000b0b: d1e9 s32i.n a14, a1, 52 -40000b0d: 60c0f0 neg a12, a15 -40000b10: 10ccf0 and a12, a12, a15 -40000b13: 13e3c0 wsr.intclear a12 -40000b16: ff09d1 l32r a13, 4000073c <_c_0x80000000+0x4> -40000b19: fe1c movi.n a14, 31 -40000b1b: 40fcc0 nsau a12, a12 -40000b1e: c0fec0 sub a15, a14, a12 -40000b21: 60f0f0 neg a15, a15 -40000b24: 1fcff2 addi a15, a15, 31 -40000b27: b0cfd0 addx8 a12, a15, a13 -40000b2a: 0cd8 l32i.n a13, a12, 0 -40000b2c: 1ce8 l32i.n a14, a12, 4 -40000b2e: 20f110 or a15, a1, a1 -40000b31: 000df0 callx12 a13 -40000b34: 03e2f0 rsr.interrupt a15 -40000b37: 03e4c0 rsr.intenable a12 -40000b3a: ff04d1 l32r a13, 4000074c <_c_0x80000000+0x14> -40000b3d: 10ffc0 and a15, a15, a12 -40000b40: 10ffd0 and a15, a15, a13 -40000b43: fc6f56 bnez a15, 40000b0d <_X_start+0x361> -40000b46: 91d8 l32i.n a13, a1, 36 -40000b48: a1e8 l32i.n a14, a1, 40 -40000b4a: b1f8 l32i.n a15, a1, 44 -40000b4c: 1302d0 wsr.lcount a13 -40000b4f: 1300e0 wsr.lbeg a14 -40000b52: 1301f0 wsr.lend a15 -40000b55: c1d8 l32i.n a13, a1, 48 -40000b57: d1e8 l32i.n a14, a1, 52 -40000b59: 1310d0 wsr.acclo a13 -40000b5c: 1311e0 wsr.acchi a14 -40000b5f: 21e8 l32i.n a14, a1, 8 -40000b61: fefb01 l32r a0, 40000750 <_c_0x80000000+0x18> -40000b64: fef3d1 l32r a13, 40000730 <_c_bss_end+0x24> -40000b67: 1303e0 wsr.sar a14 -40000b6a: 2000d0 or a0, a0, a13 -40000b6d: 900d00 addx2 a0, a13, a0 -40000b70: f01d retw.n -40000b72: 3b6522 s32i a2, a5, 236 -40000b75: 4528 l32i.n a2, a5, 16 -40000b77: 6548 l32i.n a4, a5, 24 -40000b79: 7558 l32i.n a5, a5, 28 -40000b7b: 003310 rfi 3 -40000b7e: 210000 srai a0, a0, 0 -40000b81: 09fef5 call12 4000ab70 <__umoddi3+0x3d0c> -40000b84: f401d2 l8ui a13, a1, 244 -40000b87: fe .byte 0xfe -40000b88: e219 s32i.n a1, a2, 56 -40000b8a: 0008 l32i.n a0, a0, 0 -40000b8c: 106232 s32i a3, a2, 64 -40000b8f: 61d400 xsr.excsave4 a0 -40000b92: 116242 s32i a4, a2, 68 -40000b95: f209 s32i.n a0, a2, 60 -40000b97: 03b130 rsr.epc1 a3 -40000b9a: 03e840 rsr.exccause a4 -40000b9d: 3239 s32i.n a3, a2, 12 -40000b9f: 4249 s32i.n a4, a2, 16 -40000ba1: 03ee30 rsr.excvaddr a3 -40000ba4: 056232 s32i a3, a2, 20 -40000ba7: 03d140 rsr.excsave1 a4 -40000baa: 066242 s32i a4, a2, 24 -40000bad: 803c movi.n a0, 56 -40000baf: 126252 s32i a5, a2, 72 -40000bb2: 136262 s32i a6, a2, 76 -40000bb5: 146272 s32i a7, a2, 80 -40000bb8: 156282 s32i a8, a2, 84 -40000bbb: 166292 s32i a9, a2, 88 -40000bbe: 1762a2 s32i a10, a2, 92 -40000bc1: 1862b2 s32i a11, a2, 96 -40000bc4: 1962c2 s32i a12, a2, 100 -40000bc7: 1a62d2 s32i a13, a2, 104 -40000bca: 1b62e2 s32i a14, a2, 108 -40000bcd: 1c62f2 s32i a15, a2, 112 -40000bd0: f8c082 addi a8, a0, -8 -40000bd3: 20c2a2 addi a10, a2, 32 -40000bd6: 408020 rotw 2 -40000bd9: fdb056 bnez a0, 40000bb8 <_X_start+0x40c> -40000bdc: 408020 rotw 2 -40000bdf: 034930 rsr.windowstart a3 -40000be2: 034840 rsr.windowbase a4 -40000be5: 1239 s32i.n a3, a2, 4 -40000be7: 2249 s32i.n a4, a2, 8 -40000be9: 130c movi.n a3, 1 -40000beb: 040c movi.n a4, 0 -40000bed: 134930 wsr.windowstart a3 -40000bf0: 134840 wsr.windowbase a4 -40000bf3: 002010 rsync -40000bf6: fed711 l32r a1, 40000754 <_c_0x80000000+0x1c> -40000bf9: 000c movi.n a0, 0 -40000bfb: fed821 l32r a2, 4000075c <_c_0x80000000+0x24> -40000bfe: 13e620 wsr.ps a2 -40000c01: 002010 rsync -40000c04: 0303e0 rsr.sar a14 -40000c07: 01e9 s32i.n a14, a1, 0 -40000c09: 0302e0 rsr.lcount a14 -40000c0c: a1e9 s32i.n a14, a1, 40 -40000c0e: 0300e0 rsr.lbeg a14 -40000c11: b1e9 s32i.n a14, a1, 44 -40000c13: 0301e0 rsr.lend a14 -40000c16: c1e9 s32i.n a14, a1, 48 -40000c18: 0310e0 rsr.acclo a14 -40000c1b: 81e9 s32i.n a14, a1, 32 -40000c1d: 0311e0 rsr.acchi a14 -40000c20: 91e9 s32i.n a14, a1, 36 -40000c22: fecfd1 l32r a13, 40000760 <_c_0x40000000> -40000c25: fec5c1 l32r a12, 4000073c <_c_0x80000000+0x4> -40000c28: 13e3d0 wsr.intclear a13 -40000c2b: 2cd8 l32i.n a13, a12, 8 -40000c2d: 3c68 l32i.n a6, a12, 12 -40000c2f: 000dd0 callx4 a13 -40000c32: a1d8 l32i.n a13, a1, 40 -40000c34: b1e8 l32i.n a14, a1, 44 -40000c36: c1f8 l32i.n a15, a1, 48 -40000c38: 1302d0 wsr.lcount a13 -40000c3b: 1300e0 wsr.lbeg a14 -40000c3e: 1301f0 wsr.lend a15 -40000c41: 81d8 l32i.n a13, a1, 32 -40000c43: 91e8 l32i.n a14, a1, 36 -40000c45: 1310d0 wsr.acclo a13 -40000c48: 1311e0 wsr.acchi a14 -40000c4b: 01f8 l32i.n a15, a1, 0 -40000c4d: 1303f0 wsr.sar a15 -40000c50: 423c movi.n a2, 52 -40000c52: 13e620 wsr.ps a2 -40000c55: 002010 rsync -40000c58: 1128 l32i.n a2, a1, 4 -40000c5a: 2138 l32i.n a3, a1, 8 -40000c5c: 134920 wsr.windowstart a2 -40000c5f: 134830 wsr.windowbase a3 -40000c62: 002010 rsync -40000c65: febb11 l32r a1, 40000754 <_c_0x80000000+0x1c> -40000c68: 863c movi.n a6, 56 -40000c6a: e0c172 addi a7, a1, -32 -40000c6d: f8c6e2 addi a14, a6, -8 -40000c70: 20c7f2 addi a15, a7, 32 -40000c73: 112f42 l32i a4, a15, 68 -40000c76: 122f52 l32i a5, a15, 72 -40000c79: 132f62 l32i a6, a15, 76 -40000c7c: 142f72 l32i a7, a15, 80 -40000c7f: 152f82 l32i a8, a15, 84 -40000c82: 162f92 l32i a9, a15, 88 -40000c85: 172fa2 l32i a10, a15, 92 -40000c88: 182fb2 l32i a11, a15, 96 -40000c8b: 408020 rotw 2 -40000c8e: fdb656 bnez a6, 40000c6d <_X_start+0x4c1> -40000c91: 192742 l32i a4, a7, 100 -40000c94: 1a2752 l32i a5, a7, 104 -40000c97: 1b2762 l32i a6, a7, 108 -40000c9a: 1c2772 l32i a7, a7, 112 -40000c9d: 408020 rotw 2 -40000ca0: 3128 l32i.n a2, a1, 12 -40000ca2: 4138 l32i.n a3, a1, 16 -40000ca4: 13b120 wsr.epc1 a2 -40000ca7: 13e830 wsr.exccause a3 -40000caa: 5128 l32i.n a2, a1, 20 -40000cac: 13ee20 wsr.excvaddr a2 -40000caf: 6138 l32i.n a3, a1, 24 -40000cb1: 13d130 wsr.excsave1 a3 -40000cb4: d108 l32i.n a0, a1, 52 -40000cb6: f128 l32i.n a2, a1, 60 -40000cb8: 102132 l32i a3, a1, 64 -40000cbb: e118 l32i.n a1, a1, 56 -40000cbd: 003410 rfi 4 -40000cc0: fea921 l32r a2, 40000764 <_c_0x40000000+0x4> -40000cc3: d209 s32i.n a0, a2, 52 -40000cc5: fea801 l32r a0, 40000768 <_c_0x40000000+0x8> -40000cc8: e219 s32i.n a1, a2, 56 -40000cca: 0008 l32i.n a0, a0, 0 -40000ccc: 106232 s32i a3, a2, 64 -40000ccf: 61d500 xsr.excsave5 a0 -40000cd2: 116242 s32i a4, a2, 68 -40000cd5: f209 s32i.n a0, a2, 60 -40000cd7: 03b130 rsr.epc1 a3 -40000cda: 03e840 rsr.exccause a4 -40000cdd: 3239 s32i.n a3, a2, 12 -40000cdf: 4249 s32i.n a4, a2, 16 -40000ce1: 03ee30 rsr.excvaddr a3 -40000ce4: 056232 s32i a3, a2, 20 -40000ce7: 03d140 rsr.excsave1 a4 -40000cea: 6249 s32i.n a4, a2, 24 -40000cec: 38a002 movi a0, 56 -40000cef: 126252 s32i a5, a2, 72 -40000cf2: 136262 s32i a6, a2, 76 -40000cf5: 146272 s32i a7, a2, 80 -40000cf8: 156282 s32i a8, a2, 84 -40000cfb: 166292 s32i a9, a2, 88 -40000cfe: 1762a2 s32i a10, a2, 92 -40000d01: 1862b2 s32i a11, a2, 96 -40000d04: 1962c2 s32i a12, a2, 100 -40000d07: 1a62d2 s32i a13, a2, 104 -40000d0a: 1b62e2 s32i a14, a2, 108 -40000d0d: 1c62f2 s32i a15, a2, 112 -40000d10: f8c082 addi a8, a0, -8 -40000d13: 20c2a2 addi a10, a2, 32 -40000d16: 408020 rotw 2 -40000d19: fdb056 bnez a0, 40000cf8 <_X_start+0x54c> -40000d1c: 408020 rotw 2 -40000d1f: 034930 rsr.windowstart a3 -40000d22: 034840 rsr.windowbase a4 -40000d25: 1239 s32i.n a3, a2, 4 -40000d27: 2249 s32i.n a4, a2, 8 -40000d29: 130c movi.n a3, 1 -40000d2b: 040c movi.n a4, 0 -40000d2d: 134930 wsr.windowstart a3 -40000d30: 134840 wsr.windowbase a4 -40000d33: 002010 rsync -40000d36: fe8b11 l32r a1, 40000764 <_c_0x40000000+0x4> -40000d39: 000c movi.n a0, 0 -40000d3b: fe8c21 l32r a2, 4000076c <_c_0x40000000+0xc> -40000d3e: 13e620 wsr.ps a2 -40000d41: 002010 rsync -40000d44: 0303e0 rsr.sar a14 -40000d47: 01e9 s32i.n a14, a1, 0 -40000d49: 0302e0 rsr.lcount a14 -40000d4c: a1e9 s32i.n a14, a1, 40 -40000d4e: 0300e0 rsr.lbeg a14 -40000d51: b1e9 s32i.n a14, a1, 44 -40000d53: 0301e0 rsr.lend a14 -40000d56: c1e9 s32i.n a14, a1, 48 -40000d58: 0310e0 rsr.acclo a14 -40000d5b: 81e9 s32i.n a14, a1, 32 -40000d5d: 0311e0 rsr.acchi a14 -40000d60: 91e9 s32i.n a14, a1, 36 -40000d62: 03e2f0 rsr.interrupt a15 -40000d65: 03e4c0 rsr.intenable a12 -40000d68: fe82d1 l32r a13, 40000770 <_c_0x40000000+0x10> -40000d6b: 10ffc0 and a15, a15, a12 -40000d6e: 10ffd0 and a15, a15, a13 -40000d71: 02af16 beqz a15, 40000d9f <_X_start+0x5f3> -40000d74: 60e0f0 neg a14, a15 -40000d77: 10eef0 and a14, a14, a15 -40000d7a: 13e3e0 wsr.intclear a14 -40000d7d: fe6fc1 l32r a12, 4000073c <_c_0x80000000+0x4> -40000d80: 40fee0 nsau a14, a14 -40000d83: b0cec0 addx8 a12, a14, a12 -40000d86: 0cd8 l32i.n a13, a12, 0 -40000d88: 1c68 l32i.n a6, a12, 4 -40000d8a: 000dd0 callx4 a13 -40000d8d: 03e2f0 rsr.interrupt a15 -40000d90: 03e4c0 rsr.intenable a12 -40000d93: fe77d1 l32r a13, 40000770 <_c_0x40000000+0x10> -40000d96: 10ffc0 and a15, a15, a12 -40000d99: 10ffd0 and a15, a15, a13 -40000d9c: fd4f56 bnez a15, 40000d74 <_X_start+0x5c8> -40000d9f: a1d8 l32i.n a13, a1, 40 -40000da1: b1e8 l32i.n a14, a1, 44 -40000da3: c1f8 l32i.n a15, a1, 48 -40000da5: 1302d0 wsr.lcount a13 -40000da8: 1300e0 wsr.lbeg a14 -40000dab: 1301f0 wsr.lend a15 -40000dae: 81d8 l32i.n a13, a1, 32 -40000db0: 91e8 l32i.n a14, a1, 36 -40000db2: 1310d0 wsr.acclo a13 -40000db5: 1311e0 wsr.acchi a14 -40000db8: 01f8 l32i.n a15, a1, 0 -40000dba: 1303f0 wsr.sar a15 -40000dbd: 523c movi.n a2, 53 -40000dbf: 13e620 wsr.ps a2 -40000dc2: 002010 rsync -40000dc5: 1128 l32i.n a2, a1, 4 -40000dc7: 022132 l32i a3, a1, 8 -40000dca: 134920 wsr.windowstart a2 -40000dcd: 134830 wsr.windowbase a3 -40000dd0: 002010 rsync -40000dd3: fe6411 l32r a1, 40000764 <_c_0x40000000+0x4> -40000dd6: 38a062 movi a6, 56 -40000dd9: e0c172 addi a7, a1, -32 -40000ddc: f8c6e2 addi a14, a6, -8 -40000ddf: 20c7f2 addi a15, a7, 32 -40000de2: 112f42 l32i a4, a15, 68 -40000de5: 122f52 l32i a5, a15, 72 -40000de8: 132f62 l32i a6, a15, 76 -40000deb: 142f72 l32i a7, a15, 80 -40000dee: 152f82 l32i a8, a15, 84 -40000df1: 162f92 l32i a9, a15, 88 -40000df4: 172fa2 l32i a10, a15, 92 -40000df7: 182fb2 l32i a11, a15, 96 -40000dfa: 408020 rotw 2 -40000dfd: fdb656 bnez a6, 40000ddc <_X_start+0x630> -40000e00: 192742 l32i a4, a7, 100 -40000e03: 1a2752 l32i a5, a7, 104 -40000e06: 1b2762 l32i a6, a7, 108 -40000e09: 1c2772 l32i a7, a7, 112 -40000e0c: 408020 rotw 2 -40000e0f: 3128 l32i.n a2, a1, 12 -40000e11: 4138 l32i.n a3, a1, 16 -40000e13: 13b120 wsr.epc1 a2 -40000e16: 13e830 wsr.exccause a3 -40000e19: 5128 l32i.n a2, a1, 20 -40000e1b: 13ee20 wsr.excvaddr a2 -40000e1e: 6138 l32i.n a3, a1, 24 -40000e20: 13d130 wsr.excsave1 a3 -40000e23: d108 l32i.n a0, a1, 52 -40000e25: f128 l32i.n a2, a1, 60 -40000e27: 102132 l32i a3, a1, 64 -40000e2a: e118 l32i.n a1, a1, 56 -40000e2c: 003510 rfi 5 -40000e2f: 320c00 orbc b0, b12, b0 -40000e32: 000286 j 40000e40 <_X_start+0x694> -40000e35: 000000 ill -40000e38: fdc332 addi a3, a3, -3 -40000e3b: 332a add.n a3, a3, a2 -40000e3d: 0004c6 j 40000e54 <_X_start+0x6a8> -40000e40: 7159 s32i.n a5, a1, 28 -40000e42: 086122 s32i a2, a1, 32 -40000e45: 03e620 rsr.ps a2 -40000e48: fe3731 l32r a3, 40000724 <_c_bss_end+0x18> -40000e4b: 016122 s32i a2, a1, 4 -40000e4e: 342020 extui a2, a2, 0, 4 -40000e51: e342f6 bgeui a2, 4, 40000e38 <_X_start+0x68c> -40000e54: 03b120 rsr.epc1 a2 -40000e57: 13e630 wsr.ps a3 -40000e5a: 0129 s32i.n a2, a1, 0 -40000e5c: 3b2122 l32i a2, a1, 236 -40000e5f: 01d112 addmi a1, a1, 0x100 -40000e62: 002010 rsync -40000e65: fe3241 l32r a4, 40000730 <_c_bss_end+0x24> -40000e68: 203430 or a3, a4, a3 -40000e6b: 904430 addx2 a4, a4, a3 -40000e6e: 020136 entry a1, 0x100 -40000e71: 0303c0 rsr.sar a12 -40000e74: 11d8 l32i.n a13, a1, 4 -40000e76: 03e6e0 rsr.ps a14 -40000e79: 34d0d0 extui a13, a13, 0, 4 -40000e7c: 34f0e0 extui a15, a14, 0, 4 -40000e7f: 30eef0 xor a14, a14, a15 -40000e82: 30eed0 xor a14, a14, a13 -40000e85: 13e6e0 wsr.ps a14 -40000e88: fe23d1 l32r a13, 40000714 <_c_bss_end+0x8> -40000e8b: 81f8 l32i.n a15, a1, 32 -40000e8d: 21c9 s32i.n a12, a1, 8 -40000e8f: 0302c0 rsr.lcount a12 -40000e92: 0300e0 rsr.lbeg a14 -40000e95: 91c9 s32i.n a12, a1, 36 -40000e97: 0301c0 rsr.lend a12 -40000e9a: a1e9 s32i.n a14, a1, 40 -40000e9c: b1c9 s32i.n a12, a1, 44 -40000e9e: 0310c0 rsr.acclo a12 -40000ea1: 0311e0 rsr.acchi a14 -40000ea4: c1c9 s32i.n a12, a1, 48 -40000ea6: d1e9 s32i.n a14, a1, 52 -40000ea8: a0cfd0 addx4 a12, a15, a13 -40000eab: 0cc8 l32i.n a12, a12, 0 -40000ead: 01ed mov.n a14, a1 -40000eaf: 1c8c beqz.n a12, 40000eb4 <_X_start+0x708> -40000eb1: 000cf0 callx12 a12 -40000eb4: 91d8 l32i.n a13, a1, 36 -40000eb6: a1e8 l32i.n a14, a1, 40 -40000eb8: b1f8 l32i.n a15, a1, 44 -40000eba: 1302d0 wsr.lcount a13 -40000ebd: 1300e0 wsr.lbeg a14 -40000ec0: 1301f0 wsr.lend a15 -40000ec3: c1d8 l32i.n a13, a1, 48 -40000ec5: d1e8 l32i.n a14, a1, 52 -40000ec7: 1310d0 wsr.acclo a13 -40000eca: 1311e0 wsr.acchi a14 -40000ecd: 21e8 l32i.n a14, a1, 8 -40000ecf: 0063c0 rsil a12, 3 -40000ed2: 1303e0 wsr.sar a14 -40000ed5: fe1a01 l32r a0, 40000740 <_c_0x80000000+0x8> -40000ed8: fe16d1 l32r a13, 40000730 <_c_bss_end+0x24> -40000edb: 2000d0 or a0, a0, a13 -40000ede: 900d00 addx2 a0, a13, a0 -40000ee1: f01d retw.n -40000ee3: 413600 srli a3, a0, 6 -40000ee6: 234100 sext a4, a1, 7 -40000ee9: fe .byte 0xfe -40000eea: 0448 l32i.n a4, a4, 0 -40000eec: 030c movi.n a3, 0 -40000eee: 2a6422 s32i a2, a4, 168 -40000ef1: 2b6432 s32i a3, a4, 172 -40000ef4: f01d retw.n -40000ef6: 360000 excw -40000ef9: 610041 l32r a4, 3ffd92fc <_start-0x26d04> -40000efc: 1e .byte 0x1e -40000efd: fe .byte 0xfe -40000efe: fe1e81 l32r a8, 40000778 <_c_0x40000000+0x18> -40000f01: 0668 l32i.n a6, a6, 0 -40000f03: fe1e51 l32r a5, 4000077c <_c_0x40000000+0x1c> -40000f06: 2b2672 l32i a7, a6, 172 -40000f09: 2a2642 l32i a4, a6, 168 -40000f0c: 827750 mull a7, a7, a5 -40000f0f: 828480 mull a8, a4, a8 -40000f12: 822450 mull a2, a4, a5 -40000f15: a24450 muluh a4, a4, a5 -40000f18: 521b addi.n a5, a2, 1 -40000f1a: 448a add.n a4, a4, a8 -40000f1c: 447a add.n a4, a4, a7 -40000f1e: 0fb527 bgeu a5, a2, 40000f31 <_X_start+0x785> -40000f21: 2a6652 s32i a5, a6, 168 -40000f24: 241b addi.n a2, a4, 1 -40000f26: fe1631 l32r a3, 40000780 <_c_0x7fffffff> -40000f29: 2b6622 s32i a2, a6, 172 -40000f2c: 102230 and a2, a2, a3 -40000f2f: f01d retw.n -40000f31: 2a6652 s32i a5, a6, 168 -40000f34: fe1321 l32r a2, 40000780 <_c_0x7fffffff> -40000f37: 2b6642 s32i a4, a6, 172 -40000f3a: 102420 and a2, a4, a2 -40000f3d: f01d retw.n -40000f3f: d81000 excw -40000f42: ff .byte 0xff -40000f43: 3f .byte 0x3f -40000f44: 004136 entry a1, 32 -40000f47: fffe41 l32r a4, 40000f40 <_X_start+0x794> -40000f4a: 1439 s32i.n a3, a4, 4 -40000f4c: 0429 s32i.n a2, a4, 0 -40000f4e: f01d retw.n - -40000f50 <_c_0x3fffd820>: -40000f50: ffd820 excw -40000f53: 3f .byte 0x3f - -40000f54 <_X_ets_task>: -40000f54: 004136 entry a1, 32 -40000f57: 160c movi.n a6, 1 -40000f59: 090c movi.n a9, 0 -40000f5b: fffd71 l32r a7, 40000f50 <_c_0x3fffd820> -40000f5e: 1183c0 slli a8, a3, 4 -40000f61: 778a add.n a7, a7, a8 -40000f63: 830b addi.n a8, a3, -1 -40000f65: f0c772 addi a7, a7, -16 -40000f68: 0729 s32i.n a2, a7, 0 -40000f6a: 1749 s32i.n a4, a7, 4 -40000f6c: 084752 s8i a5, a7, 8 -40000f6f: 094792 s8i a9, a7, 9 -40000f72: 0a4792 s8i a9, a7, 10 -40000f75: 0b4792 s8i a9, a7, 11 -40000f78: 401800 ssl a8 -40000f7b: a16600 sll a6, a6 -40000f7e: 3769 s32i.n a6, a7, 12 -40000f80: f01d retw.n - ... - -40000f84 <_XX_unk0f84>: -40000f84: 004136 entry a1, 32 -40000f87: f01d retw.n -40000f89: 000000 ill -40000f8c: 004136 entry a1, 32 -40000f8f: ffff65 call8 40000f84 <_XX_unk0f84> -40000f92: 0008a5 call8 4000101c <_XX_unk0f96+0x84> -40000f95: f01d retw.n - ... - -40000f98 <_XX_unk0f96>: -40000f98: 004136 entry a1, 32 -40000f9b: 0010e5 call8 400010a8 <_X_ets_enter_critical> -40000f9e: ffeca1 l32r a10, 40000f50 <_c_0x3fffd820> -40000fa1: 11b2c0 slli a11, a2, 4 -40000fa4: aaba add.n a10, a10, a11 -40000fa6: ffdac2 addmi a12, a10, 0xffffff00 -40000fa9: f80cd2 l8ui a13, a12, 248 -40000fac: fb0c82 l8ui a8, a12, 251 -40000faf: f0cab2 addi a11, a10, -16 -40000fb2: 4eb8d7 bgeu a8, a13, 40001004 <_XX_unk0f96+0x6c> -40000fb5: 090b82 l8ui a8, a11, 9 -40000fb8: 1b98 l32i.n a9, a11, 4 -40000fba: f81b addi.n a15, a8, 1 -40000fbc: b08890 addx8 a8, a8, a9 -40000fbf: 0839 s32i.n a3, a8, 0 -40000fc1: 1849 s32i.n a4, a8, 4 -40000fc3: 094bf2 s8i a15, a11, 9 -40000fc6: f90ce2 l8ui a14, a12, 249 -40000fc9: ffdaa2 addmi a10, a10, 0xffffff00 -40000fcc: 049de7 bne a13, a14, 40000fd4 <_XX_unk0f96+0x3c> -40000fcf: 0c0c movi.n a12, 0 -40000fd1: 094bc2 s8i a12, a11, 9 -40000fd4: 0b0be2 l8ui a14, a11, 11 -40000fd7: 01cee2 addi a14, a14, 1 -40000fda: 0b4be2 s8i a14, a11, 11 -40000fdd: fb0ad2 l8ui a13, a10, 251 -40000fe0: 091d26 beqi a13, 1, 40000fed <_XX_unk0f96+0x55> -40000fe3: 000da5 call8 400010bc <_X_ets_exit_critical> -40000fe6: 00a022 movi a2, 0 -40000fe9: 000090 retw -40000fec: d48100 extui a8, a0, 1, 14 -40000fef: ff .byte 0xff -40000ff0: 3f2af2 l32i a15, a10, 252 -40000ff3: 022892 l32i a9, a8, 8 -40000ff6: 20ff90 or a15, a15, a9 -40000ff9: 0268f2 s32i a15, a8, 8 -40000ffc: 000be5 call8 400010bc <_X_ets_exit_critical> -40000fff: 00a022 movi a2, 0 -40001002: f01d retw.n -40001004: 000b65 call8 400010bc <_X_ets_exit_critical> -40001007: 120c movi.n a2, 1 -40001009: f01d retw.n -4000100b: 413600 srli a3, a0, 6 -4000100e: f23000 rems a3, a0, a0 -40001011: 022c40 andb b2, b12, b4 -40001014: c02230 sub a2, a2, a3 -40001017: 742020 extui a2, a2, 0, 8 -4000101a: f01d retw.n -4000101c: 004136 entry a1, 32 -4000101f: f77c movi.n a7, -1 -40001021: ffc731 l32r a3, 40000f40 <_X_start+0x794> -40001024: 060c movi.n a6, 0 -40001026: 10c352 addi a5, a3, 16 -40001029: 000406 j 4000103d <_XX_unk0f96+0xa5> -4000102c: 201110 or a1, a1, a1 -4000102f: 0008e5 call8 400010bc <_X_ets_exit_critical> -40001032: ffd282 addmi a8, a2, 0xffffff00 -40001035: 3c2882 l32i a8, a8, 240 -40001038: 04ad mov.n a10, a4 -4000103a: 0008e0 callx8 a8 -4000103d: 0006a5 call8 400010a8 <_X_ets_enter_critical> -40001040: 23a8 l32i.n a10, a3, 8 -40001042: fffca5 call8 4000100c <_XX_unk0f96+0x74> -40001045: 048a16 beqz a10, 40001091 <_XX_unk0f96+0xf9> -40001048: 112ac0 slli a2, a10, 4 -4000104b: 252a add.n a2, a5, a2 -4000104d: f0c2a2 addi a10, a2, -16 -40001050: ffd2b2 addmi a11, a2, 0xffffff00 -40001053: f80b92 l8ui a9, a11, 248 -40001056: 3d2b82 l32i a8, a11, 244 -40001059: 0a0ac2 l8ui a12, a10, 10 -4000105c: fa0b42 l8ui a4, a11, 250 -4000105f: cc1b addi.n a12, a12, 1 -40001061: 0a4ac2 s8i a12, a10, 10 -40001064: fa0bb2 l8ui a11, a11, 250 -40001067: b04480 addx8 a4, a4, a8 -4000106a: 0299b7 bne a9, a11, 40001070 <_XX_unk0f96+0xd8> -4000106d: 0a4a62 s8i a6, a10, 10 -40001070: 0b0ab2 l8ui a11, a10, 11 -40001073: ffd292 addmi a9, a2, 0xffffff00 -40001076: bb0b addi.n a11, a11, -1 -40001078: 0b4ab2 s8i a11, a10, 11 -4000107b: fb0982 l8ui a8, a9, 251 -4000107e: 3f29d2 l32i a13, a9, 252 -40001081: fa7856 bnez a8, 4000102c <_XX_unk0f96+0x94> -40001084: 23c8 l32i.n a12, a3, 8 -40001086: 30dd70 xor a13, a13, a7 -40001089: 10ccd0 and a12, a12, a13 -4000108c: 23c9 s32i.n a12, a3, 8 -4000108e: ffe686 j 4000102c <_XX_unk0f96+0x94> -40001091: 03b8 l32i.n a11, a3, 0 -40001093: 005b16 beqz a11, 4000109c <_XX_unk0f96+0x104> -40001096: 0123a2 l32i a10, a3, 4 -40001099: 000be0 callx8 a11 -4000109c: 000365 call8 400010d4 <_X_ets_exit_critical_and_wait_int> -4000109f: ffe686 j 4000103d <_XX_unk0f96+0xa5> - ... - -400010a4 <_c_ets_critical_level>: -400010a4: ffda20 excw -400010a7: 3f .byte 0x3f - -400010a8 <_X_ets_enter_critical>: -400010a8: 004136 entry a1, 32 -400010ab: fffe31 l32r a3, 400010a4 <_c_ets_critical_level> -400010ae: 006220 rsil a2, 2 -400010b1: 0388 l32i.n a8, a3, 0 -400010b3: 881b addi.n a8, a8, 1 -400010b5: 0389 s32i.n a8, a3, 0 -400010b7: f01d retw.n -400010b9: 000000 ill - -400010bc <_X_ets_exit_critical>: -400010bc: 004136 entry a1, 32 -400010bf: fff931 l32r a3, 400010a4 <_c_ets_critical_level> -400010c2: 0328 l32i.n a2, a3, 0 -400010c4: 220b addi.n a2, a2, -1 -400010c6: 0329 s32i.n a2, a3, 0 -400010c8: 028c beqz.n a2, 400010cc <_X_ets_exit_critical+0x10> -400010ca: f01d retw.n -400010cc: 006080 rsil a8, 0 -400010cf: f01d retw.n -400010d1: 000000 ill - -400010d4 <_X_ets_exit_critical_and_wait_int>: -400010d4: 004136 entry a1, 32 -400010d7: fff331 l32r a3, 400010a4 <_c_ets_critical_level> -400010da: 0328 l32i.n a2, a3, 0 -400010dc: 220b addi.n a2, a2, -1 -400010de: 0329 s32i.n a2, a3, 0 -400010e0: 007000 waiti 0 -400010e3: f01d retw.n -400010e5: 000000 ill - -400010e8 <_X_ets_isr_attach>: -400010e8: 004136 entry a1, 32 -400010eb: 04cd mov.n a12, a4 -400010ed: 03bd mov.n a11, a3 -400010ef: 02ad mov.n a10, a2 -400010f1: 048e65 call8 400059d8 <_X_xtos_set_interrupt_handler_arg> -400010f4: f01d retw.n - ... - -400010f8 <_X_ets_isr_mask>: -400010f8: 004136 entry a1, 32 -400010fb: 02ad mov.n a10, a2 -400010fd: 0495a5 call8 40005a58 <_X_xtos_ints_off> -40001100: f01d retw.n - ... - -40001104 <_X_ets_isr_unmask>: -40001104: 004136 entry a1, 32 -40001107: 02ad mov.n a10, a2 -40001109: 0492a5 call8 40005a34 <_X_xtos_ints_on> -4000110c: f01d retw.n - ... - -40001110 <_c_0x3fffda30>: -40001110: ffda30 excw -40001113: 3f .byte 0x3f - -40001114 <_XX_set_0x3fffda30_0>: -40001114: 004136 entry a1, 32 -40001117: fffe31 l32r a3, 40001110 <_c_0x3fffda30> -4000111a: 0329 s32i.n a2, a3, 0 -4000111c: f01d retw.n - ... - -40001120 <_XX_set_0x3fffda30_4>: -40001120: 004136 entry a1, 32 -40001123: fffb31 l32r a3, 40001110 <_c_0x3fffda30> -40001126: 1329 s32i.n a2, a3, 4 -40001128: f01d retw.n - ... - -4000112c <_c_0xfffdffff>: -4000112c: ff .byte 0xff -4000112d: ff .byte 0xff -4000112e: fffd excw - -40001130 <_c_0x60003e00>: -40001130: 003e00 excw -40001133: 820060 mull a0, a0, a6 - -40001134 <_c_0x60008200>: -40001134: 008200 any4 b0, b0:b1:b2:b3 -40001137: 7e0060 excw - -40001138 <_c_0x60007e00>: -40001138: 007e00 waiti 14 -4000113b: 100060 and a0, a0, a6 - -4000113c <_c_0x1000>: -4000113c: 001000 movsp a0, a0 - ... - -40001140 <_s_fw_build>: -40001140: ca7c movi.n a10, -4 -40001142: ff .byte 0xff -40001143: 3f .byte 0x3f - -40001144 <_s_boot_banner>: -40001144: ffca54 excw -40001147: 3f .byte 0x3f - -40001148 <_s_pct_s_pct_u>: -40001148: ca88 l32i.n a8, a10, 48 -4000114a: ff .byte 0xff -4000114b: 3f .byte 0x3f - -4000114c <_s_ets_main_c>: -4000114c: ffca90 excw -4000114f: 3f .byte 0x3f -40001150: 1d18 l32i.n a1, a13, 4 -40001152: 904000 addx2 a4, a0, a0 -40001155: 001d mov.n a1, a0 -40001157: ca9c40 depbits a4, a12, 12, 10 -4000115a: ff .byte 0xff -4000115b: 3f .byte 0x3f - -4000115c <_X_main>: -4000115c: 004136 entry a1, 32 -4000115f: 0177a5 call8 400028d8 <_X_get_rst_cause> -40001162: fff281 l32r a8, 4000112c <_c_0xfffdffff> -40001165: 00afe2 movi a14, 0xffffff00 -40001168: fff221 l32r a2, 40001130 <_c_0x60003e00> -4000116b: 871c movi.n a7, 24 -4000116d: fff1d1 l32r a13, 40001134 <_c_0x60008200> -40001170: 063c movi.n a6, 48 -40001172: 203aa0 or a3, a10, a10 -40001175: fff0b1 l32r a11, 40001138 <_c_0x60007e00> -40001178: 1aa0a2 movi a10, 26 -4000117b: 0020c0 memw -4000117e: a02bf2 l32i a15, a11, 0x280 -40001181: 10ff80 and a15, a15, a8 -40001184: 0020c0 memw -40001187: a06bf2 s32i a15, a11, 0x280 -4000118a: ffecc1 l32r a12, 4000113c <_c_0x1000> -4000118d: 0020c0 memw -40001190: a02b92 l32i a9, a11, 0x280 -40001193: 2099c0 or a9, a9, a12 -40001196: 0020c0 memw -40001199: a06b92 s32i a9, a11, 0x280 -4000119c: 0020c0 memw -4000119f: 8e2282 l32i a8, a2, 0x238 -400011a2: 174867 ball a8, a6, 400011bd <_X_main+0x61> -400011a5: 0020c0 memw -400011a8: 8e2292 l32i a9, a2, 0x238 -400011ab: 549090 extui a9, a9, 0, 6 -400011ae: 0b1977 beq a9, a7, 400011bd <_X_main+0x61> -400011b1: 0020c0 memw -400011b4: 8e22b2 l32i a11, a2, 0x238 -400011b7: 54b0b0 extui a11, a11, 0, 6 -400011ba: 0e9ba7 bne a11, a10, 400011cc <_X_main+0x70> -400011bd: 0020c0 memw -400011c0: 9d2dc2 l32i a12, a13, 0x274 -400011c3: 10cce0 and a12, a12, a14 -400011c6: 0020c0 memw -400011c9: 9d6dc2 s32i a12, a13, 0x274 -400011cc: 0020c0 memw -400011cf: 8e22f2 l32i a15, a2, 0x238 -400011d2: f03d nop.n -400011d4: 10ff60 and a15, a15, a6 -400011d7: 6bcf66 bnei a15, 32, 40001246 <_X_main+0xea> -400011da: fd6991 l32r a9, 40000780 <_c_0x7fffffff> -400011dd: 0020c0 memw -400011e0: a52dc2 l32i a12, a13, 0x294 -400011e3: 10cc90 and a12, a12, a9 -400011e6: 0020c0 memw -400011e9: a56dc2 s32i a12, a13, 0x294 -400011ec: 0020c0 memw -400011ef: a62db2 l32i a11, a13, 0x298 -400011f2: 10bb90 and a11, a11, a9 -400011f5: 0020c0 memw -400011f8: a66db2 s32i a11, a13, 0x298 -400011fb: 0020c0 memw -400011fe: a72d82 l32i a8, a13, 0x29c -40001201: 108890 and a8, a8, a9 -40001204: 0020c0 memw -40001207: a76d82 s32i a8, a13, 0x29c -4000120a: 0020c0 memw -4000120d: a82df2 l32i a15, a13, 0x2a0 -40001210: 10ff90 and a15, a15, a9 -40001213: 0020c0 memw -40001216: a86df2 s32i a15, a13, 0x2a0 -40001219: 0020c0 memw -4000121c: a92dc2 l32i a12, a13, 0x2a4 -4000121f: 10cc90 and a12, a12, a9 -40001222: 0020c0 memw -40001225: a96dc2 s32i a12, a13, 0x2a4 -40001228: 0020c0 memw -4000122b: aa2db2 l32i a11, a13, 0x2a8 -4000122e: 10bb90 and a11, a11, a9 -40001231: 0020c0 memw -40001234: aa6db2 s32i a11, a13, 0x2a8 -40001237: 0020c0 memw -4000123a: ab2d82 l32i a8, a13, 0x2ac -4000123d: 108890 and a8, a8, a9 -40001240: 0020c0 memw -40001243: ab6d82 s32i a8, a13, 0x2ac -40001246: 950c movi.n a5, 9 -40001248: b40c movi.n a4, 11 -4000124a: 8c2c movi.n a12, 40 -4000124c: eb2c movi.n a11, 46 -4000124e: 0020c0 memw -40001251: 8e22f2 l32i a15, a2, 0x238 -40001254: 020fc7 bnone a15, a12, 4000125a <_l_strap_0x0xxx> -40001257: 006a86 j 40001405 <_l_strap_NxNxxx> - -4000125a <_l_strap_0x0xxx>: -4000125a: 0020c0 memw -4000125d: 9d2d82 l32i a8, a13, 0x274 -40001260: 1088e0 and a8, a8, a14 -40001263: 0020c0 memw -40001266: 9d6d82 s32i a8, a13, 0x274 - -40001269 <_l_strap_init_uart0>: -40001269: 020da5 call8 40003344 <_X_uart_attach> -4000126c: 00a0a2 movi a10, 0 -4000126f: 022c65 call8 40003534 <_X_uart_init> -40001272: 015125 call8 40002784 <_X_ets_install_uart_printf> -40001275: ba2c movi.n a10, 43 -40001277: 0020c0 memw -4000127a: 8e2292 l32i a9, a2, 0x238 -4000127d: 1099a0 and a9, a9, a10 -40001280: fec992 addi a9, a9, -2 -40001283: 25f916 beqz a9, 400014e6 <_l_strap_0x0x10> -40001286: 0020c0 memw -40001289: 8e22b2 l32i a11, a2, 0x238 -4000128c: 54b0b0 extui a11, a11, 0, 6 -4000128f: c0bb40 sub a11, a11, a4 -40001292: 233b16 beqz a11, 400014c9 <_l_strap_0x0x11_loader> -40001295: 0020c0 memw -40001298: 8e22c2 l32i a12, a2, 0x238 -4000129b: 10cca0 and a12, a12, a10 -4000129e: fdccc2 addi a12, a12, -3 -400012a1: 224c16 beqz a12, 400014c9 <_l_strap_0x0x11_loader> -400012a4: 0020c0 memw -400012a7: 8e22d2 l32i a13, a2, 0x238 -400012aa: 340da7 bnone a13, a10, 400012e2 <_l_strap_0x0x00> -400012ad: 0020c0 memw -400012b0: 8e22e2 l32i a14, a2, 0x238 -400012b3: 54e0e0 extui a14, a14, 0, 6 -400012b6: c0ee50 sub a14, a14, a5 -400012b9: 217e16 beqz a14, 400014d4 <_l_strap_0x0x01> -400012bc: 0020c0 memw -400012bf: 8e22f2 l32i a15, a2, 0x238 -400012c2: 10ffa0 and a15, a15, a10 -400012c5: ff0b addi.n a15, a15, -1 -400012c7: 209f16 beqz a15, 400014d4 <_l_strap_0x0x01> -400012ca: 0020c0 memw -400012cd: 8e2282 l32i a8, a2, 0x238 -400012d0: 548080 extui a8, a8, 0, 6 -400012d3: 139866 bnei a8, 10, 400012ea <_l_boot> -400012d6: 04a0a2 movi a10, 4 -400012d9: 03e965 call8 40005170 <_X_sip_init_attach> -400012dc: 000286 j 400012ea <_l_boot> -400012df: 000000 ill - -400012e2 <_l_strap_0x0x00>: -400012e2: 0a0c movi.n a10, 0 -400012e4: 201110 or a1, a1, a1 -400012e7: 03e8a5 call8 40005170 <_X_sip_init_attach> - -400012ea <_l_boot>: -400012ea: 20c330 or a12, a3, a3 -400012ed: ff94b1 l32r a11, 40001140 <_s_fw_build> -400012f0: ff95a1 l32r a10, 40001144 <_s_boot_banner> -400012f3: 0020c0 memw -400012f6: 8e22d2 l32i a13, a2, 0x238 -400012f9: 54d0d0 extui a13, a13, 0, 6 -400012fc: 015065 call8 40002804 <ets_printf> -400012ff: 009ea5 call8 40001ce8 <_X_print_mem_banner> -40001302: 0da0a2 movi a10, 13 -40001305: ff8251 l32r a5, 40001110 <_c_0x3fffda30> -40001308: 0233f6 bgeui a3, 3, 4000130e <_l_boot+0x24> -4000130b: 033356 bnez a3, 40001342 <_l_rst_cause_12> -4000130e: 0263f6 bgeui a3, 6, 40001314 <_l_boot+0x2a> -40001311: 2133f6 bgeui a3, 3, 40001336 <_l_rst_cause_345> -40001314: ae0c movi.n a14, 10 -40001316: 023e37 bltu a14, a3, 4000131c <_l_boot+0x32> -40001319: 1973f6 bgeui a3, 7, 40001336 <_l_rst_cause_345> -4000131c: 023a37 bltu a10, a3, 40001322 <_l_boot+0x38> -4000131f: 24b347 bgeu a3, a4, 40001347 <_l_rst_cause_12+0x5> -40001322: 4f1c movi.n a15, 20 -40001324: 0e13f7 beq a3, a15, 40001336 <_l_rst_cause_345> -40001327: ff88a1 l32r a10, 40001148 <_s_pct_s_pct_u> -4000132a: ff88b1 l32r a11, 4000114c <_s_ets_main_c> -4000132d: 31a1c2 movi a12, 0x131 -40001330: 014d25 call8 40002804 <ets_printf> -40001333: ffff06 j 40001333 <_l_boot+0x49> - -40001336 <_l_rst_cause_345>: -40001336: 05ad mov.n a10, a5 -40001338: 03bd mov.n a11, a3 -4000133a: 0160e5 call8 40002948 <_XX_unk2948> -4000133d: 0588 l32i.n a8, a5, 0 -4000133f: 11b856 bnez a8, 4000145e <_l_strap_0010xx+0x12> - -40001342 <_l_rst_cause_12>: -40001342: 05ad mov.n a10, a5 -40001344: 001f65 call8 4000153c <_XX_unk153c> -40001347: 071347 beq a3, a4, 40001352 <_l_rst_cause_12+0x10> -4000134a: 04a326 beqi a3, 12, 40001352 <_l_rst_cause_12+0x10> -4000134d: d90c movi.n a9, 13 -4000134f: 4d9397 bne a3, a9, 400013a0 <_l_rst_cause_12+0x5e> -40001352: 1b2c movi.n a11, 33 -40001354: 0020c0 memw -40001357: 8e22a2 l32i a10, a2, 0x238 -4000135a: 02cab7 bnall a10, a11, 40001360 <_l_rst_cause_12+0x1e> -4000135d: 0058c6 j 400014c4 <_l_strap_001000_0x110x+0x14> -40001360: 0020c0 memw -40001363: 8e22c2 l32i a12, a2, 0x238 -40001366: 54c0c0 extui a12, a12, 0, 6 -40001369: c0cc70 sub a12, a12, a7 -4000136c: 154c16 beqz a12, 400014c4 <_l_strap_001000_0x110x+0x14> -4000136f: 0020c0 memw -40001372: 8e22d2 l32i a13, a2, 0x238 -40001375: 54d0d0 extui a13, a13, 0, 6 -40001378: e6cdd2 addi a13, a13, -26 -4000137b: 145d16 beqz a13, 400014c4 <_l_strap_001000_0x110x+0x14> -4000137e: 1b0c movi.n a11, 1 -40001380: 00a032 movi a3, 0 -40001383: 20a330 or a10, a3, a3 -40001386: 0020c0 memw -40001389: 8e22d2 l32i a13, a2, 0x238 -4000138c: 01a0c2 movi a12, 1 -4000138f: 10dd60 and a13, a13, a6 -40001392: e0cdd2 addi a13, a13, -32 -40001395: 83acd0 moveqz a10, a12, a13 -40001398: 74a0a0 extui a10, a10, 0, 8 -4000139b: 02fd65 call8 40004370 <_X_spi_flash_attach> -4000139e: 0539 s32i.n a3, a5, 0 -400013a0: 0020c0 memw -400013a3: 8e22e2 l32i a14, a2, 0x238 -400013a6: 46ee57 bbsi a14, 5, 400013f0 <_l_rst_cause_12+0xae> -400013a9: 0020c0 memw -400013ac: 8e22f2 l32i a15, a2, 0x238 -400013af: 54f0f0 extui a15, a15, 0, 6 -400013b2: 3a1f77 beq a15, a7, 400013f0 <_l_rst_cause_12+0xae> -400013b5: 0020c0 memw -400013b8: 8e2282 l32i a8, a2, 0x238 -400013bb: 1aa092 movi a9, 26 -400013be: 548080 extui a8, a8, 0, 6 -400013c1: 2b1897 beq a8, a9, 400013f0 <_l_rst_cause_12+0xae> -400013c4: 0020c0 memw -400013c7: 8e2292 l32i a9, a2, 0x238 -400013ca: 549090 extui a9, a9, 0, 6 -400013cd: 1a8926 beqi a9, 8, 400013eb <_l_rst_cause_12+0xa9> -400013d0: 0020c0 memw -400013d3: 8e22a2 l32i a10, a2, 0x238 -400013d6: 2ea0b2 movi a11, 46 -400013d9: 10aab0 and a10, a10, a11 -400013dc: 0baa26 beqi a10, 12, 400013eb <_l_rst_cause_12+0xa9> -400013df: 0020c0 memw -400013e2: 8e22c2 l32i a12, a2, 0x238 -400013e5: 28a0d2 movi a13, 40 -400013e8: 728cd7 bany a12, a13, 4000145e <_l_strap_0010xx+0x12> -400013eb: 05e8 l32i.n a14, a5, 0 -400013ed: 06de56 bnez a14, 4000145e <_l_strap_0010xx+0x12> -400013f0: 002f65 call8 400016e8 <_XX_unk153c+0x1ac> -400013f3: 067a16 beqz a10, 4000145e <_l_strap_0010xx+0x12> -400013f6: ff54a1 l32r a10, 40001148 <_s_pct_s_pct_u> -400013f9: ff54b1 l32r a11, 4000114c <_s_ets_main_c> -400013fc: 2ca1c2 movi a12, 0x12c -400013ff: 014065 call8 40002804 <ets_printf> -40001402: ffff06 j 40001402 <_l_rst_cause_12+0xc0> - -40001405 <_l_strap_NxNxxx>: -40001405: 0020c0 memw -40001408: 8e22f2 l32i a15, a2, 0x238 -4000140b: f03d nop.n -4000140d: 54f0f0 extui a15, a15, 0, 6 -40001410: f8cff2 addi a15, a15, -8 -40001413: 099f16 beqz a15, 400014b0 <_l_strap_001000_0x110x> -40001416: 0020c0 memw -40001419: 8e2282 l32i a8, a2, 0x238 -4000141c: 1088b0 and a8, a8, a11 -4000141f: f4c882 addi a8, a8, -12 -40001422: 08a816 beqz a8, 400014b0 <_l_strap_001000_0x110x> -40001425: 0020c0 memw -40001428: 8e2292 l32i a9, a2, 0x238 -4000142b: 549090 extui a9, a9, 0, 6 -4000142e: 1a1947 beq a9, a4, 4000144c <_l_strap_0010xx> -40001431: 0020c0 memw -40001434: 8e22b2 l32i a11, a2, 0x238 -40001437: 54b0b0 extui a11, a11, 0, 6 -4000143a: 0e9b26 beqi a11, 10, 4000144c <_l_strap_0010xx> -4000143d: 0020c0 memw -40001440: 8e22c2 l32i a12, a2, 0x238 -40001443: 54c0c0 extui a12, a12, 0, 6 -40001446: c0cc50 sub a12, a12, a5 -40001449: e1cc56 bnez a12, 40001269 <_l_strap_init_uart0> - -4000144c <_l_strap_0010xx>: -4000144c: 0020c0 memw -4000144f: 9d2df2 l32i a15, a13, 0x274 -40001452: 10ffe0 and a15, a15, a14 -40001455: 0020c0 memw -40001458: 9d6df2 s32i a15, a13, 0x274 -4000145b: ff8286 j 40001269 <_l_strap_init_uart0> -4000145e: 09a0a2 movi a10, 9 -40001461: ff3bb1 l32r a11, 40001150 <_s_ets_main_c+0x4> -40001464: ff3765 call8 400007dc <_X_start+0x30> -40001467: ff3b21 l32r a2, 40001154 <_s_ets_main_c+0x8> -4000146a: 0a0c movi.n a10, 0 -4000146c: 02bd mov.n a11, a2 -4000146e: ff36e5 call8 400007dc <_X_start+0x30> -40001471: 2a0c movi.n a10, 2 -40001473: 02bd mov.n a11, a2 -40001475: ff3665 call8 400007dc <_X_start+0x30> -40001478: 3a0c movi.n a10, 3 -4000147a: 02bd mov.n a11, a2 -4000147c: ff35e5 call8 400007dc <_X_start+0x30> -4000147f: ca1c movi.n a10, 28 -40001481: 02bd mov.n a11, a2 -40001483: ff35a5 call8 400007dc <_X_start+0x30> -40001486: da1c movi.n a10, 29 -40001488: 02bd mov.n a11, a2 -4000148a: ff3525 call8 400007dc <_X_start+0x30> -4000148d: 02bd mov.n a11, a2 -4000148f: 08a0a2 movi a10, 8 -40001492: ff34a5 call8 400007dc <_X_start+0x30> -40001495: 05a8 l32i.n a10, a5, 0 -40001497: 1a8c beqz.n a10, 4000149c <_l_strap_0010xx+0x50> -40001499: 000ae0 callx8 a10 -4000149c: ff2fa1 l32r a10, 40001158 <_s_ets_main_c+0xc> -4000149f: 013665 call8 40002804 <ets_printf> -400014a2: 0125a2 l32i a10, a5, 4 -400014a5: 033a16 beqz a10, 400014dc <_l_strap_0x0x01+0x8> -400014a8: 000ae0 callx8 a10 -400014ab: 00a022 movi a2, 0 -400014ae: f01d retw.n - -400014b0 <_l_strap_001000_0x110x>: -400014b0: c97c movi.n a9, -4 -400014b2: 0020c0 memw -400014b5: 9d2d82 l32i a8, a13, 0x274 -400014b8: 108890 and a8, a8, a9 -400014bb: 0020c0 memw -400014be: 9d6d82 s32i a8, a13, 0x274 -400014c1: ff6906 j 40001269 <_l_strap_init_uart0> -400014c4: 0b0c movi.n a11, 0 -400014c6: ffad86 j 40001380 <_l_rst_cause_12+0x3e> - -400014c9 <_l_strap_0x0x11_loader>: -400014c9: 3a0c movi.n a10, 3 -400014cb: 03ca65 call8 40005170 <_X_sip_init_attach> -400014ce: ff8606 j 400012ea <_l_boot> -400014d1: 000000 ill - -400014d4 <_l_strap_0x0x01>: -400014d4: 1a0c movi.n a10, 1 -400014d6: 03c9a5 call8 40005170 <_X_sip_init_attach> -400014d9: ff8346 j 400012ea <_l_boot> -400014dc: ffaae5 call8 40000f8c <_XX_unk0f84+0x8> -400014df: 020c movi.n a2, 0 -400014e1: f01d retw.n -400014e3: 000000 ill - -400014e6 <_l_strap_0x0x10>: -400014e6: 2a0c movi.n a10, 2 -400014e8: 03c865 call8 40005170 <_X_sip_init_attach> -400014eb: ff7ec6 j 400012ea <_l_boot> - ... - -400014f0 <_c_0xffff8fff>: -400014f0: ff .byte 0xff -400014f1: 8f .byte 0x8f -400014f2: ff .byte 0xff -400014f3: ff .byte 0xff - -400014f4 <_c_0x60008e00>: -400014f4: 008e00 any4 b0, b12:b13:b14:b15 -400014f7: 413660 srli a3, a6, 6 -400014fa: fdb100 excw -400014fd: ff .byte 0xff -400014fe: fffd91 l32r a9, 400014f4 <_c_0x60008e00> -40001501: 0020c0 memw -40001504: 9a29a2 l32i a10, a9, 0x268 -40001507: 10aab0 and a10, a10, a11 -4000150a: 0020c0 memw -4000150d: 9a69a2 s32i a10, a9, 0x268 -40001510: 0020c0 memw -40001513: 9a2982 l32i a8, a9, 0x268 -40001516: 0020c0 memw -40001519: 9a6982 s32i a8, a9, 0x268 -4000151c: 000106 j 40001524 <_c_0x60008e00+0x30> -4000151f: 000000 ill -40001522: 250070 extui a0, a7, 16, 3 -40001525: 6603c3 excw -40001528: f62a add.n a15, a6, a2 -4000152a: f01d retw.n - -4000152c <_s_waiting_for_host>: -4000152c: caac beqz.n a10, 4000155c <_XX_unk153c+0x20> -4000152e: ff .byte 0xff -4000152f: 3f .byte 0x3f -40001530: ffa000 excw -40001533: 3f .byte 0x3f -40001534: 002000 isync -40001537: 000000 ill -4000153a: 364004 excw - -4000153c <_XX_unk153c>: -4000153c: 004136 entry a1, 32 -4000153f: fefc31 l32r a3, 40001130 <_c_0x60003e00> -40001542: 1d0c movi.n a13, 1 -40001544: 8b1c movi.n a11, 24 -40001546: ac1c movi.n a12, 26 -40001548: 040c movi.n a4, 0 -4000154a: 852c movi.n a5, 40 -4000154c: 04ad mov.n a10, a4 -4000154e: 0020c0 memw -40001551: 8e2392 l32i a9, a3, 0x238 -40001554: 109950 and a9, a9, a5 -40001557: 83ad90 moveqz a10, a13, a9 -4000155a: 0020c0 memw -4000155d: 8e2382 l32i a8, a3, 0x238 -40001560: 048580 extui a8, a8, 5, 1 -40001563: 0ad856 bnez a8, 40001614 <_XX_unk153c+0xd8> -40001566: 0020c0 memw -40001569: 8e23e2 l32i a14, a3, 0x238 -4000156c: 54e0e0 extui a14, a14, 0, 6 -4000156f: c0eeb0 sub a14, a14, a11 -40001572: 09ee16 beqz a14, 40001614 <_XX_unk153c+0xd8> -40001575: 0020c0 memw -40001578: 8e23f2 l32i a15, a3, 0x238 -4000157b: 54f0f0 extui a15, a15, 0, 6 -4000157e: c0ffc0 sub a15, a15, a12 -40001581: 08ff16 beqz a15, 40001614 <_XX_unk153c+0xd8> -40001584: 0020c0 memw -40001587: 8e2382 l32i a8, a3, 0x238 -4000158a: 548080 extui a8, a8, 0, 6 -4000158d: e5c882 addi a8, a8, -27 -40001590: 124816 beqz a8, 400016b8 <_XX_unk153c+0x17c> -40001593: 0020c0 memw -40001596: 8e2392 l32i a9, a3, 0x238 -40001599: ec2c movi.n a12, 46 -4000159b: 549090 extui a9, a9, 0, 6 -4000159e: f8c992 addi a9, a9, -8 -400015a1: 0f5916 beqz a9, 4000169a <_XX_unk153c+0x15e> -400015a4: 0020c0 memw -400015a7: 8e23b2 l32i a11, a3, 0x238 -400015aa: 040c movi.n a4, 0 -400015ac: 10bbc0 and a11, a11, a12 -400015af: f4cbb2 addi a11, a11, -12 -400015b2: 0e4b16 beqz a11, 4000169a <_XX_unk153c+0x15e> -400015b5: 0ba0e2 movi a14, 11 -400015b8: 0020c0 memw -400015bb: 8e23d2 l32i a13, a3, 0x238 -400015be: 54d0d0 extui a13, a13, 0, 6 -400015c1: 1a1de7 beq a13, a14, 400015df <_XX_unk153c+0xa3> -400015c4: 0020c0 memw -400015c7: 8e23e2 l32i a14, a3, 0x238 -400015ca: 09a082 movi a8, 9 -400015cd: 54e0e0 extui a14, a14, 0, 6 -400015d0: 0b9e26 beqi a14, 10, 400015df <_XX_unk153c+0xa3> -400015d3: 0020c0 memw -400015d6: 8e23f2 l32i a15, a3, 0x238 -400015d9: 54f0f0 extui a15, a15, 0, 6 -400015dc: 089f87 bne a15, a8, 400015e8 <_XX_unk153c+0xac> -400015df: ffd3a1 l32r a10, 4000152c <_s_waiting_for_host> -400015e2: 012225 call8 40002804 <ets_printf> -400015e5: 01a042 movi a4, 1 -400015e8: 0020c0 memw -400015eb: 8e2382 l32i a8, a3, 0x238 -400015ee: 178857 bany a8, a5, 40001609 <_XX_unk153c+0xcd> -400015f1: 01a0a2 movi a10, 1 -400015f4: 01f3e5 call8 40003534 <_X_uart_init> -400015f7: 0a0c movi.n a10, 0 -400015f9: 020a25 call8 4000369c <_X_uart_wait_tx_empty> -400015fc: 0a2c movi.n a10, 32 -400015fe: ffb065 call8 40001104 <_X_ets_isr_unmask> -40001601: 06b416 beqz a4, 40001670 <_XX_unk153c+0x134> -40001604: 0a2c movi.n a10, 32 -40001606: ffaf25 call8 400010f8 <_X_ets_isr_mask> -40001609: 532426 beqi a4, 2, 40001660 <_XX_unk153c+0x124> -4000160c: ffeea5 call8 400014f8 <_c_0x60008e00+0x4> -4000160f: f01d retw.n -40001611: 000000 ill -40001614: 1a2c movi.n a10, 33 -40001616: 0020c0 memw -40001619: 8e2392 l32i a9, a3, 0x238 -4000161c: 3949a7 ball a9, a10, 40001659 <_XX_unk153c+0x11d> -4000161f: 0020c0 memw -40001622: 8e23e2 l32i a14, a3, 0x238 -40001625: 54e0e0 extui a14, a14, 0, 6 -40001628: 2d1eb7 beq a14, a11, 40001659 <_XX_unk153c+0x11d> -4000162b: 0020c0 memw -4000162e: 8e23f2 l32i a15, a3, 0x238 -40001631: 1b0c movi.n a11, 1 -40001633: 54f0f0 extui a15, a15, 0, 6 -40001636: 1f1fc7 beq a15, a12, 40001659 <_XX_unk153c+0x11d> -40001639: 30a0e2 movi a14, 48 -4000163c: 20a440 or a10, a4, a4 -4000163f: 0020c0 memw -40001642: 8e23c2 l32i a12, a3, 0x238 -40001645: 10cce0 and a12, a12, a14 -40001648: e0ccc2 addi a12, a12, -32 -4000164b: 83adc0 moveqz a10, a13, a12 -4000164e: 74a0a0 extui a10, a10, 0, 8 -40001651: 02d1e5 call8 40004370 <_X_spi_flash_attach> -40001654: 006242 s32i a4, a2, 0 -40001657: f01d retw.n -40001659: 0b0c movi.n a11, 0 -4000165b: fff686 j 40001639 <_XX_unk153c+0xfd> -4000165e: a10000 sll a0, a0 -40001661: b1ffb4 excw -40001664: cdffb4 excw -40001667: 902502 l32i a0, a5, 0x240 -4000166a: f01d01 l32r a0, 3fffd6e0 <_start-0x2920> -4000166d: 000000 ill -40001670: 00a0a2 movi a10, 0 -40001673: 017e65 call8 40002e58 <_XX_unk2e58> -40001676: 7440a0 extui a4, a10, 0, 8 -40001679: f87456 bnez a4, 40001604 <_XX_unk153c+0xc8> -4000167c: 1a0c movi.n a10, 1 -4000167e: 017da5 call8 40002e58 <_XX_unk2e58> -40001681: 7440a0 extui a4, a10, 0, 8 -40001684: f7c456 bnez a4, 40001604 <_XX_unk153c+0xc8> -40001687: 03ad25 call8 40005158 <_XX_unk500c+0x14c> -4000168a: feca82 addi a8, a10, -2 -4000168d: 1f0c movi.n a15, 1 -4000168f: 040c movi.n a4, 0 -40001691: 834f80 moveqz a4, a15, a8 -40001694: fd8416 beqz a4, 40001670 <_XX_unk153c+0x134> -40001697: ffda46 j 40001604 <_XX_unk153c+0xc8> -4000169a: 00a0b2 movi a11, 0 -4000169d: 7440a0 extui a4, a10, 0, 8 -400016a0: 20a440 or a10, a4, a4 -400016a3: 01daa5 call8 4000344c <_c_0x000fffff+0x4> -400016a6: 20baa0 or a11, a10, a10 -400016a9: 04ad mov.n a10, a4 -400016ab: f4b0b0 extui a11, a11, 0, 16 -400016ae: 01e3a5 call8 400034e8 <uart_div_modify> -400016b1: 240c movi.n a4, 2 -400016b3: ffbf86 j 400015b5 <_XX_unk153c+0x79> -400016b6: c10000 mul16u a0, a0, a0 -400016b9: c9ffa0 excw -400016bc: f01d02 l16ui a0, a13, 0x1e0 -400016bf: cae400 depbits a0, a4, 12, 15 -400016c2: ff .byte 0xff -400016c3: 3f .byte 0x3f -400016c4: cb18 l32i.n a1, a11, 48 -400016c6: ff .byte 0xff -400016c7: 3f .byte 0x3f -400016c8: ffcb24 excw -400016cb: 3f .byte 0x3f -400016cc: ffcb04 excw -400016cf: 3f .byte 0x3f -400016d0: ffc880 excw -400016d3: 3f .byte 0x3f -400016d4: ffcb50 excw -400016d7: 3f .byte 0x3f -400016d8: ffcac0 excw -400016db: 3f .byte 0x3f -400016dc: ffcad0 excw -400016df: 3f .byte 0x3f -400016e0: ffcb34 excw -400016e3: 3f .byte 0x3f -400016e4: ffcb44 excw -400016e7: 3f .byte 0x3f -400016e8: 00e136 entry a1, 112 -400016eb: 1a2c movi.n a10, 33 -400016ed: fe9081 l32r a8, 40001130 <_c_0x60003e00> -400016f0: 0020c0 memw -400016f3: 8e2892 l32i a9, a8, 0x238 -400016f6: 4249a7 ball a9, a10, 4000173c <_XX_unk153c+0x200> -400016f9: 8c1c movi.n a12, 24 -400016fb: 0020c0 memw -400016fe: 8e28b2 l32i a11, a8, 0x238 -40001701: 54b0b0 extui a11, a11, 0, 6 -40001704: 341bc7 beq a11, a12, 4000173c <_XX_unk153c+0x200> -40001707: 1aa0d2 movi a13, 26 -4000170a: 0020c0 memw -4000170d: 8e28c2 l32i a12, a8, 0x238 -40001710: 54c0c0 extui a12, a12, 0, 6 -40001713: 251cd7 beq a12, a13, 4000173c <_XX_unk153c+0x200> -40001716: 01a022 movi a2, 1 -40001719: 00a0a2 movi a10, 0 -4000171c: 20b110 or a11, a1, a1 -4000171f: 10a0c2 movi a12, 16 -40001722: 031765 call8 40004898 <SPIRead> -40001725: facc bnez.n a10, 40001738 <_XX_unk153c+0x1fc> -40001727: 010162 l8ui a6, a1, 1 -4000172a: 030132 l8ui a3, a1, 3 -4000172d: 11c8 l32i.n a12, a1, 4 -4000172f: 0001d2 l8ui a13, a1, 0 -40001732: e9a0e2 movi a14, 233 -40001735: 081de7 beq a13, a14, 40001741 <_XX_unk153c+0x205> -40001738: 120c movi.n a2, 1 -4000173a: f01d retw.n -4000173c: 020c movi.n a2, 0 -4000173e: fff5c6 j 40001719 <_XX_unk153c+0x1dd> -40001741: 20b220 or a11, a2, a2 -40001744: 0201a2 l8ui a10, a1, 2 -40001747: 0e61c2 s32i a12, a1, 56 -4000174a: 02dee5 call8 40004538 <_X_SPIReadModeConfig> -4000174d: 348030 extui a8, a3, 0, 4 -40001750: 0fa032 movi a3, 15 -40001753: 0738f6 bgeui a8, 3, 4000175e <_XX_unk153c+0x222> -40001756: a82b addi.n a10, a8, 2 -40001758: 74a0a0 extui a10, a10, 0, 8 -4000175b: 000046 j 40001760 <_XX_unk153c+0x224> -4000175e: 1a0c movi.n a10, 1 -40001760: 02f165 call8 40004678 <_X_SPIReadModeConfig+0x140> -40001763: 0c0182 l8ui a8, a1, 12 -40001766: 0e0192 l8ui a9, a1, 14 -40001769: 0f0152 l8ui a5, a1, 15 -4000176c: 0b0122 l8ui a2, a1, 11 -4000176f: 115580 slli a5, a5, 8 -40001772: 112280 slli a2, a2, 8 -40001775: 205590 or a5, a5, a9 -40001778: 0d0192 l8ui a9, a1, 13 -4000177b: 115580 slli a5, a5, 8 -4000177e: 205590 or a5, a5, a9 -40001781: 115580 slli a5, a5, 8 -40001784: 0a0192 l8ui a9, a1, 10 -40001787: 205580 or a5, a5, a8 -4000178a: 080182 l8ui a8, a1, 8 -4000178d: 202290 or a2, a2, a9 -40001790: 090192 l8ui a9, a1, 9 -40001793: 112280 slli a2, a2, 8 -40001796: 202290 or a2, a2, a9 -40001799: 112280 slli a2, a2, 8 -4000179c: 202280 or a2, a2, a8 -4000179f: 3c1296 bltz a2, 40001b64 <_XX_unk153c+0x628> -400017a2: 031c movi.n a3, 16 -400017a4: 20a330 or a10, a3, a3 -400017a7: 20b110 or a11, a1, a1 -400017aa: 10a0c2 movi a12, 16 -400017ad: 030ea5 call8 40004898 <SPIRead> -400017b0: f84a56 bnez a10, 40001738 <_XX_unk153c+0x1fc> -400017b3: 10c332 addi a3, a3, 16 -400017b6: 278616 beqz a6, 40001a32 <_XX_unk153c+0x4f6> -400017b9: f119 s32i.n a1, a1, 60 -400017bb: efa042 movi a4, 239 -400017be: 017d mov.n a7, a1 -400017c0: c159 s32i.n a5, a1, 48 -400017c2: 6169 s32i.n a6, a1, 24 -400017c4: 02bd mov.n a11, a2 -400017c6: 0d0c movi.n a13, 0 -400017c8: d1d9 s32i.n a13, a1, 52 -400017ca: 0b2d mov.n a2, a11 -400017cc: ffbda1 l32r a10, 400016c0 <_XX_unk153c+0x184> -400017cf: c1c8 l32i.n a12, a1, 48 -400017d1: d188 l32i.n a8, a1, 52 -400017d3: 051c movi.n a5, 16 -400017d5: c05580 sub a5, a5, a8 -400017d8: 745050 extui a5, a5, 0, 8 -400017db: 05dd mov.n a13, a5 -400017dd: 010265 call8 40002804 <ets_printf> -400017e0: 1a0c movi.n a10, 1 -400017e2: c198 l32i.n a9, a1, 48 -400017e4: a1a9 s32i.n a10, a1, 40 -400017e6: 03b957 bgeu a9, a5, 400017ed <_XX_unk153c+0x2b1> -400017e9: 0b0c movi.n a11, 0 -400017eb: a1b9 s32i.n a11, a1, 40 -400017ed: 0f0c movi.n a15, 0 -400017ef: d1e8 l32i.n a14, a1, 52 -400017f1: a1c8 l32i.n a12, a1, 40 -400017f3: 81c9 s32i.n a12, a1, 32 -400017f5: 93efc0 movnez a14, a15, a12 -400017f8: 91e9 s32i.n a14, a1, 36 -400017fa: 3b2c16 beqz a12, 40001bb0 <_XX_unk153c+0x674> -400017fd: 380c movi.n a8, 3 -400017ff: 028857 bany a8, a5, 40001805 <_XX_unk153c+0x2c9> -40001802: 008d86 j 40001a3c <_XX_unk153c+0x500> -40001805: 0215e6 bgei a5, 1, 4000180b <_XX_unk153c+0x2cf> -40001808: 002206 j 40001894 <_XX_unk153c+0x358> -4000180b: 249050 extui a9, a5, 0, 3 -4000180e: 139976 loopnez a9, 40001825 <_XX_unk153c+0x2e9> -40001811: f188 l32i.n a8, a1, 60 -40001813: 000892 l8ui a9, a8, 0 -40001816: 004292 s8i a9, a2, 0 -40001819: 881b addi.n a8, a8, 1 -4000181b: f189 s32i.n a8, a1, 60 -4000181d: 221b addi.n a2, a2, 1 -4000181f: 304940 xor a4, a9, a4 -40001822: 744040 extui a4, a4, 0, 8 -40001825: f188 l32i.n a8, a1, 60 -40001827: 419350 srli a9, a5, 3 -4000182a: 639976 loopnez a9, 40001891 <_XX_unk153c+0x355> -4000182d: 000892 l8ui a9, a8, 0 -40001830: 004292 s8i a9, a2, 0 -40001833: 309940 xor a9, a9, a4 -40001836: 749090 extui a9, a9, 0, 8 -40001839: 010842 l8ui a4, a8, 1 -4000183c: 014242 s8i a4, a2, 1 -4000183f: 309490 xor a9, a4, a9 -40001842: 749090 extui a9, a9, 0, 8 -40001845: 020842 l8ui a4, a8, 2 -40001848: 024242 s8i a4, a2, 2 -4000184b: 309490 xor a9, a4, a9 -4000184e: 749090 extui a9, a9, 0, 8 -40001851: 030842 l8ui a4, a8, 3 -40001854: 034242 s8i a4, a2, 3 -40001857: 309490 xor a9, a4, a9 -4000185a: 749090 extui a9, a9, 0, 8 -4000185d: 040842 l8ui a4, a8, 4 -40001860: 044242 s8i a4, a2, 4 -40001863: 309490 xor a9, a4, a9 -40001866: 749090 extui a9, a9, 0, 8 -40001869: 050842 l8ui a4, a8, 5 -4000186c: 054242 s8i a4, a2, 5 -4000186f: 309490 xor a9, a4, a9 -40001872: 749090 extui a9, a9, 0, 8 -40001875: 060842 l8ui a4, a8, 6 -40001878: 064242 s8i a4, a2, 6 -4000187b: 309490 xor a9, a4, a9 -4000187e: 749090 extui a9, a9, 0, 8 -40001881: 070842 l8ui a4, a8, 7 -40001884: 074242 s8i a4, a2, 7 -40001887: 309490 xor a9, a4, a9 -4000188a: 888b addi.n a8, a8, 8 -4000188c: 228b addi.n a2, a2, 8 -4000188e: 744090 extui a4, a9, 0, 8 -40001891: 0f6182 s32i a8, a1, 60 -40001894: c168 l32i.n a6, a1, 48 -40001896: a1a8 l32i.n a10, a1, 40 -40001898: c06650 sub a6, a6, a5 -4000189b: 416460 srli a6, a6, 4 -4000189e: 35ea16 beqz a10, 40001c00 <_XX_unk153c+0x6c4> -400018a1: d198 l32i.n a9, a1, 52 -400018a3: c188 l32i.n a8, a1, 48 -400018a5: 889a add.n a8, a8, a9 -400018a7: f0c882 addi a8, a8, -16 -400018aa: 348080 extui a8, a8, 0, 4 -400018ad: 076182 s32i a8, a1, 28 -400018b0: 91a8 l32i.n a10, a1, 36 -400018b2: 74a0a0 extui a10, a10, 0, 8 -400018b5: d1a9 s32i.n a10, a1, 52 -400018b7: 3e16a6 blti a6, 1, 400018f9 <_XX_unk153c+0x3bd> -400018ba: 050c movi.n a5, 0 -400018bc: 20a330 or a10, a3, a3 -400018bf: 20b110 or a11, a1, a1 -400018c2: 10a0c2 movi a12, 16 -400018c5: 02fd25 call8 40004898 <SPIRead> -400018c8: 1fca56 bnez a10, 40001ac8 <_XX_unk153c+0x58c> -400018cb: 080c movi.n a8, 0 -400018cd: 10c332 addi a3, a3, 16 -400018d0: 091c movi.n a9, 16 -400018d2: 10a976 loopgtz a9, 400018e6 <_XX_unk153c+0x3aa> -400018d5: 987a add.n a9, a8, a7 -400018d7: 01c882 addi a8, a8, 1 -400018da: 000992 l8ui a9, a9, 0 -400018dd: 748080 extui a8, a8, 0, 8 -400018e0: 309940 xor a9, a9, a4 -400018e3: 744090 extui a4, a9, 0, 8 -400018e6: 20a220 or a10, a2, a2 -400018e9: 20b110 or a11, a1, a1 -400018ec: 0c1c movi.n a12, 16 -400018ee: 050865 call8 40006974 <memcpy> -400018f1: 10c222 addi a2, a2, 16 -400018f4: 551b addi.n a5, a5, 1 -400018f6: c29567 bne a5, a6, 400018bc <_XX_unk153c+0x380> -400018f9: 0821b2 l32i a11, a1, 32 -400018fc: 011b16 beqz a11, 40001911 <_XX_unk153c+0x3d5> -400018ff: 20a330 or a10, a3, a3 -40001902: 01bd mov.n a11, a1 -40001904: 0c1c movi.n a12, 16 -40001906: 02f925 call8 40004898 <SPIRead> -40001909: 3afa56 bnez a10, 40001cbc <_XX_unk153c+0x780> -4000190c: 10c332 addi a3, a3, 16 -4000190f: f119 s32i.n a1, a1, 60 -40001911: 072152 l32i a5, a1, 28 -40001914: ff6ca1 l32r a10, 400016c4 <_XX_unk153c+0x188> -40001917: 745050 extui a5, a5, 0, 8 -4000191a: 20b550 or a11, a5, a5 -4000191d: 00ee65 call8 40002804 <ets_printf> -40001920: 03a082 movi a8, 3 -40001923: 028857 bany a8, a5, 40001929 <_XX_unk153c+0x3ed> -40001926: 006b86 j 40001ad8 <_XX_unk153c+0x59c> -40001929: 0215e6 bgei a5, 1, 4000192f <_XX_unk153c+0x3f3> -4000192c: 002206 j 400019b8 <_XX_unk153c+0x47c> -4000192f: 249050 extui a9, a5, 0, 3 -40001932: 139976 loopnez a9, 40001949 <_XX_unk153c+0x40d> -40001935: f188 l32i.n a8, a1, 60 -40001937: 000892 l8ui a9, a8, 0 -4000193a: 004292 s8i a9, a2, 0 -4000193d: 881b addi.n a8, a8, 1 -4000193f: f189 s32i.n a8, a1, 60 -40001941: 221b addi.n a2, a2, 1 -40001943: 304940 xor a4, a9, a4 -40001946: 744040 extui a4, a4, 0, 8 -40001949: f188 l32i.n a8, a1, 60 -4000194b: 419350 srli a9, a5, 3 -4000194e: 639976 loopnez a9, 400019b5 <_XX_unk153c+0x479> -40001951: 000892 l8ui a9, a8, 0 -40001954: 004292 s8i a9, a2, 0 -40001957: 309940 xor a9, a9, a4 -4000195a: 749090 extui a9, a9, 0, 8 -4000195d: 010842 l8ui a4, a8, 1 -40001960: 014242 s8i a4, a2, 1 -40001963: 309490 xor a9, a4, a9 -40001966: 749090 extui a9, a9, 0, 8 -40001969: 020842 l8ui a4, a8, 2 -4000196c: 024242 s8i a4, a2, 2 -4000196f: 309490 xor a9, a4, a9 -40001972: 749090 extui a9, a9, 0, 8 -40001975: 030842 l8ui a4, a8, 3 -40001978: 034242 s8i a4, a2, 3 -4000197b: 309490 xor a9, a4, a9 -4000197e: 749090 extui a9, a9, 0, 8 -40001981: 040842 l8ui a4, a8, 4 -40001984: 044242 s8i a4, a2, 4 -40001987: 309490 xor a9, a4, a9 -4000198a: 749090 extui a9, a9, 0, 8 -4000198d: 050842 l8ui a4, a8, 5 -40001990: 054242 s8i a4, a2, 5 -40001993: 309490 xor a9, a4, a9 -40001996: 749090 extui a9, a9, 0, 8 -40001999: 060842 l8ui a4, a8, 6 -4000199c: 064242 s8i a4, a2, 6 -4000199f: 309490 xor a9, a4, a9 -400019a2: 749090 extui a9, a9, 0, 8 -400019a5: 070842 l8ui a4, a8, 7 -400019a8: 074242 s8i a4, a2, 7 -400019ab: 309490 xor a9, a4, a9 -400019ae: 888b addi.n a8, a8, 8 -400019b0: 228b addi.n a2, a2, 8 -400019b2: 744090 extui a4, a9, 0, 8 -400019b5: 0f6182 s32i a8, a1, 60 -400019b8: ff44a1 l32r a10, 400016c8 <_XX_unk153c+0x18c> -400019bb: 04bd mov.n a11, a4 -400019bd: 00e465 call8 40002804 <ets_printf> -400019c0: 61a8 l32i.n a10, a1, 24 -400019c2: aa0b addi.n a10, a10, -1 -400019c4: 2d5a16 beqz a10, 40001c9d <_XX_unk153c+0x761> -400019c7: d128 l32i.n a2, a1, 52 -400019c9: 061c movi.n a6, 16 -400019cb: 252a add.n a2, a5, a2 -400019cd: c06620 sub a6, a6, a2 -400019d0: 746060 extui a6, a6, 0, 8 -400019d3: 0286f6 bgeui a6, 8, 400019d9 <_XX_unk153c+0x49d> -400019d6: 0078c6 j 40001bbd <_XX_unk153c+0x681> -400019d9: f158 l32i.n a5, a1, 60 -400019db: a28b addi.n a10, a2, 8 -400019dd: 74a0a0 extui a10, a10, 0, 8 -400019e0: d1a9 s32i.n a10, a1, 52 -400019e2: 040562 l8ui a6, a5, 4 -400019e5: 0005c2 l8ui a12, a5, 0 -400019e8: 050582 l8ui a8, a5, 5 -400019eb: 060592 l8ui a9, a5, 6 -400019ee: 0105d2 l8ui a13, a5, 1 -400019f1: 0305b2 l8ui a11, a5, 3 -400019f4: 0205e2 l8ui a14, a5, 2 -400019f7: 11bb80 slli a11, a11, 8 -400019fa: 20bbe0 or a11, a11, a14 -400019fd: 11bb80 slli a11, a11, 8 -40001a00: 20bbd0 or a11, a11, a13 -40001a03: 11bb80 slli a11, a11, 8 -40001a06: 070552 l8ui a5, a5, 7 -40001a09: 20bbc0 or a11, a11, a12 -40001a0c: 115580 slli a5, a5, 8 -40001a0f: 205590 or a5, a5, a9 -40001a12: 115580 slli a5, a5, 8 -40001a15: 205580 or a5, a5, a8 -40001a18: 115580 slli a5, a5, 8 -40001a1b: 205560 or a5, a5, a6 -40001a1e: c159 s32i.n a5, a1, 48 -40001a20: 6188 l32i.n a8, a1, 24 -40001a22: d198 l32i.n a9, a1, 52 -40001a24: a80b addi.n a10, a8, -1 -40001a26: 997a add.n a9, a9, a7 -40001a28: f199 s32i.n a9, a1, 60 -40001a2a: 7480a0 extui a8, a10, 0, 8 -40001a2d: 6189 s32i.n a8, a1, 24 -40001a2f: d97856 bnez a8, 400017ca <_XX_unk153c+0x28e> -40001a32: e1a8 l32i.n a10, a1, 56 -40001a34: ff6de5 call8 40001114 <_XX_set_0x3fffda30_0> -40001a37: 020c movi.n a2, 0 -40001a39: f01d retw.n -40001a3b: 451600 extui a1, a0, 22, 5 -40001a3e: 02ade5 call8 4000451c <Cache_Read_Disable+0xd0> -40001a41: 41d250 srli a13, a5, 2 -40001a44: 7a1da6 blti a13, 1, 40001ac2 <_XX_unk153c+0x586> -40001a47: 276527 bbci a5, 2, 40001a72 <_XX_unk153c+0x536> -40001a4a: f198 l32i.n a9, a1, 60 -40001a4c: a24b addi.n a10, a2, 4 -40001a4e: 0009c2 l8ui a12, a9, 0 -40001a51: 0988 l32i.n a8, a9, 0 -40001a53: 0289 s32i.n a8, a2, 0 -40001a55: 75b080 extui a11, a8, 16, 8 -40001a58: 74e880 extui a14, a8, 8, 8 -40001a5b: 756880 extui a6, a8, 24, 8 -40001a5e: 994b addi.n a9, a9, 4 -40001a60: 0f6192 s32i a9, a1, 60 -40001a63: 306640 xor a6, a6, a4 -40001a66: 304ce0 xor a4, a12, a14 -40001a69: 304b40 xor a4, a11, a4 -40001a6c: 304460 xor a4, a4, a6 -40001a6f: 744040 extui a4, a4, 0, 8 -40001a72: 0afd mov.n a15, a10 -40001a74: f188 l32i.n a8, a1, 60 -40001a76: 4121d0 srli a2, a13, 1 -40001a79: 419276 loopnez a2, 40001abe <_XX_unk153c+0x582> -40001a7c: 030892 l8ui a9, a8, 3 -40001a7f: 0108b2 l8ui a11, a8, 1 -40001a82: 0008c2 l8ui a12, a8, 0 -40001a85: 0208d2 l8ui a13, a8, 2 -40001a88: 08e8 l32i.n a14, a8, 0 -40001a8a: 309940 xor a9, a9, a4 -40001a8d: 30bcb0 xor a11, a12, a11 -40001a90: 0fe9 s32i.n a14, a15, 0 -40001a92: 30bdb0 xor a11, a13, a11 -40001a95: 0708c2 l8ui a12, a8, 7 -40001a98: 0508d2 l8ui a13, a8, 5 -40001a9b: 0408e2 l8ui a14, a8, 4 -40001a9e: 060842 l8ui a4, a8, 6 -40001aa1: 1828 l32i.n a2, a8, 4 -40001aa3: 309b90 xor a9, a11, a9 -40001aa6: 30bed0 xor a11, a14, a13 -40001aa9: 1f29 s32i.n a2, a15, 4 -40001aab: 888b addi.n a8, a8, 8 -40001aad: 749090 extui a9, a9, 0, 8 -40001ab0: 30b4b0 xor a11, a4, a11 -40001ab3: ff8b addi.n a15, a15, 8 -40001ab5: 309c90 xor a9, a12, a9 -40001ab8: 309b90 xor a9, a11, a9 -40001abb: 744090 extui a4, a9, 0, 8 -40001abe: f189 s32i.n a8, a1, 60 -40001ac0: 0fad mov.n a10, a15 -40001ac2: 0a2d mov.n a2, a10 -40001ac4: ff7306 j 40001894 <_XX_unk153c+0x358> -40001ac7: 01a100 slli a10, a1, 32 -40001aca: ff .byte 0xff -40001acb: ff01b1 l32r a11, 400016d0 <_XX_unk153c+0x194> -40001ace: 00d365 call8 40002804 <ets_printf> -40001ad1: 120c movi.n a2, 1 -40001ad3: f01d retw.n -40001ad5: 000000 ill -40001ad8: edc516 beqz a5, 400019b8 <_XX_unk153c+0x47c> -40001adb: 02ad mov.n a10, a2 -40001add: 41d250 srli a13, a5, 2 -40001ae0: 021de6 bgei a13, 1, 40001ae6 <_XX_unk153c+0x5aa> -40001ae3: ffb446 j 400019b8 <_XX_unk153c+0x47c> -40001ae6: 286527 bbci a5, 2, 40001b12 <_XX_unk153c+0x5d6> -40001ae9: f198 l32i.n a9, a1, 60 -40001aeb: a24b addi.n a10, a2, 4 -40001aed: 0009c2 l8ui a12, a9, 0 -40001af0: 0988 l32i.n a8, a9, 0 -40001af2: 0289 s32i.n a8, a2, 0 -40001af4: 75b080 extui a11, a8, 16, 8 -40001af7: 74e880 extui a14, a8, 8, 8 -40001afa: 756880 extui a6, a8, 24, 8 -40001afd: 04c992 addi a9, a9, 4 -40001b00: 0f6192 s32i a9, a1, 60 -40001b03: 306640 xor a6, a6, a4 -40001b06: 304ce0 xor a4, a12, a14 -40001b09: 304b40 xor a4, a11, a4 -40001b0c: 304460 xor a4, a4, a6 -40001b0f: 744040 extui a4, a4, 0, 8 -40001b12: 0afd mov.n a15, a10 -40001b14: f188 l32i.n a8, a1, 60 -40001b16: 4121d0 srli a2, a13, 1 -40001b19: 419276 loopnez a2, 40001b5e <_XX_unk153c+0x622> -40001b1c: 030892 l8ui a9, a8, 3 -40001b1f: 0108b2 l8ui a11, a8, 1 -40001b22: 0008c2 l8ui a12, a8, 0 -40001b25: 0208d2 l8ui a13, a8, 2 -40001b28: 08e8 l32i.n a14, a8, 0 -40001b2a: 309940 xor a9, a9, a4 -40001b2d: 30bcb0 xor a11, a12, a11 -40001b30: 0fe9 s32i.n a14, a15, 0 -40001b32: 30bdb0 xor a11, a13, a11 -40001b35: 0708c2 l8ui a12, a8, 7 -40001b38: 0508d2 l8ui a13, a8, 5 -40001b3b: 0408e2 l8ui a14, a8, 4 -40001b3e: 060842 l8ui a4, a8, 6 -40001b41: 1828 l32i.n a2, a8, 4 -40001b43: 309b90 xor a9, a11, a9 -40001b46: 30bed0 xor a11, a14, a13 -40001b49: 1f29 s32i.n a2, a15, 4 -40001b4b: 888b addi.n a8, a8, 8 -40001b4d: 749090 extui a9, a9, 0, 8 -40001b50: 30b4b0 xor a11, a4, a11 -40001b53: ff8b addi.n a15, a15, 8 -40001b55: 309c90 xor a9, a12, a9 -40001b58: 309b90 xor a9, a11, a9 -40001b5b: 744090 extui a4, a9, 0, 8 -40001b5e: f189 s32i.n a8, a1, 60 -40001b60: ff9506 j 400019b8 <_XX_unk153c+0x47c> -40001b63: 402000 ssa8l a0 -40001b66: c58275 call12 3ffc738c <_start-0x38c74> -40001b69: 87f8 l32i.n a15, a7, 32 -40001b6b: 060203 excw -40001b6e: 500032 l8ui a3, a0, 80 -40001b71: 16f474 excw -40001b74: 0c0917 bnone a9, a1, 40001b84 <_XX_unk153c+0x648> -40001b77: 031c05 call0 40004d38 <lldesc_build_chain+0xac> -40001b7a: 918b addi.n a9, a1, 8 -40001b7c: b199 s32i.n a9, a1, 44 -40001b7e: 03ad mov.n a10, a3 -40001b80: 01bd mov.n a11, a1 -40001b82: 0c1c movi.n a12, 16 -40001b84: 02d125 call8 40004898 <SPIRead> -40001b87: ea7a56 bnez a10, 40001a32 <_XX_unk153c+0x4f6> -40001b8a: 10c332 addi a3, a3, 16 -40001b8d: 449c beqz.n a4, 40001ba5 <_XX_unk153c+0x669> -40001b8f: 01ad mov.n a10, a1 -40001b91: 0247e5 call8 40004010 <_XX_unk4010> -40001b94: 440b addi.n a4, a4, -1 -40001b96: f44040 extui a4, a4, 0, 16 -40001b99: 848c beqz.n a4, 40001ba5 <_XX_unk153c+0x669> -40001b9b: b1a8 l32i.n a10, a1, 44 -40001b9d: 024725 call8 40004010 <_XX_unk4010> -40001ba0: 440b addi.n a4, a4, -1 -40001ba2: f44040 extui a4, a4, 0, 16 -40001ba5: 551b addi.n a5, a5, 1 -40001ba7: f45050 extui a5, a5, 0, 16 -40001baa: d09757 bne a7, a5, 40001b7e <_XX_unk153c+0x642> -40001bad: 001646 j 40001c0a <_XX_unk153c+0x6ce> -40001bb0: 7480e0 extui a8, a14, 0, 8 -40001bb3: c198 l32i.n a9, a1, 48 -40001bb5: 7199 s32i.n a9, a1, 28 -40001bb7: d189 s32i.n a8, a1, 52 -40001bb9: ff4f06 j 400018f9 <_XX_unk153c+0x3bd> -40001bbc: 05cd00 extui a12, a0, 29, 1 -40001bbf: fec5a1 l32r a10, 400016d4 <_XX_unk153c+0x198> -40001bc2: d1b8 l32i.n a11, a1, 52 -40001bc4: 06dd mov.n a13, a6 -40001bc6: 00c3e5 call8 40002804 <ets_printf> -40001bc9: b27a add.n a11, a2, a7 -40001bcb: 10c1a2 addi a10, a1, 16 -40001bce: 06cd mov.n a12, a6 -40001bd0: 04da25 call8 40006974 <memcpy> -40001bd3: 03ad mov.n a10, a3 -40001bd5: 01bd mov.n a11, a1 -40001bd7: 0c1c movi.n a12, 16 -40001bd9: 02cbe5 call8 40004898 <SPIRead> -40001bdc: 0eca56 bnez a10, 40001ccc <_XX_unk153c+0x790> -40001bdf: 10c332 addi a3, a3, 16 -40001be2: 01bd mov.n a11, a1 -40001be4: 8c0c movi.n a12, 8 -40001be6: 10c1a2 addi a10, a1, 16 -40001be9: a6aa add.n a10, a6, a10 -40001beb: c0cc60 sub a12, a12, a6 -40001bee: 74c0c0 extui a12, a12, 0, 8 -40001bf1: d1c9 s32i.n a12, a1, 52 -40001bf3: 04d825 call8 40006974 <memcpy> -40001bf6: 41b8 l32i.n a11, a1, 16 -40001bf8: 51c8 l32i.n a12, a1, 20 -40001bfa: c1c9 s32i.n a12, a1, 48 -40001bfc: ff8806 j 40001a20 <_XX_unk153c+0x4e4> -40001bff: c1d800 mul16u a13, a8, a0 -40001c02: 71d9 s32i.n a13, a1, 28 -40001c04: ff2a06 j 400018b0 <_XX_unk153c+0x374> -40001c07: 031c00 excw -40001c0a: 03ad mov.n a10, a3 -40001c0c: 01bd mov.n a11, a1 -40001c0e: 0c1c movi.n a12, 16 -40001c10: 02c865 call8 40004898 <SPIRead> -40001c13: b21a56 bnez a10, 40001738 <_XX_unk153c+0x1fc> -40001c16: 10c332 addi a3, a3, 16 -40001c19: 448c beqz.n a4, 40001c21 <_XX_unk153c+0x6e5> -40001c1b: 20a110 or a10, a1, a1 -40001c1e: 023f25 call8 40004010 <_XX_unk4010> -40001c21: 744020 extui a4, a2, 0, 8 -40001c24: 04ad mov.n a10, a4 -40001c26: 0299a5 call8 400045c0 <_X_SPIReadModeConfig+0x88> -40001c29: 348820 extui a8, a2, 8, 4 -40001c2c: 1838f6 bgeui a8, 3, 40001c48 <_XX_unk153c+0x70c> -40001c2f: 282b addi.n a2, a8, 2 -40001c31: 742020 extui a2, a2, 0, 8 -40001c34: 000486 j 40001c4a <_XX_unk153c+0x70e> -40001c37: a10000 sll a0, a0 -40001c3a: 50fea7 bbsi a14, 26, 40001c8e <_XX_unk153c+0x752> -40001c3d: 6520b5 call12 40066e48 <__bss_start+0x56e48> -40001c40: 00bc beqz.n a0, 40001c74 <_XX_unk153c+0x738> -40001c42: 01a022 movi a2, 1 -40001c45: 000090 retw -40001c48: 120c movi.n a2, 1 -40001c4a: 20c440 or a12, a4, a4 -40001c4d: fea3a1 l32r a10, 400016dc <_XX_unk153c+0x1a0> -40001c50: 20b220 or a11, a2, a2 -40001c53: 00bb25 call8 40002804 <ets_printf> -40001c56: 20a220 or a10, a2, a2 -40001c59: 02a1e5 call8 40004678 <_X_SPIReadModeConfig+0x140> -40001c5c: 0e0192 l8ui a9, a1, 14 -40001c5f: 080152 l8ui a5, a1, 8 -40001c62: 0b0122 l8ui a2, a1, 11 -40001c65: 0a0182 l8ui a8, a1, 10 -40001c68: 112280 slli a2, a2, 8 -40001c6b: 202280 or a2, a2, a8 -40001c6e: 090182 l8ui a8, a1, 9 -40001c71: 112280 slli a2, a2, 8 -40001c74: 202280 or a2, a2, a8 -40001c77: 112280 slli a2, a2, 8 -40001c7a: 202250 or a2, a2, a5 -40001c7d: 0f0152 l8ui a5, a1, 15 -40001c80: 0c0182 l8ui a8, a1, 12 -40001c83: 115580 slli a5, a5, 8 -40001c86: 205590 or a5, a5, a9 -40001c89: 0d0192 l8ui a9, a1, 13 -40001c8c: 115580 slli a5, a5, 8 -40001c8f: 205590 or a5, a5, a9 -40001c92: 115580 slli a5, a5, 8 -40001c95: 205580 or a5, a5, a8 -40001c98: fec206 j 400017a4 <_XX_unk153c+0x268> -40001c9b: a10000 sll a0, a0 -40001c9e: 40fe90 nsau a9, a14 -40001ca1: 2520b4 excw -40001ca4: 8200b6 bltui a0, 0x8000, 40001c2a <_XX_unk153c+0x6ee> -40001ca7: 400f01 l32r a0, 3ffd1ce4 <_start-0x2e31c> -40001caa: c088 l32i.n a8, a0, 48 -40001cac: d82816 beqz a8, 40001a32 <_XX_unk153c+0x4f6> -40001caf: fe8da1 l32r a10, 400016e4 <_XX_unk153c+0x1a8> -40001cb2: 00b525 call8 40002804 <ets_printf> -40001cb5: 01a022 movi a2, 1 -40001cb8: f01d retw.n -40001cba: a10000 sll a0, a0 -40001cbd: b2fe84 excw -40001cc0: 25efa2 s32c1i a10, a15, 148 -40001cc3: 0c00b4 excw -40001cc6: f01d12 l16ui a1, a13, 0x1e0 -40001cc9: 000000 ill -40001ccc: fe80a1 l32r a10, 400016cc <_XX_unk153c+0x190> -40001ccf: 2ca3b2 movi a11, 0x32c -40001cd2: 00b325 call8 40002804 <ets_printf> -40001cd5: ff5646 j 40001a32 <_XX_unk153c+0x4f6> - -40001cd8 <_c_data_end>: -40001cd8: ffc864 excw -40001cdb: 3f .byte 0x3f - -40001cdc <_s_mem_banner>: -40001cdc: cb68 l32i.n a6, a11, 48 -40001cde: ff .byte 0xff -40001cdf: 3f .byte 0x3f - -40001ce0 <_c_stack_sentry>: -40001ce0: ffe1d0 excw -40001ce3: 3f .byte 0x3f - -40001ce4 <_c_data_start>: -40001ce4: ffc000 excw -40001ce7: 3f .byte 0x3f - -40001ce8 <_X_print_mem_banner>: -40001ce8: 006136 entry a1, 48 -40001ceb: fffca1 l32r a10, 40001cdc <_s_mem_banner> -40001cee: fffcb1 l32r a11, 40001ce0 <_c_stack_sentry> -40001cf1: fa83c1 l32r a12, 40000700 <_c_stack> -40001cf4: fa85d1 l32r a13, 40000708 <_c_bss_start> -40001cf7: fa85e1 l32r a14, 4000070c <_c_bss_end> -40001cfa: fffaf1 l32r a15, 40001ce4 <_c_data_start> -40001cfd: fff681 l32r a8, 40001cd8 <_c_data_end> -40001d00: 0189 s32i.n a8, a1, 0 -40001d02: 00b025 call8 40002804 <ets_printf> -40001d05: f01d retw.n -40001d07: da4000 depbits a0, a0, 13, 5 -40001d0a: ff .byte 0xff -40001d0b: 3f .byte 0x3f - -40001d0c <_s_exc_sp_fmt>: -40001d0c: ffcbe4 excw -40001d0f: 3f .byte 0x3f - -40001d10 <_s_exc_sf_dump_fmt>: -40001d10: cbec bnez.n a11, 40001d40 <_X_exc_handler+0x28> -40001d12: ff .byte 0xff -40001d13: 3f .byte 0x3f - -40001d14 <_s_exc_regs_fmt>: -40001d14: cc2c movi.n a12, 44 -40001d16: ff .byte 0xff -40001d17: 3f .byte 0x3f - -40001d18 <_X_exc_handler>: -40001d18: 004136 entry a1, 32 -40001d1b: 012d mov.n a2, a1 -40001d1d: 03e765 call8 40005b94 <_XX_xtos_exc_unk5b94> -40001d20: 030c movi.n a3, 0 -40001d22: f8add2 movi a13, 0xfffffdf8 -40001d25: fff841 l32r a4, 40001d08 <_X_print_mem_banner+0x20> -40001d28: 580c movi.n a8, 5 -40001d2a: 209440 or a9, a4, a4 -40001d2d: 1ea876 loopgtz a8, 40001d4f <_X_exc_handler+0x37> -40001d30: c2da add.n a12, a2, a13 -40001d32: 7e2cb2 l32i a11, a12, 0x1f8 -40001d35: 09b9 s32i.n a11, a9, 0 -40001d37: 7f2ca2 l32i a10, a12, 0x1fc -40001d3a: 19a9 s32i.n a10, a9, 4 -40001d3c: 802ce2 l32i a14, a12, 0x200 -40001d3f: 29e9 s32i.n a14, a9, 8 -40001d41: 812cc2 l32i a12, a12, 0x204 -40001d44: 39c9 s32i.n a12, a9, 12 -40001d46: 5b8c beqz.n a11, 40001d4f <_X_exc_handler+0x37> -40001d48: 10c992 addi a9, a9, 16 -40001d4b: 0a2d mov.n a2, a10 -40001d4d: 331b addi.n a3, a3, 1 -40001d4f: ffefa1 l32r a10, 40001d0c <_s_exc_sp_fmt> -40001d52: 02bd mov.n a11, a2 -40001d54: 00aae5 call8 40002804 <ets_printf> -40001d57: 020c movi.n a2, 0 -40001d59: 1713a6 blti a3, 1, 40001d74 <_X_exc_handler+0x5c> -40001d5c: ffeda1 l32r a10, 40001d10 <_s_exc_sf_dump_fmt> -40001d5f: 02bd mov.n a11, a2 -40001d61: 04c8 l32i.n a12, a4, 0 -40001d63: 14d8 l32i.n a13, a4, 4 -40001d65: 24e8 l32i.n a14, a4, 8 -40001d67: 34f8 l32i.n a15, a4, 12 -40001d69: 00a9a5 call8 40002804 <ets_printf> -40001d6c: 10c442 addi a4, a4, 16 -40001d6f: 221b addi.n a2, a2, 1 -40001d71: e79237 bne a2, a3, 40001d5c <_X_exc_handler+0x44> -40001d74: ffe8a1 l32r a10, 40001d14 <_s_exc_regs_fmt> -40001d77: 03b1b0 rsr.epc1 a11 -40001d7a: 03b2c0 rsr.epc2 a12 -40001d7d: 03b3d0 rsr.epc3 a13 -40001d80: 03eee0 rsr.excvaddr a14 -40001d83: 03c0f0 rsr.depc a15 -40001d86: 00a7e5 call8 40002804 <ets_printf> -40001d89: ffff06 j 40001d89 <_X_exc_handler+0x71> -40001d8c: ffcc74 excw -40001d8f: 3f .byte 0x3f - -40001d90 <_XX_unk1d90>: -40001d90: 004136 entry a1, 32 -40001d93: 03e8b0 rsr.exccause a11 -40001d96: fffda1 l32r a10, 40001d8c <_X_exc_handler+0x74> -40001d99: 00a6a5 call8 40002804 <ets_printf> -40001d9c: ffdea1 l32r a10, 40001d14 <_s_exc_regs_fmt> -40001d9f: 03b1b0 rsr.epc1 a11 -40001da2: 03b2c0 rsr.epc2 a12 -40001da5: 03b3d0 rsr.epc3 a13 -40001da8: 03eee0 rsr.excvaddr a14 -40001dab: 03c0f0 rsr.depc a15 -40001dae: 00a565 call8 40002804 <ets_printf> -40001db1: ffff06 j 40001db1 <_XX_unk1d90+0x21> - -40001db4 <_X_ets_memset>: -40001db4: 004136 entry a1, 32 -40001db7: 04cd mov.n a12, a4 -40001db9: 03bd mov.n a11, a3 -40001dbb: 02ad mov.n a10, a2 -40001dbd: 04e265 call8 40006be4 <memset> -40001dc0: 0a2d mov.n a2, a10 -40001dc2: f01d retw.n - -40001dc4 <_X_ets_memcpy>: -40001dc4: 004136 entry a1, 32 -40001dc7: 04cd mov.n a12, a4 -40001dc9: 03bd mov.n a11, a3 -40001dcb: 02ad mov.n a10, a2 -40001dcd: 04ba65 call8 40006974 <memcpy> -40001dd0: 0a2d mov.n a2, a10 -40001dd2: f01d retw.n - -40001dd4 <_X_ets_memmove>: -40001dd4: 004136 entry a1, 32 -40001dd7: 04cd mov.n a12, a4 -40001dd9: 03bd mov.n a11, a3 -40001ddb: 02ad mov.n a10, a2 -40001ddd: 04c8e5 call8 40006a6c <memmove> -40001de0: 0a2d mov.n a2, a10 -40001de2: f01d retw.n - -40001de4 <_X_ets_memcmp>: -40001de4: 004136 entry a1, 32 -40001de7: 04cd mov.n a12, a4 -40001de9: 03bd mov.n a11, a3 -40001deb: 02ad mov.n a10, a2 -40001ded: 04afe5 call8 400068ec <memcmp> -40001df0: 0a2d mov.n a2, a10 -40001df2: f01d retw.n -40001df4: ffda90 excw -40001df7: 3f .byte 0x3f -40001df8: 004136 entry a1, 32 -40001dfb: 000292 l8ui a9, a2, 0 -40001dfe: fffd81 l32r a8, 40001df4 <_X_ets_memcmp+0x10> -40001e01: 010262 l8ui a6, a2, 1 -40001e04: 0858 l32i.n a5, a8, 0 -40001e06: 116680 slli a6, a6, 8 -40001e09: 206690 or a6, a6, a9 -40001e0c: 665a add.n a6, a6, a5 -40001e0e: 071267 beq a2, a6, 40001e19 <_X_ets_memcmp+0x35> -40001e11: 040692 l8ui a9, a6, 4 -40001e14: 18e8 l32i.n a14, a8, 4 -40001e16: 04e916 beqz a9, 40001e68 <_X_ets_memcmp+0x84> -40001e19: 030272 l8ui a7, a2, 3 -40001e1c: 020292 l8ui a9, a2, 2 -40001e1f: 117780 slli a7, a7, 8 -40001e22: 207790 or a7, a7, a9 -40001e25: 675a add.n a6, a7, a5 -40001e27: 391267 beq a2, a6, 40001e64 <_X_ets_memcmp+0x80> -40001e2a: 040692 l8ui a9, a6, 4 -40001e2d: 28a8 l32i.n a10, a8, 8 -40001e2f: 19fc bnez.n a9, 40001e64 <_X_ets_memcmp+0x80> -40001e31: 41b870 srli a11, a7, 8 -40001e34: 0102d2 l8ui a13, a2, 1 -40001e37: 0002e2 l8ui a14, a2, 0 -40001e3a: 11dd80 slli a13, a13, 8 -40001e3d: 20dde0 or a13, a13, a14 -40001e40: 0046d2 s8i a13, a6, 0 -40001e43: 41d8d0 srli a13, a13, 8 -40001e46: 0146d2 s8i a13, a6, 1 -40001e49: 0102c2 l8ui a12, a2, 1 -40001e4c: 0002d2 l8ui a13, a2, 0 -40001e4f: 11cc80 slli a12, a12, 8 -40001e52: 20ccd0 or a12, a12, a13 -40001e55: cc5a add.n a12, a12, a5 -40001e57: 024c72 s8i a7, a12, 2 -40001e5a: 034cb2 s8i a11, a12, 3 -40001e5d: 019a27 bne a10, a2, 40001e62 <_X_ets_memcmp+0x7e> -40001e60: 2869 s32i.n a6, a8, 8 -40001e62: f01d retw.n -40001e64: f01d retw.n -40001e66: 670000 excw -40001e69: 1e .byte 0x1e -40001e6a: 50ad excw -40001e6c: a2c032 addi a3, a0, -94 -40001e6f: 920006 j 3ffe6673 <_start-0x1998d> -40001e72: f20106 j 3fffe67a <_start-0x1986> -40001e75: 0228 l32i.n a2, a2, 0 -40001e77: 119980 slli a9, a9, 8 -40001e7a: 029f67 bne a15, a6, 40001e80 <_X_ets_memcmp+0x9c> -40001e7d: 026822 s32i a2, a8, 8 -40001e80: 2099a0 or a9, a9, a10 -40001e83: 004292 s8i a9, a2, 0 -40001e86: 419890 srli a9, a9, 8 -40001e89: 014292 s8i a9, a2, 1 -40001e8c: 010642 l8ui a4, a6, 1 -40001e8f: 000692 l8ui a9, a6, 0 -40001e92: 114480 slli a4, a4, 8 -40001e95: 204490 or a4, a4, a9 -40001e98: 445a add.n a4, a4, a5 -40001e9a: 024432 s8i a3, a4, 2 -40001e9d: 413830 srli a3, a3, 8 -40001ea0: 034432 s8i a3, a4, 3 -40001ea3: ffdc86 j 40001e19 <_X_ets_memcmp+0x35> -40001ea6: 360000 excw -40001ea9: 1c0041 l32r a4, 3ffc8eac <_start-0x37154> -40001eac: 051c03 excw -40001eaf: 180c movi.n a8, 1 -40001eb1: fca291 l32r a9, 4000113c <_c_0x1000> -40001eb4: 0d0c movi.n a13, 0 -40001eb6: 0c1c movi.n a12, 16 -40001eb8: cb7c movi.n a11, -4 -40001eba: a23b addi.n a10, a2, 3 -40001ebc: 10aab0 and a10, a10, a11 -40001ebf: 014ac2 s8i a12, a10, 1 -40001ec2: 024ad2 s8i a13, a10, 2 -40001ec5: 004a92 s8i a9, a10, 0 -40001ec8: 034ad2 s8i a13, a10, 3 -40001ecb: 044ad2 s8i a13, a10, 4 -40001ece: ffc9b1 l32r a11, 40001df4 <_X_ets_memcmp+0x10> -40001ed1: 10da42 addmi a4, a10, 0x1000 -40001ed4: 0ba9 s32i.n a10, a11, 0 -40001ed6: 2ba9 s32i.n a10, a11, 8 -40001ed8: 004492 s8i a9, a4, 0 -40001edb: 1b49 s32i.n a4, a11, 4 -40001edd: 024492 s8i a9, a4, 2 -40001ee0: 044482 s8i a8, a4, 4 -40001ee3: 014452 s8i a5, a4, 1 -40001ee6: 034432 s8i a3, a4, 3 -40001ee9: f01d retw.n -40001eeb: 413600 srli a3, a0, 6 -40001eee: b28c00 mulsh a8, a12, a0 -40001ef1: ffc0a1 l32r a10, 40001df4 <_X_ets_memcmp+0x10> -40001ef4: 0a88 l32i.n a8, a10, 0 -40001ef6: 1a98 l32i.n a9, a10, 4 -40001ef8: 023287 bltu a2, a8, 40001efe <_X_ets_memcmp+0x11a> -40001efb: 013297 bltu a2, a9, 40001f00 <_X_ets_memcmp+0x11c> -40001efe: f01d retw.n -40001f00: 0c0c movi.n a12, 0 -40001f02: 2ad8 l32i.n a13, a10, 8 -40001f04: f8c2b2 addi a11, a2, -8 -40001f07: 63ddb0 minu a13, a13, a11 -40001f0a: 044bc2 s8i a12, a11, 4 -40001f0d: 2ad9 s32i.n a13, a10, 8 -40001f0f: 0bad mov.n a10, a11 -40001f11: ffee65 call8 40001df8 <_X_ets_memcmp+0x14> -40001f14: f01d retw.n -40001f16: fc0000 excw -40001f19: ff .byte 0xff -40001f1a: 360000 excw -40001f1d: c10041 l32r a4, 3fff2320 <_start-0xdce0> -40001f20: 51fc87 bbsi a12, 24, 40001f75 <_X_ets_memcmp+0x191> -40001f23: fffd excw -40001f25: 433b addi.n a4, a3, 3 -40001f27: 104450 and a4, a4, a5 -40001f2a: c50c movi.n a5, 12 -40001f2c: 734450 maxu a4, a4, a5 -40001f2f: f43040 extui a3, a4, 0, 16 -40001f32: 02bc37 bgeu a12, a3, 40001f38 <_X_ets_memcmp+0x154> -40001f35: 002246 j 40001fc2 <_X_ets_memcmp+0x1de> -40001f38: ffaf91 l32r a9, 40001df4 <_X_ets_memcmp+0x10> -40001f3b: 0968 l32i.n a6, a9, 0 -40001f3d: 1988 l32i.n a8, a9, 4 -40001f3f: 7d3267 bltu a2, a6, 40001fc0 <_X_ets_memcmp+0x1dc> -40001f42: 7ab287 bgeu a2, a8, 40001fc0 <_X_ets_memcmp+0x1dc> -40001f45: f8c2b2 addi a11, a2, -8 -40001f48: 010b82 l8ui a8, a11, 1 -40001f4b: 000ba2 l8ui a10, a11, 0 -40001f4e: 118880 slli a8, a8, 8 -40001f51: 2088a0 or a8, a8, a10 -40001f54: c0a260 sub a10, a2, a6 -40001f57: f8caa2 addi a10, a10, -8 -40001f5a: c078a0 sub a7, a8, a10 -40001f5d: f8c772 addi a7, a7, -8 -40001f60: f47070 extui a7, a7, 0, 16 -40001f63: 5b3737 bltu a7, a3, 40001fc2 <_X_ets_memcmp+0x1de> -40001f66: 561737 beq a7, a3, 40001fc0 <_X_ets_memcmp+0x1dc> -40001f69: d86a add.n a13, a8, a6 -40001f6b: 040df2 l8ui a15, a13, 4 -40001f6e: 0e0c movi.n a14, 0 -40001f70: 052f16 beqz a15, 40001fc6 <_X_ets_memcmp+0x1e2> -40001f73: 14c342 addi a4, a3, 20 -40001f76: 463747 bltu a7, a4, 40001fc0 <_X_ets_memcmp+0x1dc> -40001f79: 2958 l32i.n a5, a9, 8 -40001f7b: 41f880 srli a15, a8, 8 -40001f7e: 4148a0 srli a4, a10, 8 -40001f81: 3a3a add.n a3, a10, a3 -40001f83: 338b addi.n a3, a3, 8 -40001f85: f4d030 extui a13, a3, 0, 16 -40001f88: d6da add.n a13, a6, a13 -40001f8a: 034d42 s8i a4, a13, 3 -40001f8d: 024da2 s8i a10, a13, 2 -40001f90: 014df2 s8i a15, a13, 1 -40001f93: 044de2 s8i a14, a13, 4 -40001f96: 004d82 s8i a8, a13, 0 -40001f99: 6355d0 minu a5, a5, a13 -40001f9c: 2959 s32i.n a5, a9, 8 -40001f9e: 418830 srli a8, a3, 8 -40001fa1: 004b32 s8i a3, a11, 0 -40001fa4: 014b82 s8i a8, a11, 1 -40001fa7: 010d72 l8ui a7, a13, 1 -40001faa: 000dd2 l8ui a13, a13, 0 -40001fad: 117780 slli a7, a7, 8 -40001fb0: 2077d0 or a7, a7, a13 -40001fb3: 0917c7 beq a7, a12, 40001fc0 <_X_ets_memcmp+0x1dc> -40001fb6: 476a add.n a4, a7, a6 -40001fb8: 024432 s8i a3, a4, 2 -40001fbb: 034482 s8i a8, a4, 3 -40001fbe: f01d retw.n -40001fc0: f01d retw.n -40001fc2: 020c movi.n a2, 0 -40001fc4: f01d retw.n -40001fc6: 2958 l32i.n a5, a9, 8 -40001fc8: 4148a0 srli a4, a10, 8 -40001fcb: 000db2 l8ui a11, a13, 0 -40001fce: 010d82 l8ui a8, a13, 1 -40001fd1: 3a3a add.n a3, a10, a3 -40001fd3: 338b addi.n a3, a3, 8 -40001fd5: f47030 extui a7, a3, 0, 16 -40001fd8: 118880 slli a8, a8, 8 -40001fdb: 2088b0 or a8, a8, a11 -40001fde: 807670 add a7, a6, a7 -40001fe1: 0247a2 s8i a10, a7, 2 -40001fe4: 0447e2 s8i a14, a7, 4 -40001fe7: 034742 s8i a4, a7, 3 -40001fea: 41f880 srli a15, a8, 8 -40001fed: 004782 s8i a8, a7, 0 -40001ff0: 0147f2 s8i a15, a7, 1 -40001ff3: 418830 srli a8, a3, 8 -40001ff6: 0295d7 bne a5, a13, 40001ffc <_X_ets_memcmp+0x218> -40001ff9: 026972 s32i a7, a9, 8 -40001ffc: f8c2d2 addi a13, a2, -8 -40001fff: 014d82 s8i a8, a13, 1 -40002002: 004d32 s8i a3, a13, 0 -40002005: 0107b2 l8ui a11, a7, 1 -40002008: 000792 l8ui a9, a7, 0 -4000200b: 117b80 slli a7, a11, 8 -4000200e: 207790 or a7, a7, a9 -40002011: ab17c7 beq a7, a12, 40001fc0 <_X_ets_memcmp+0x1dc> -40002014: 976a add.n a9, a7, a6 -40002016: 024932 s8i a3, a9, 2 -40002019: 034982 s8i a8, a9, 3 -4000201c: f01d retw.n -4000201e: 360000 excw -40002021: 160041 l32r a4, 3ffc7824 <_start-0x387dc> -40002024: b105d2 l8ui a13, a5, 177 -40002027: ffbc beqz.n a15, 4000206a <_X_ets_memcmp+0x286> -40002029: a23b addi.n a10, a2, 3 -4000202b: 10aab0 and a10, a10, a11 -4000202e: cb0c movi.n a11, 12 -40002030: 73aab0 maxu a10, a10, a11 -40002033: fc42b1 l32r a11, 4000113c <_c_0x1000> -40002036: f4a0a0 extui a10, a10, 0, 16 -40002039: 473ba7 bltu a11, a10, 40002084 <_X_ets_memcmp+0x2a0> -4000203c: ff6ed1 l32r a13, 40001df4 <_X_ets_memcmp+0x10> -4000203f: 002d62 l32i a6, a13, 0 -40002042: 022d92 l32i a9, a13, 8 -40002045: c07ba0 sub a7, a11, a10 -40002048: c02960 sub a2, a9, a6 -4000204b: f42020 extui a2, a2, 0, 16 -4000204e: 32a277 bge a2, a7, 40002084 <_X_ets_memcmp+0x2a0> -40002051: 188076 loop a0, 4000206d <_X_ets_memcmp+0x289> -40002054: 862a add.n a8, a6, a2 -40002056: 040832 l8ui a3, a8, 4 -40002059: 010852 l8ui a5, a8, 1 -4000205c: 0008c2 l8ui a12, a8, 0 -4000205f: 115580 slli a5, a5, 8 -40002062: 2055c0 or a5, a5, a12 -40002065: 007316 beqz a3, 40002070 <_X_ets_memcmp+0x28c> -40002068: 052d mov.n a2, a5 -4000206a: 16a577 bge a5, a7, 40002084 <_X_ets_memcmp+0x2a0> -4000206d: fff806 j 40002051 <_X_ets_memcmp+0x26d> -40002070: c0c520 sub a12, a5, a2 -40002073: f8ccc2 addi a12, a12, -8 -40002076: ee3ca7 bltu a12, a10, 40002068 <_X_ets_memcmp+0x284> -40002079: 1e0c movi.n a14, 1 -4000207b: 14caf2 addi a15, a10, 20 -4000207e: 4f3cf7 bltu a12, a15, 400020d1 <_X_ets_memcmp+0x2ed> -40002081: 0000c6 j 40002088 <_X_ets_memcmp+0x2a4> -40002084: 020c movi.n a2, 0 -40002086: f01d retw.n -40002088: 41f820 srli a15, a2, 8 -4000208b: 41c850 srli a12, a5, 8 -4000208e: 040c movi.n a4, 0 -40002090: 72aa add.n a7, a2, a10 -40002092: 778b addi.n a7, a7, 8 -40002094: f43070 extui a3, a7, 0, 16 -40002097: 363a add.n a3, a6, a3 -40002099: 044342 s8i a4, a3, 4 -4000209c: 0143c2 s8i a12, a3, 1 -4000209f: 024322 s8i a2, a3, 2 -400020a2: 004352 s8i a5, a3, 0 -400020a5: 0343f2 s8i a15, a3, 3 -400020a8: 415870 srli a5, a7, 8 -400020ab: 0448e2 s8i a14, a8, 4 -400020ae: 004872 s8i a7, a8, 0 -400020b1: 014852 s8i a5, a8, 1 -400020b4: 010322 l8ui a2, a3, 1 -400020b7: 000332 l8ui a3, a3, 0 -400020ba: 112280 slli a2, a2, 8 -400020bd: 202230 or a2, a2, a3 -400020c0: 1012b7 beq a2, a11, 400020d4 <_X_ets_memcmp+0x2f0> -400020c3: a62a add.n a10, a6, a2 -400020c5: 024a72 s8i a7, a10, 2 -400020c8: 034a52 s8i a5, a10, 3 -400020cb: 000146 j 400020d4 <_X_ets_memcmp+0x2f0> -400020ce: 000000 ill -400020d1: 0448e2 s8i a14, a8, 4 -400020d4: 219987 bne a9, a8, 400020f9 <_X_ets_memcmp+0x315> -400020d7: 0409b2 l8ui a11, a9, 4 -400020da: bb9c beqz.n a11, 400020f9 <_X_ets_memcmp+0x315> -400020dc: 1d28 l32i.n a2, a13, 4 -400020de: 171297 beq a2, a9, 400020f9 <_X_ets_memcmp+0x315> -400020e1: 0109b2 l8ui a11, a9, 1 -400020e4: 0009a2 l8ui a10, a9, 0 -400020e7: 119b80 slli a9, a11, 8 -400020ea: 2099a0 or a9, a9, a10 -400020ed: 969a add.n a9, a6, a9 -400020ef: 0409c2 l8ui a12, a9, 4 -400020f2: 2d99 s32i.n a9, a13, 8 -400020f4: 1c8c beqz.n a12, 400020f9 <_X_ets_memcmp+0x315> -400020f6: e79297 bne a2, a9, 400020e1 <_X_ets_memcmp+0x2fd> -400020f9: 288b addi.n a2, a8, 8 -400020fb: f01d retw.n -400020fd: 000000 ill -40002100: 004136 entry a1, 32 -40002103: c13230 mul16u a3, a2, a3 -40002106: f4a030 extui a10, a3, 0, 16 -40002109: fff165 call8 40002020 <_X_ets_memcmp+0x23c> -4000210c: 202aa0 or a2, a10, a10 -4000210f: 007a16 beqz a10, 4000211a <_X_ets_memcmp+0x336> -40002112: 20c330 or a12, a3, a3 -40002115: 0b0c movi.n a11, 0 -40002117: ffc9e5 call8 40001db4 <_X_ets_memset> -4000211a: f01d retw.n -4000211c: 004136 entry a1, 32 -4000211f: 02bd mov.n a11, a2 -40002121: 1a0c movi.n a10, 1 -40002123: fffde5 call8 40002100 <_X_ets_memcmp+0x31c> -40002126: 0a2d mov.n a2, a10 -40002128: f01d retw.n -4000212a: 360000 excw -4000212d: 4d0041 l32r a4, 3ffd5530 <_start-0x2aad0> -40002130: 03ad02 movi a0, 0xfffffd03 -40002133: ffeee5 call8 40002020 <_X_ets_memcmp+0x23c> -40002136: 0a2d mov.n a2, a10 -40002138: 2acc bnez.n a10, 4000213e <_X_ets_memcmp+0x35a> -4000213a: f01d retw.n -4000213c: 300000 xor a0, a0, a0 -4000213f: 4020c3 excw -40002142: e520b4 excw -40002145: 40ffc7 bbsi a15, 28, 40002189 <_st_0x3fffda9c+0x39> -40002148: 2520a4 excw -4000214b: ffda add.n a15, a15, a13 -4000214d: f01d retw.n - ... - -40002150 <_st_0x3fffda9c>: -40002150: da9c beqz.n a10, 40002171 <_st_0x3fffda9c+0x21> -40002152: ff .byte 0xff -40002153: 3f .byte 0x3f -40002154: 00fff2 s32ri a15, a15, 0 -40002157: 413600 srli a3, a0, 6 -4000215a: fd4100 excw -4000215d: ff .byte 0xff -4000215e: 1258 l32i.n a5, a2, 4 -40002160: 0429 s32i.n a2, a4, 0 -40002162: 55eb addi.n a5, a5, 14 -40002164: 1459 s32i.n a5, a4, 4 -40002166: fffb51 l32r a5, 40002154 <_st_0x3fffda9c+0x4> -40002169: 0020c0 memw -4000216c: 0238 l32i.n a3, a2, 0 -4000216e: b43030 extui a3, a3, 0, 12 -40002171: 335a add.n a3, a3, a5 -40002173: 045432 s16i a3, a4, 8 -40002176: f01d retw.n -40002178: cc8c beqz.n a12, 40002188 <_st_0x3fffda9c+0x38> -4000217a: ff .byte 0xff -4000217b: 3f .byte 0x3f -4000217c: 004136 entry a1, 32 -4000217f: fff4b1 l32r a11, 40002150 <_st_0x3fffda9c> -40002182: 041b92 l16ui a9, a11, 8 -40002185: 1b88 l32i.n a8, a11, 4 -40002187: d98c beqz.n a9, 40002198 <_st_0x3fffda9c+0x48> -40002189: 004822 s8i a2, a8, 0 -4000218c: a90b addi.n a10, a9, -1 -4000218e: 045ba2 s16i a10, a11, 8 -40002191: 881b addi.n a8, a8, 1 -40002193: 1b89 s32i.n a8, a11, 4 -40002195: f01d retw.n -40002197: f8a100 excw -4000219a: ff .byte 0xff -4000219b: 0066a5 call8 40002804 <ets_printf> -4000219e: f01d retw.n -400021a0: 217c movi.n a1, -14 -400021a2: 364000 excw -400021a5: bd00a1 l32r a10, 3fff15a8 <_start-0xea58> -400021a8: 412902 l32i a0, a9, 0x104 -400021ab: 5139 s32i.n a3, a1, 20 -400021ad: 6149 s32i.n a4, a1, 24 -400021af: 7159 s32i.n a5, a1, 28 -400021b1: 8169 s32i.n a6, a1, 32 -400021b3: 9179 s32i.n a7, a1, 36 -400021b5: fffaa1 l32r a10, 400021a0 <_st_0x3fffda9c+0x50> -400021b8: 30c1c2 addi a12, a1, 48 -400021bb: 4e0c movi.n a14, 4 -400021bd: 10c1d2 addi a13, a1, 16 -400021c0: 11d9 s32i.n a13, a1, 4 -400021c2: 21e9 s32i.n a14, a1, 8 -400021c4: 01c9 s32i.n a12, a1, 0 -400021c6: 0015e5 call8 40002324 <_X_ets_unk225c+0xc8> -400021c9: 0a2d mov.n a2, a10 -400021cb: f01d retw.n -400021cd: 000000 ill -400021d0: 004136 entry a1, 32 -400021d3: ffdfa1 l32r a10, 40002150 <_st_0x3fffda9c> -400021d6: 002ab2 l32i a11, a10, 0 -400021d9: 012bd2 l32i a13, a11, 4 -400021dc: 0ccd92 addi a9, a13, 12 -400021df: 0020c0 memw -400021e2: f0a0f2 movi a15, 240 -400021e5: 0be8 l32i.n a14, a11, 0 -400021e7: cd2b addi.n a12, a13, 2 -400021e9: b480e0 extui a8, a14, 0, 12 -400021ec: 34e8e0 extui a14, a14, 8, 4 -400021ef: 004c82 s8i a8, a12, 0 -400021f2: 014ce2 s8i a14, a12, 1 -400021f5: 8c0c movi.n a12, 8 -400021f7: 000de2 l8ui a14, a13, 0 -400021fa: 014dc2 s8i a12, a13, 1 -400021fd: 10eef0 and a14, a14, a15 -40002200: 004de2 s8i a14, a13, 0 -40002203: 041aa2 l16ui a10, a10, 8 -40002206: 0020c0 memw -40002209: 0b88 l32i.n a8, a11, 0 -4000220b: b48080 extui a8, a8, 0, 12 -4000220e: c088a0 sub a8, a8, a10 -40002211: 0bad mov.n a10, a11 -40002213: f2c882 addi a8, a8, -14 -40002216: 005982 s16i a8, a9, 0 -40002219: 02fb25 call8 400051cc <_XX_unk51ac+0x20> -4000221c: f01d retw.n -4000221e: 360000 excw -40002221: 310041 l32r a4, 3ffce624 <_start-0x319dc> -40002224: ffcb addi.n a15, a15, 12 -40002226: 33b8 l32i.n a11, a3, 12 -40002228: 4b8c beqz.n a11, 40002230 <_st_0x3fffda9c+0xe0> -4000222a: 20a220 or a10, a2, a2 -4000222d: 000be0 callx8 a11 -40002230: 43b8 l32i.n a11, a3, 16 -40002232: 3b8c beqz.n a11, 40002239 <_st_0x3fffda9c+0xe9> -40002234: 02ad mov.n a10, a2 -40002236: 000be0 callx8 a11 -40002239: f01d retw.n - ... - -4000223c <_X_ets_uart_putc>: -4000223c: 004136 entry a1, 32 -4000223f: 0b9226 beqi a2, 10, 4000224e <_X_ets_uart_putc+0x12> -40002242: d80c movi.n a8, 13 -40002244: 041287 beq a2, a8, 4000224c <_X_ets_uart_putc+0x10> -40002247: 02ad mov.n a10, a2 -40002249: 013e25 call8 4000362c <uart_tx_one_char> -4000224c: f01d retw.n -4000224e: 0da0a2 movi a10, 13 -40002251: 013da5 call8 4000362c <uart_tx_one_char> -40002254: 0aa0a2 movi a10, 10 -40002257: 013d65 call8 4000362c <uart_tx_one_char> -4000225a: f01d retw.n - -4000225c <_X_ets_unk225c>: -4000225c: 00a136 entry a1, 80 -4000225f: 068d mov.n a8, a6 -40002261: 090c movi.n a9, 0 -40002263: 1b0c movi.n a11, 1 -40002265: 0a0c movi.n a10, 0 -40002267: 83ab30 moveqz a10, a11, a3 -4000226a: 839b20 moveqz a9, a11, a2 -4000226d: 0909a7 bnone a9, a10, 4000227a <_X_ets_unk225c+0x1e> -40002270: 711b addi.n a7, a1, 1 -40002272: 0c3c movi.n a12, 48 -40002274: 0041c2 s8i a12, a1, 0 -40002277: 001046 j 400022bc <_X_ets_unk225c+0x60> -4000227a: 017d mov.n a7, a1 -4000227c: 316f50 srai a6, a5, 31 -4000227f: 086182 s32i a8, a1, 32 -40002282: 20b330 or a11, a3, a3 -40002285: 20a220 or a10, a2, a2 -40002288: 06dd mov.n a13, a6 -4000228a: 05cd mov.n a12, a5 -4000228c: 04bd65 call8 40006e64 <__umoddi3> -4000228f: 03bd mov.n a11, a3 -40002291: 81d8 l32i.n a13, a1, 32 -40002293: 05cd mov.n a12, a5 -40002295: ddaa add.n a13, a13, a10 -40002297: 000dd2 l8ui a13, a13, 0 -4000229a: 02ad mov.n a10, a2 -4000229c: 0047d2 s8i a13, a7, 0 -4000229f: 771b addi.n a7, a7, 1 -400022a1: 06dd mov.n a13, a6 -400022a3: 0498e5 call8 40006c30 <__udivdi3> -400022a6: 0b3d mov.n a3, a11 -400022a8: 0a2d mov.n a2, a10 -400022aa: 0aed mov.n a14, a10 -400022ac: 180c movi.n a8, 1 -400022ae: 0bfd mov.n a15, a11 -400022b0: 93f8b0 movnez a15, a8, a11 -400022b3: 93e8a0 movnez a14, a8, a10 -400022b6: 20eef0 or a14, a14, a15 -400022b9: fc5e56 bnez a14, 40002282 <_X_ets_unk225c+0x26> -400022bc: 441717 beq a7, a1, 40002304 <_X_ets_unk225c+0xa8> -400022bf: c02710 sub a2, a7, a1 -400022c2: 149020 extui a9, a2, 0, 2 -400022c5: 099976 loopnez a9, 400022d2 <_X_ets_unk225c+0x76> -400022c8: 770b addi.n a7, a7, -1 -400022ca: 0007a2 l8ui a10, a7, 0 -400022cd: 0044a2 s8i a10, a4, 0 -400022d0: 441b addi.n a4, a4, 1 -400022d2: 419220 srli a9, a2, 2 -400022d5: 249976 loopnez a9, 400022fd <_X_ets_unk225c+0xa1> -400022d8: 970b addi.n a9, a7, -1 -400022da: fec7b2 addi a11, a7, -2 -400022dd: fdc7c2 addi a12, a7, -3 -400022e0: 000992 l8ui a9, a9, 0 -400022e3: 000bb2 l8ui a11, a11, 0 -400022e6: 000cc2 l8ui a12, a12, 0 -400022e9: fcc772 addi a7, a7, -4 -400022ec: 004492 s8i a9, a4, 0 -400022ef: 0144b2 s8i a11, a4, 1 -400022f2: 0244c2 s8i a12, a4, 2 -400022f5: 000792 l8ui a9, a7, 0 -400022f8: 034492 s8i a9, a4, 3 -400022fb: 444b addi.n a4, a4, 4 -400022fd: 0b0c movi.n a11, 0 -400022ff: 0044b2 s8i a11, a4, 0 -40002302: f01d retw.n -40002304: 020c movi.n a2, 0 -40002306: 0c0c movi.n a12, 0 -40002308: 0044c2 s8i a12, a4, 0 -4000230b: f01d retw.n -4000230d: 000000 ill -40002310: ffc8a0 excw -40002313: 3f .byte 0x3f -40002314: cca8 l32i.n a10, a12, 48 -40002316: ff .byte 0xff -40002317: 3f .byte 0x3f -40002318: cc9c beqz.n a12, 40002338 <_X_ets_unk225c+0xdc> -4000231a: ff .byte 0xff -4000231b: 3f .byte 0x3f -4000231c: ffccd0 excw -4000231f: 3f .byte 0x3f -40002320: ccbc beqz.n a12, 40002360 <_X_ets_unk225c+0x104> -40002322: ff .byte 0xff -40002323: 3f .byte 0x3f -40002324: 00e136 entry a1, 112 -40002327: 106162 s32i a6, a1, 64 -4000232a: 04dd mov.n a13, a4 -4000232c: 05cd mov.n a12, a5 -4000232e: 000352 l8ui a5, a3, 0 -40002331: 431b addi.n a4, a3, 1 -40002333: 42b516 beqz a5, 40002762 <_X_ets_unk225c+0x506> -40002336: 030c movi.n a3, 0 -40002338: a1d9 s32i.n a13, a1, 40 -4000233a: 91c9 s32i.n a12, a1, 36 -4000233c: 080c movi.n a8, 0 -4000233e: 060c movi.n a6, 0 -40002340: 090c movi.n a9, 0 -40002342: 116192 s32i a9, a1, 68 -40002345: d169 s32i.n a6, a1, 52 -40002347: e189 s32i.n a8, a1, 56 -40002349: 016d mov.n a6, a1 -4000234b: 582c movi.n a8, 37 -4000234d: 1b1587 beq a5, a8, 4000236c <_X_ets_unk225c+0x110> -40002350: 05ad mov.n a10, a5 -40002352: 0002e0 callx8 a2 -40002355: 1121a2 l32i a10, a1, 68 -40002358: aa1b addi.n a10, a10, 1 -4000235a: 1161a2 s32i a10, a1, 68 -4000235d: 000452 l8ui a5, a4, 0 -40002360: 01c442 addi a4, a4, 1 -40002363: 19e516 beqz a5, 40002505 <_X_ets_unk225c+0x2a9> -40002366: 25a0b2 movi a11, 37 -40002369: e395b7 bne a5, a11, 40002350 <_X_ets_unk225c+0xf4> -4000236c: 000452 l8ui a5, a4, 0 -4000236f: 441b addi.n a4, a4, 1 -40002371: d3c5c2 addi a12, a5, -45 -40002374: 192c16 beqz a12, 4000250a <_X_ets_unk225c+0x2ae> -40002377: d0c5d2 addi a13, a5, -48 -4000237a: 0e0c movi.n a14, 0 -4000237c: f1e9 s32i.n a14, a1, 60 -4000237e: 197d16 beqz a13, 40002519 <_X_ets_unk225c+0x2bd> -40002381: 0f0c movi.n a15, 0 -40002383: c1f9 s32i.n a15, a1, 48 -40002385: f82c movi.n a8, 47 -40002387: 27b857 bgeu a8, a5, 400023b2 <_X_ets_unk225c+0x156> -4000238a: 993c movi.n a9, 57 -4000238c: 223957 bltu a9, a5, 400023b2 <_X_ets_unk225c+0x156> -4000238f: 070c movi.n a7, 0 -40002391: 178076 loop a0, 400023ac <_X_ets_unk225c+0x150> -40002394: fc2c movi.n a12, 47 -40002396: a07770 addx4 a7, a7, a7 -40002399: 907750 addx2 a7, a7, a5 -4000239c: d0c772 addi a7, a7, -48 -4000239f: 000452 l8ui a5, a4, 0 -400023a2: 441b addi.n a4, a4, 1 -400023a4: 0cbc57 bgeu a12, a5, 400023b4 <_X_ets_unk225c+0x158> -400023a7: 983c movi.n a8, 57 -400023a9: 073857 bltu a8, a5, 400023b4 <_X_ets_unk225c+0x158> -400023ac: fff846 j 40002391 <_X_ets_unk225c+0x135> -400023af: 000000 ill -400023b2: 070c movi.n a7, 0 -400023b4: d2c592 addi a9, a5, -46 -400023b7: 301916 beqz a9, 400026bc <_X_ets_unk225c+0x460> -400023ba: 94c5a2 addi a10, a5, -108 -400023bd: 21ca16 beqz a10, 400025dd <_X_ets_unk225c+0x381> -400023c0: 4b4c movi.n a11, 68 -400023c2: 4615b7 beq a5, a11, 4000240c <_X_ets_unk225c+0x1b0> -400023c5: 5c5c movi.n a12, 85 -400023c7: 4115c7 beq a5, a12, 4000240c <_X_ets_unk225c+0x1b0> -400023ca: 8d5c movi.n a13, 88 -400023cc: 3c15d7 beq a5, a13, 4000240c <_X_ets_unk225c+0x1b0> -400023cf: 64a0e2 movi a14, 100 -400023d2: 3615e7 beq a5, a14, 4000240c <_X_ets_unk225c+0x1b0> -400023d5: 0e0c movi.n a14, 0 -400023d7: 0c0c movi.n a12, 0 -400023d9: 90c5f2 addi a15, a5, -112 -400023dc: 30cf16 beqz a15, 400026ec <_X_ets_unk225c+0x490> -400023df: 75a082 movi a8, 117 -400023e2: 051587 beq a5, a8, 400023eb <_X_ets_unk225c+0x18f> -400023e5: 78a092 movi a9, 120 -400023e8: 649597 bne a5, a9, 40002450 <_X_ets_unk225c+0x1f4> -400023eb: 31ac16 beqz a12, 40002709 <_X_ets_unk225c+0x4ad> -400023ee: 1021c2 l32i a12, a1, 64 -400023f1: 8b7c movi.n a11, -8 -400023f3: ac7b addi.n a10, a12, 7 -400023f5: 10aab0 and a10, a10, a11 -400023f8: 8b1c movi.n a11, 24 -400023fa: ca8b addi.n a12, a10, 8 -400023fc: 1061c2 s32i a12, a1, 64 -400023ff: 02abc7 bge a11, a12, 40002405 <_X_ets_unk225c+0x1a9> -40002402: 006106 j 4000258a <_X_ets_unk225c+0x32e> -40002405: 9198 l32i.n a9, a1, 36 -40002407: 0062c6 j 40002596 <_X_ets_unk225c+0x33a> -4000240a: d20000 quos a0, a0, a0 -4000240d: 1c1021 l32r a2, 3ffc9450 <_start-0x36bb0> -40002410: ad8c beqz.n a13, 4000241e <_X_ets_unk225c+0x1c2> -40002412: 4b0d excw -40002414: d2dd excw -40002416: d71061 l32r a6, 3fff8058 <_start-0x7fa8> -40002419: 042c movi.n a4, 32 -4000241b: 9198 l32i.n a9, a1, 36 -4000241d: 0002c6 j 4000242c <_X_ets_unk225c+0x1d0> -40002420: 8e1c movi.n a14, 24 -40002422: 042ea7 blt a14, a10, 4000242a <_X_ets_unk225c+0x1ce> -40002425: 4f2c movi.n a15, 36 -40002427: 1061f2 s32i a15, a1, 64 -4000242a: a198 l32i.n a9, a1, 40 -4000242c: 102182 l32i a8, a1, 64 -4000242f: 889a add.n a8, a8, a9 -40002431: ffd882 addmi a8, a8, 0xffffff00 -40002434: 3f2882 l32i a8, a8, 252 -40002437: 0d6182 s32i a8, a1, 52 -4000243a: 318f80 srai a8, a8, 31 -4000243d: 0e6182 s32i a8, a1, 56 -40002440: 9cc592 addi a9, a5, -100 -40002443: 167916 beqz a9, 400025ae <_X_ets_unk225c+0x352> -40002446: bcc5a2 addi a10, a5, -68 -40002449: 161a16 beqz a10, 400025ae <_X_ets_unk225c+0x352> -4000244c: 0b0c movi.n a11, 0 -4000244e: e1b9 s32i.n a11, a1, 56 -40002450: 0f0c movi.n a15, 0 -40002452: 81f9 s32i.n a15, a1, 32 -40002454: 485c movi.n a8, 84 -40002456: dbc5c2 addi a12, a5, -37 -40002459: 0bbc87 bgeu a12, a8, 40002468 <_X_ets_unk225c+0x20c> -4000245c: ffad91 l32r a9, 40002310 <_X_ets_unk225c+0xb4> -4000245f: a09c90 addx4 a9, a12, a9 -40002462: 0998 l32i.n a9, a9, 0 -40002464: 0009a0 jx a9 -40002467: 5a2c00 depbits a0, a12, 5, 3 -4000246a: 0002e0 callx8 a2 -4000246d: 05ad mov.n a10, a5 -4000246f: 0002e0 callx8 a2 -40002472: 1121a2 l32i a10, a1, 68 -40002475: aa2b addi.n a10, a10, 2 -40002477: 1161a2 s32i a10, a1, 68 -4000247a: b139 s32i.n a3, a1, 44 -4000247c: c1b8 l32i.n a11, a1, 48 -4000247e: 81c8 l32i.n a12, a1, 32 -40002480: c07730 sub a7, a7, a3 -40002483: ffc7e2 addi a14, a7, -1 -40002486: 937ec0 movnez a7, a14, a12 -40002489: 17cb16 beqz a11, 40002609 <_X_ets_unk225c+0x3ad> -4000248c: 00ec16 beqz a12, 4000249e <_X_ets_unk225c+0x242> -4000248f: 0cad mov.n a10, a12 -40002491: 0002e0 callx8 a2 -40002494: 1121f2 l32i a15, a1, 68 -40002497: 0c0c movi.n a12, 0 -40002499: ff1b addi.n a15, a15, 1 -4000249b: 1161f2 s32i a15, a1, 68 -4000249e: 053c movi.n a5, 48 -400024a0: f188 l32i.n a8, a1, 60 -400024a2: 0861c2 s32i a12, a1, 32 -400024a5: 167816 beqz a8, 40002610 <_X_ets_unk225c+0x3b4> -400024a8: 81c8 l32i.n a12, a1, 32 -400024aa: bc8c beqz.n a12, 400024b9 <_X_ets_unk225c+0x25d> -400024ac: 0cad mov.n a10, a12 -400024ae: 0002e0 callx8 a2 -400024b1: 112192 l32i a9, a1, 68 -400024b4: 991b addi.n a9, a9, 1 -400024b6: 116192 s32i a9, a1, 68 -400024b9: b1a8 l32i.n a10, a1, 44 -400024bb: ffca52 addi a5, a10, -1 -400024be: 203550 or a3, a5, a5 -400024c1: 181aa6 blti a10, 1, 400024dd <_X_ets_unk225c+0x281> -400024c4: 0006a2 l8ui a10, a6, 0 -400024c7: 661b addi.n a6, a6, 1 -400024c9: 0002e0 callx8 a2 -400024cc: 330b addi.n a3, a3, -1 -400024ce: f20366 bnei a3, -1, 400024c4 <_X_ets_unk225c+0x268> -400024d1: f37c movi.n a3, -1 -400024d3: 1121b2 l32i a11, a1, 68 -400024d6: c51b addi.n a12, a5, 1 -400024d8: bbca add.n a11, a11, a12 -400024da: 1161b2 s32i a11, a1, 68 -400024dd: f1d8 l32i.n a13, a1, 60 -400024df: e7ad16 beqz a13, 4000235d <_X_ets_unk225c+0x101> -400024e2: 07ed mov.n a14, a7 -400024e4: 570b addi.n a5, a7, -1 -400024e6: 057d mov.n a7, a5 -400024e8: 021ee6 bgei a14, 1, 400024ee <_X_ets_unk225c+0x292> -400024eb: ff9b86 j 4000235d <_X_ets_unk225c+0x101> -400024ee: 0a2c movi.n a10, 32 -400024f0: 0002e0 callx8 a2 -400024f3: 770b addi.n a7, a7, -1 -400024f5: f50766 bnei a7, -1, 400024ee <_X_ets_unk225c+0x292> -400024f8: 1121f2 l32i a15, a1, 68 -400024fb: 851b addi.n a8, a5, 1 -400024fd: ff8a add.n a15, a15, a8 -400024ff: 1161f2 s32i a15, a1, 68 -40002502: ff95c6 j 4000235d <_X_ets_unk225c+0x101> -40002505: 112122 l32i a2, a1, 68 -40002508: f01d retw.n -4000250a: 1a0c movi.n a10, 1 -4000250c: 000452 l8ui a5, a4, 0 -4000250f: 441b addi.n a4, a4, 1 -40002511: f1a9 s32i.n a10, a1, 60 -40002513: d0c592 addi a9, a5, -48 -40002516: e67956 bnez a9, 40002381 <_X_ets_unk225c+0x125> -40002519: 000452 l8ui a5, a4, 0 -4000251c: 1b0c movi.n a11, 1 -4000251e: 441b addi.n a4, a4, 1 -40002520: c1b9 s32i.n a11, a1, 48 -40002522: ff97c6 j 40002385 <_X_ets_unk225c+0x129> -40002525: 3c0000 excw -40002528: e00a add.n a14, a0, a0 -4000252a: a20002 l8ui a0, a0, 162 -4000252d: e078a0 subx4 a7, a8, a10 -40002530: 0c0002 l8ui a0, a0, 12 -40002533: 1c0c87 bnone a12, a8, 40002553 <_X_ets_unk225c+0x2f7> -40002536: c1c9 s32i.n a12, a1, 48 -40002538: 4d4c movi.n a13, 68 -4000253a: 3615d7 beq a5, a13, 40002574 <_X_ets_unk225c+0x318> -4000253d: 5e5c movi.n a14, 85 -4000253f: 3115e7 beq a5, a14, 40002574 <_X_ets_unk225c+0x318> -40002542: a8c5f2 addi a15, a5, -88 -40002545: 201f16 beqz a15, 4000274a <_X_ets_unk225c+0x4ee> -40002548: 64a082 movi a8, 100 -4000254b: 251587 beq a5, a8, 40002574 <_X_ets_unk225c+0x318> -4000254e: 70a092 movi a9, 112 -40002551: 0b1597 beq a5, a9, 40002560 <_X_ets_unk225c+0x304> -40002554: 75a0a2 movi a10, 117 -40002557: 1915a7 beq a5, a10, 40002574 <_X_ets_unk225c+0x318> -4000255a: 78a0b2 movi a11, 120 -4000255d: 2395b7 bne a5, a11, 40002584 <_X_ets_unk225c+0x328> -40002560: e1b8 l32i.n a11, a1, 56 -40002562: d1a8 l32i.n a10, a1, 52 -40002564: 01cd mov.n a12, a1 -40002566: 0d1c movi.n a13, 16 -40002568: ff6be1 l32r a14, 40002314 <_X_ets_unk225c+0xb8> -4000256b: ffcf25 call8 4000225c <_X_ets_unk225c> -4000256e: 0a3d mov.n a3, a10 -40002570: 000406 j 40002584 <_X_ets_unk225c+0x328> -40002573: e1b800 excw -40002576: d1a8 l32i.n a10, a1, 52 -40002578: 01cd mov.n a12, a1 -4000257a: ad0c movi.n a13, 10 -4000257c: ff67e1 l32r a14, 40002318 <_X_ets_unk225c+0xbc> -4000257f: ffcde5 call8 4000225c <_X_ets_unk225c> -40002582: 0a3d mov.n a3, a10 -40002584: 016d mov.n a6, a1 -40002586: ffbc06 j 4000247a <_X_ets_unk225c+0x21e> -40002589: 8c1c00 excw -4000258c: 042ca7 blt a12, a10, 40002594 <_X_ets_unk225c+0x338> -4000258f: 8d2c movi.n a13, 40 -40002591: 1061d2 s32i a13, a1, 64 -40002594: a198 l32i.n a9, a1, 40 -40002596: 1021f2 l32i a15, a1, 64 -40002599: 9cc5e2 addi a14, a5, -100 -4000259c: ff9a add.n a15, a15, a9 -4000259e: ffdff2 addmi a15, a15, 0xffffff00 -400025a1: 3f2f82 l32i a8, a15, 252 -400025a4: e189 s32i.n a8, a1, 56 -400025a6: 3e2ff2 l32i a15, a15, 248 -400025a9: d1f9 s32i.n a15, a1, 52 -400025ab: e97e56 bnez a14, 40002446 <_X_ets_unk225c+0x1ea> -400025ae: d1a8 l32i.n a10, a1, 52 -400025b0: 0d0c movi.n a13, 0 -400025b2: e188 l32i.n a8, a1, 56 -400025b4: 0c0c movi.n a12, 0 -400025b6: 0218e6 bgei a8, 1, 400025bc <_X_ets_unk225c+0x360> -400025b9: 006146 j 40002742 <_X_ets_unk225c+0x4e6> -400025bc: e90c16 beqz a12, 40002450 <_X_ets_unk225c+0x1f4> -400025bf: d1a8 l32i.n a10, a1, 52 -400025c1: fe7c movi.n a14, -1 -400025c3: e1c8 l32i.n a12, a1, 56 -400025c5: d92c movi.n a9, 45 -400025c7: 8199 s32i.n a9, a1, 32 -400025c9: 30cce0 xor a12, a12, a14 -400025cc: 60b0a0 neg a11, a10 -400025cf: d1b9 s32i.n a11, a1, 52 -400025d1: dc1b addi.n a13, a12, 1 -400025d3: 83cda0 moveqz a12, a13, a10 -400025d6: e1c9 s32i.n a12, a1, 56 -400025d8: ff9e06 j 40002454 <_X_ets_unk225c+0x1f8> -400025db: 520000 excw -400025de: 1b0004 mula.dd.hh.lddec m0, a0, m0, m2 -400025e1: c5f244 excw -400025e4: ff1694 excw -400025e7: 0e .byte 0xe -400025e8: 0c0c movi.n a12, 0 -400025ea: bcc582 addi a8, a5, -68 -400025ed: 0f4816 beqz a8, 400026e5 <_X_ets_unk225c+0x489> -400025f0: abc592 addi a9, a5, -85 -400025f3: 0ee916 beqz a9, 400026e5 <_X_ets_unk225c+0x489> -400025f6: a8c5a2 addi a10, a5, -88 -400025f9: 0e8a16 beqz a10, 400026e5 <_X_ets_unk225c+0x489> -400025fc: 9cc5b2 addi a11, a5, -100 -400025ff: 0e2b16 beqz a11, 400026e5 <_X_ets_unk225c+0x489> -40002602: 1e0c movi.n a14, 1 -40002604: ff7446 j 400023d9 <_X_ets_unk225c+0x17d> -40002607: c80000 excw -4000260a: 052cf1 l32r a15, 3ffc3abc <_start-0x3c544> -4000260d: e97c56 bnez a12, 400024a8 <_X_ets_unk225c+0x24c> -40002610: 07dd mov.n a13, a7 -40002612: 370b addi.n a3, a7, -1 -40002614: 037d mov.n a7, a3 -40002616: 021de6 bgei a13, 1, 4000261c <_X_ets_unk225c+0x3c0> -40002619: ffa2c6 j 400024a8 <_X_ets_unk225c+0x24c> -4000261c: 05ad mov.n a10, a5 -4000261e: 0002e0 callx8 a2 -40002621: 770b addi.n a7, a7, -1 -40002623: f50766 bnei a7, -1, 4000261c <_X_ets_unk225c+0x3c0> -40002626: f77c movi.n a7, -1 -40002628: 1121e2 l32i a14, a1, 68 -4000262b: f31b addi.n a15, a3, 1 -4000262d: eefa add.n a14, a14, a15 -4000262f: 1161e2 s32i a14, a1, 68 -40002632: ff9c86 j 400024a8 <_X_ets_unk225c+0x24c> -40002635: 102192 l32i a9, a1, 64 -40002638: 881c movi.n a8, 24 -4000263a: 09cd mov.n a12, a9 -4000263c: 994b addi.n a9, a9, 4 -4000263e: 106192 s32i a9, a1, 64 -40002641: 052897 blt a8, a9, 4000264a <_X_ets_unk225c+0x3ee> -40002644: 9198 l32i.n a9, a1, 36 -40002646: 000306 j 40002656 <_X_ets_unk225c+0x3fa> -40002649: 8a1c00 depbits a0, a12, 8, 2 -4000264c: 042ac7 blt a10, a12, 40002654 <_X_ets_unk225c+0x3f8> -4000264f: 4b2c movi.n a11, 36 -40002651: 1061b2 s32i a11, a1, 64 -40002654: a198 l32i.n a9, a1, 40 -40002656: 102162 l32i a6, a1, 64 -40002659: ff30d1 l32r a13, 4000231c <_X_ets_unk225c+0xc0> -4000265c: 669a add.n a6, a6, a9 -4000265e: ffd662 addmi a6, a6, 0xffffff00 -40002661: 3f2662 l32i a6, a6, 252 -40002664: 836d60 moveqz a6, a13, a6 -40002667: 0006c2 l8ui a12, a6, 0 -4000266a: 0efc16 beqz a12, 4000275d <_X_ets_unk225c+0x501> -4000266d: 069d mov.n a9, a6 -4000266f: 030c movi.n a3, 0 -40002671: 098076 loop a0, 4000267e <_X_ets_unk225c+0x422> -40002674: 331b addi.n a3, a3, 1 -40002676: 010982 l8ui a8, a9, 1 -40002679: 991b addi.n a9, a9, 1 -4000267b: dfb816 beqz a8, 4000247a <_X_ets_unk225c+0x21e> -4000267e: fffbc6 j 40002671 <_X_ets_unk225c+0x415> -40002681: 1021a2 l32i a10, a1, 64 -40002684: 891c movi.n a9, 24 -40002686: 0acd mov.n a12, a10 -40002688: aa4b addi.n a10, a10, 4 -4000268a: 1061a2 s32i a10, a1, 64 -4000268d: 0529a7 blt a9, a10, 40002696 <_X_ets_unk225c+0x43a> -40002690: 91c8 l32i.n a12, a1, 36 -40002692: 000306 j 400026a2 <_X_ets_unk225c+0x446> -40002695: 8b1c00 depbits a0, a12, 24, 2 -40002698: 042bc7 blt a11, a12, 400026a0 <_X_ets_unk225c+0x444> -4000269b: 4c2c movi.n a12, 36 -4000269d: 1061c2 s32i a12, a1, 64 -400026a0: a1c8 l32i.n a12, a1, 40 -400026a2: 1021a2 l32i a10, a1, 64 -400026a5: aaca add.n a10, a10, a12 -400026a7: ffdaa2 addmi a10, a10, 0xffffff00 -400026aa: fc0aa2 l8ui a10, a10, 252 -400026ad: 0002e0 callx8 a2 -400026b0: ff2846 j 40002355 <_X_ets_unk225c+0xf9> -400026b3: 5a2c movi.n a10, 37 -400026b5: 0002e0 callx8 a2 -400026b8: ff6f86 j 4000247a <_X_ets_unk225c+0x21e> -400026bb: fb2c00 depbits a0, a12, 31, 3 -400026be: 000452 l8ui a5, a4, 0 -400026c1: c1c8 l32i.n a12, a1, 48 -400026c3: 441b addi.n a4, a4, 1 -400026c5: cc1b addi.n a12, a12, 1 -400026c7: c1c9 s32i.n a12, a1, 48 -400026c9: 023b57 bltu a11, a5, 400026cf <_X_ets_unk225c+0x473> -400026cc: ff3a86 j 400023ba <_X_ets_unk225c+0x15e> -400026cf: 9d3c movi.n a13, 57 -400026d1: 25bd57 bgeu a13, a5, 400026fa <_X_ets_unk225c+0x49e> -400026d4: ff3886 j 400023ba <_X_ets_unk225c+0x15e> -400026d7: 1c0c00 excw -400026da: 000452 l8ui a5, a4, 0 -400026dd: 441b addi.n a4, a4, 1 -400026df: bcc5e2 addi a14, a5, -68 -400026e2: f0ae56 bnez a14, 400025f0 <_X_ets_unk225c+0x394> -400026e5: d05c56 bnez a12, 400023ee <_X_ets_unk225c+0x192> -400026e8: 000806 j 4000270c <_X_ets_unk225c+0x4b0> -400026eb: ec5600 excw -400026ee: cf .byte 0xcf -400026ef: 000646 j 4000270c <_X_ets_unk225c+0x4b0> -400026f2: 9f3c movi.n a15, 57 -400026f4: 02bf57 bgeu a15, a5, 400026fa <_X_ets_unk225c+0x49e> -400026f7: ff2fc6 j 400023ba <_X_ets_unk225c+0x15e> -400026fa: f82c movi.n a8, 47 -400026fc: 000452 l8ui a5, a4, 0 -400026ff: 441b addi.n a4, a4, 1 -40002701: ed3857 bltu a8, a5, 400026f2 <_X_ets_unk225c+0x496> -40002704: ff2c86 j 400023ba <_X_ets_unk225c+0x15e> -40002707: 160000 excw -4000270a: fe .byte 0xfe -4000270b: cf .byte 0xcf -4000270c: 1021b2 l32i a11, a1, 64 -4000270f: 891c movi.n a9, 24 -40002711: 0bad mov.n a10, a11 -40002713: bb4b addi.n a11, a11, 4 -40002715: 1061b2 s32i a11, a1, 64 -40002718: 0429b7 blt a9, a11, 40002720 <_X_ets_unk225c+0x4c4> -4000271b: 9198 l32i.n a9, a1, 36 -4000271d: 0002c6 j 4000272c <_X_ets_unk225c+0x4d0> -40002720: 8c1c movi.n a12, 24 -40002722: 042ca7 blt a12, a10, 4000272a <_X_ets_unk225c+0x4ce> -40002725: 4d2c movi.n a13, 36 -40002727: 1061d2 s32i a13, a1, 64 -4000272a: a198 l32i.n a9, a1, 40 -4000272c: 1021e2 l32i a14, a1, 64 -4000272f: ee9a add.n a14, a14, a9 -40002731: ffdee2 addmi a14, a14, 0xffffff00 -40002734: 3f2ee2 l32i a14, a14, 252 -40002737: d1e9 s32i.n a14, a1, 52 -40002739: 31efe0 srai a14, a14, 31 -4000273c: e1e9 s32i.n a14, a1, 56 -4000273e: ff3f86 j 40002440 <_X_ets_unk225c+0x1e4> -40002741: 28ac00 excw -40002744: 1c0c movi.n a12, 1 -40002746: ff9c86 j 400025bc <_X_ets_unk225c+0x360> -40002749: e1b800 excw -4000274c: d1a8 l32i.n a10, a1, 52 -4000274e: 01cd mov.n a12, a1 -40002750: 0d1c movi.n a13, 16 -40002752: fef3e1 l32r a14, 40002320 <_X_ets_unk225c+0xc4> -40002755: ffb065 call8 4000225c <_X_ets_unk225c> -40002758: 0a3d mov.n a3, a10 -4000275a: ff8986 j 40002584 <_X_ets_unk225c+0x328> -4000275d: 030c movi.n a3, 0 -4000275f: ff45c6 j 4000247a <_X_ets_unk225c+0x21e> -40002762: 020c movi.n a2, 0 -40002764: f01d retw.n -40002766: d70000 excw -40002769: 023a add.n a0, a2, a3 -4000276b: ff9346 j 400025bc <_X_ets_unk225c+0x360> -4000276e: fff486 j 40002744 <_X_ets_unk225c+0x4e8> -40002771: 000000 ill - -40002774 <ets_install_putc1>: -40002774: 004136 entry a1, 32 -40002777: fe7631 l32r a3, 40002150 <_st_0x3fffda9c> -4000277a: 3329 s32i.n a2, a3, 12 -4000277c: f01d retw.n - ... - -40002780 <_c_0x4000223c_ets_uart_putc>: -40002780: 223c movi.n a2, 50 -40002782: 364000 excw - -40002784 <_X_ets_install_uart_printf>: -40002784: 004136 entry a1, 32 -40002787: fffea1 l32r a10, 40002780 <_c_0x4000223c_ets_uart_putc> -4000278a: fffea5 call8 40002774 <ets_install_putc1> -4000278d: f01d retw.n - ... - -40002790 <_c_0x400027dc>: -40002790: 27dc bnez.n a7, 400027a6 <_X_ets_install_external_printf+0x12> -40002792: 364000 excw - -40002794 <_X_ets_install_external_printf>: -40002794: 004136 entry a1, 32 -40002797: fe6e51 l32r a5, 40002150 <_st_0x3fffda9c> -4000279a: 5529 s32i.n a2, a5, 20 -4000279c: 838c beqz.n a3, 400027a8 <_X_ets_install_external_printf+0x14> -4000279e: 20a330 or a10, a3, a3 -400027a1: 000125 call8 400027b4 <_X_ets_install_putc2> -400027a4: 6549 s32i.n a4, a5, 24 -400027a6: f01d retw.n -400027a8: fffaa1 l32r a10, 40002790 <_c_0x400027dc> -400027ab: 0000a5 call8 400027b4 <_X_ets_install_putc2> -400027ae: 6549 s32i.n a4, a5, 24 -400027b0: f01d retw.n - ... - -400027b4 <_X_ets_install_putc2>: -400027b4: 004136 entry a1, 32 -400027b7: fe6631 l32r a3, 40002150 <_st_0x3fffda9c> -400027ba: 4329 s32i.n a2, a3, 16 -400027bc: f01d retw.n - ... - -400027c0 <_X_ets_get_printf_buf_remain_len>: -400027c0: 004136 entry a1, 32 -400027c3: fe6321 l32r a2, 40002150 <_st_0x3fffda9c> -400027c6: 0e1222 l16ui a2, a2, 28 -400027c9: f01d retw.n - ... - -400027cc <_X_ets_reset_printf_buf_len>: -400027cc: 004136 entry a1, 32 -400027cf: fe6031 l32r a3, 40002150 <_st_0x3fffda9c> -400027d2: 020c movi.n a2, 0 -400027d4: 0e5322 s16i a2, a3, 28 -400027d7: f01d retw.n -400027d9: 000000 ill - -400027dc <_X_ets_putc>: -400027dc: 004136 entry a1, 32 -400027df: fe5c61 l32r a6, 40002150 <_st_0x3fffda9c> -400027e2: 0e1642 l16ui a4, a6, 28 -400027e5: 8638 l32i.n a3, a6, 32 -400027e7: d48c beqz.n a4, 400027f8 <_X_ets_putc+0x1c> -400027e9: 004322 s8i a2, a3, 0 -400027ec: 540b addi.n a5, a4, -1 -400027ee: 331b addi.n a3, a3, 1 -400027f0: 0e5652 s16i a5, a6, 28 -400027f3: 8639 s32i.n a3, a6, 32 -400027f5: f01d retw.n -400027f7: f01d00 subx8 a1, a13, a0 -400027fa: bc0000 excw -400027fd: ffda add.n a15, a15, a13 -400027ff: 3f .byte 0x3f -40002800: 002220 excw -40002803: a13640 excw - -40002804 <ets_printf>: -40002804: 00a136 entry a1, 80 -40002807: 4129 s32i.n a2, a1, 16 -40002809: 5139 s32i.n a3, a1, 20 -4000280b: 6149 s32i.n a4, a1, 24 -4000280d: 7159 s32i.n a5, a1, 28 -4000280f: 079d mov.n a9, a7 -40002811: fe4f71 l32r a7, 40002150 <_st_0x3fffda9c> -40002814: 8169 s32i.n a6, a1, 32 -40002816: 3788 l32i.n a8, a7, 12 -40002818: 9199 s32i.n a9, a1, 36 -4000281a: 38cc bnez.n a8, 40002821 <ets_printf+0x1d> -4000281c: 0427b2 l32i a11, a7, 16 -4000281f: 5bbc beqz.n a11, 40002858 <ets_printf+0x54> -40002821: 57d8 l32i.n a13, a7, 20 -40002823: 00dd16 beqz a13, 40002834 <ets_printf+0x30> -40002826: fff5a1 l32r a10, 400027fc <_X_ets_putc+0x20> -40002829: fccab2 addi a11, a10, -4 -4000282c: 04cac2 addi a12, a10, 4 -4000282f: 000de0 callx8 a13 -40002832: 4128 l32i.n a2, a1, 16 -40002834: fff3a1 l32r a10, 40002800 <_X_ets_putc+0x24> -40002837: 10c1d2 addi a13, a1, 16 -4000283a: 30c1c2 addi a12, a1, 48 -4000283d: 4e0c movi.n a14, 4 -4000283f: 02bd mov.n a11, a2 -40002841: 21e9 s32i.n a14, a1, 8 -40002843: 01c9 s32i.n a12, a1, 0 -40002845: 11d9 s32i.n a13, a1, 4 -40002847: ffade5 call8 40002324 <_X_ets_unk225c+0xc8> -4000284a: 67b8 l32i.n a11, a7, 24 -4000284c: 0a2d mov.n a2, a10 -4000284e: 3b8c beqz.n a11, 40002855 <ets_printf+0x51> -40002850: 97a8 l32i.n a10, a7, 36 -40002852: 000be0 callx8 a11 -40002855: f01d retw.n -40002857: 020c00 andb b0, b12, b0 -4000285a: f01d retw.n -4000285c: 00a136 entry a1, 80 -4000285f: 02bd mov.n a11, a2 -40002861: 4129 s32i.n a2, a1, 16 -40002863: 5139 s32i.n a3, a1, 20 -40002865: 6149 s32i.n a4, a1, 24 -40002867: 7159 s32i.n a5, a1, 28 -40002869: 8169 s32i.n a6, a1, 32 -4000286b: 9179 s32i.n a7, a1, 36 -4000286d: ffc4a1 l32r a10, 40002780 <_c_0x4000223c_ets_uart_putc> -40002870: 30c1c2 addi a12, a1, 48 -40002873: 4e0c movi.n a14, 4 -40002875: 10c1d2 addi a13, a1, 16 -40002878: 11d9 s32i.n a13, a1, 4 -4000287a: 21e9 s32i.n a14, a1, 8 -4000287c: 01c9 s32i.n a12, a1, 0 -4000287e: ffaa65 call8 40002324 <_X_ets_unk225c+0xc8> -40002881: 0a2d mov.n a2, a10 -40002883: f01d retw.n -40002885: 000000 ill -40002888: 00a136 entry a1, 80 -4000288b: 5139 s32i.n a3, a1, 20 -4000288d: 6149 s32i.n a4, a1, 24 -4000288f: 7159 s32i.n a5, a1, 28 -40002891: 8169 s32i.n a6, a1, 32 -40002893: 02bd mov.n a11, a2 -40002895: fe2e21 l32r a2, 40002150 <_st_0x3fffda9c> -40002898: 9179 s32i.n a7, a1, 36 -4000289a: 52d8 l32i.n a13, a2, 20 -4000289c: 0461b2 s32i a11, a1, 16 -4000289f: 00ed16 beqz a13, 400028b1 <ets_printf+0xad> -400028a2: 20c2a2 addi a10, a2, 32 -400028a5: 1cc2b2 addi a11, a2, 28 -400028a8: 24c2c2 addi a12, a2, 36 -400028ab: 000de0 callx8 a13 -400028ae: 0421b2 l32i a11, a1, 16 -400028b1: ffb7a1 l32r a10, 40002790 <_c_0x400027dc> -400028b4: 10c1d2 addi a13, a1, 16 -400028b7: 30c1c2 addi a12, a1, 48 -400028ba: 4e0c movi.n a14, 4 -400028bc: 21e9 s32i.n a14, a1, 8 -400028be: 01c9 s32i.n a12, a1, 0 -400028c0: 11d9 s32i.n a13, a1, 4 -400028c2: ffa625 call8 40002324 <_X_ets_unk225c+0xc8> -400028c5: 62b8 l32i.n a11, a2, 24 -400028c7: 0a3d mov.n a3, a10 -400028c9: 3b8c beqz.n a11, 400028d0 <ets_printf+0xcc> -400028cb: 92a8 l32i.n a10, a2, 36 -400028cd: 000be0 callx8 a11 -400028d0: 032d mov.n a2, a3 -400028d2: f01d retw.n - -400028d4 <_c_0xdfffffff>: -400028d4: ff .byte 0xff -400028d5: ff .byte 0xff -400028d6: ff .byte 0xff -400028d7: df .byte 0xdf - -400028d8 <_X_get_rst_cause>: -400028d8: 004136 entry a1, 32 -400028db: fa1741 l32r a4, 40001138 <_c_0x60007e00> -400028de: 0020c0 memw -400028e1: 8d2422 l32i a2, a4, 0x234 -400028e4: fffcc1 l32r a12, 400028d4 <_c_0xdfffffff> -400028e7: 542020 extui a2, a2, 0, 6 -400028ea: 325266 bnei a2, 5, 40002920 <_X_get_rst_cause+0x48> -400028ed: 0020c0 memw -400028f0: 8d2432 l32i a3, a4, 0x234 -400028f3: 943c30 extui a3, a3, 12, 10 -400028f6: 371326 beqi a3, 1, 40002931 <_X_get_rst_cause+0x59> -400028f9: 0020c0 memw -400028fc: fff681 l32r a8, 400028d4 <_c_0xdfffffff> -400028ff: 8d24a2 l32i a10, a4, 0x234 -40002902: 090c movi.n a9, 0 -40002904: 94aca0 extui a10, a10, 12, 10 -40002907: f8caa2 addi a10, a10, -8 -4000290a: 9329a0 movnez a2, a9, a10 -4000290d: 0020c0 memw -40002910: 862452 l32i a5, a4, 0x218 -40002913: 105580 and a5, a5, a8 -40002916: 0020c0 memw -40002919: 866452 s32i a5, a4, 0x218 -4000291c: f01d retw.n -4000291e: c00000 sub a0, a0, a0 -40002921: b20020 mulsh a0, a0, a2 -40002924: c08624 excw -40002927: 10bb addi.n a1, a0, 11 -40002929: 0020c0 memw -4000292c: 8664b2 s32i a11, a4, 0x218 -4000292f: f01d retw.n -40002931: ffe8e1 l32r a14, 400028d4 <_c_0xdfffffff> -40002934: 421c movi.n a2, 20 -40002936: 0020c0 memw -40002939: 8624d2 l32i a13, a4, 0x218 -4000293c: 10dde0 and a13, a13, a14 -4000293f: 0020c0 memw -40002942: 8664d2 s32i a13, a4, 0x218 -40002945: f01d retw.n - ... - -40002948 <_XX_unk2948>: -40002948: 004136 entry a1, 32 -4000294b: 070c movi.n a7, 0 -4000294d: f9fa51 l32r a5, 40001138 <_c_0x60007e00> -40002950: 0020c0 memw -40002953: a82562 l32i a6, a5, 0x2a0 -40002956: 0269 s32i.n a6, a2, 0 -40002958: 0020c0 memw -4000295b: a92542 l32i a4, a5, 0x2a4 -4000295e: 400300 ssr a3 -40002961: 914040 srl a4, a4 -40002964: 086407 bbci a4, 0, 40002970 <_l_2970> -40002967: 0020c0 memw -4000296a: a86572 s32i a7, a5, 0x2a0 -4000296d: f01d retw.n - ... - -40002970 <_l_2970>: -40002970: 0279 s32i.n a7, a2, 0 -40002972: 0020c0 memw -40002975: a86572 s32i a7, a5, 0x2a0 -40002978: f01d retw.n - ... - -4000297c <_X_sw_sys_rst>: -4000297c: 004136 entry a1, 32 -4000297f: f76e41 l32r a4, 40000738 <_c_0x80000000> -40002982: f9ed31 l32r a3, 40001138 <_c_0x60007e00> -40002985: 0020c0 memw -40002988: 802322 l32i a2, a3, 0x200 -4000298b: 202240 or a2, a2, a4 -4000298e: 0020c0 memw -40002991: 806322 s32i a2, a3, 0x200 -40002994: f01d retw.n - ... - -40002998 <software_reset_cpu>: -40002998: 004136 entry a1, 32 -4000299b: 80a042 movi a4, 128 -4000299e: f9e631 l32r a3, 40001138 <_c_0x60007e00> -400029a1: 0020c0 memw -400029a4: 802322 l32i a2, a3, 0x200 -400029a7: 202240 or a2, a2, a4 -400029aa: 0020c0 memw -400029ad: 806322 s32i a2, a3, 0x200 -400029b0: f01d retw.n - ... - -400029b4 <_c_0x00400000>: -400029b4: 400000 ssr a0 - ... - -400029b8 <_c_0xffbfffff>: -400029b8: ff .byte 0xff -400029b9: ff .byte 0xff -400029ba: bf .byte 0xbf -400029bb: ff .byte 0xff - -400029bc <_XX_apb_bridge_toggle>: -400029bc: 004136 entry a1, 32 -400029bf: f9de41 l32r a4, 40001138 <_c_0x60007e00> -400029c2: 229c beqz.n a2, 400029d8 <_XX_apb_bridge_toggle+0x1c> -400029c4: fffc31 l32r a3, 400029b4 <_c_0x00400000> -400029c7: 0020c0 memw -400029ca: 862422 l32i a2, a4, 0x218 -400029cd: 202230 or a2, a2, a3 -400029d0: 0020c0 memw -400029d3: 866422 s32i a2, a4, 0x218 -400029d6: f01d retw.n -400029d8: fff891 l32r a9, 400029b8 <_c_0xffbfffff> -400029db: 0020c0 memw -400029de: 862482 l32i a8, a4, 0x218 -400029e1: 108890 and a8, a8, a9 -400029e4: 0020c0 memw -400029e7: 866482 s32i a8, a4, 0x218 -400029ea: f01d retw.n - -400029ec <_X_ets_strcpy>: -400029ec: 004136 entry a1, 32 -400029ef: 20b330 or a11, a3, a3 -400029f2: 20a220 or a10, a2, a2 -400029f5: 032e65 call8 40005cdc <strcpy> -400029f8: 202aa0 or a2, a10, a10 -400029fb: f01d retw.n -400029fd: 000000 ill - -40002a00 <_X_ets_strncpy>: -40002a00: 004136 entry a1, 32 -40002a03: 04cd mov.n a12, a4 -40002a05: 03bd mov.n a11, a3 -40002a07: 02ad mov.n a10, a2 -40002a09: 034865 call8 40005e90 <strncpy> -40002a0c: 0a2d mov.n a2, a10 -40002a0e: f01d retw.n - -40002a10 <_X_ets_strcmp>: -40002a10: 004136 entry a1, 32 -40002a13: 20b330 or a11, a3, a3 -40002a16: 20a220 or a10, a2, a2 -40002a19: 0319e5 call8 40005bb8 <strcmp> -40002a1c: 202aa0 or a2, a10, a10 -40002a1f: f01d retw.n -40002a21: 000000 ill - -40002a24 <_X_ets_strncmp>: -40002a24: 004136 entry a1, 32 -40002a27: 04cd mov.n a12, a4 -40002a29: 03bd mov.n a11, a3 -40002a2b: 02ad mov.n a10, a2 -40002a2d: 033a25 call8 40005dd0 <strncmp> -40002a30: 0a2d mov.n a2, a10 -40002a32: f01d retw.n - -40002a34 <_X_ets_strlen>: -40002a34: 004136 entry a1, 32 -40002a37: 02ad mov.n a10, a2 -40002a39: 033325 call8 40005d6c <strlen> -40002a3c: 0a2d mov.n a2, a10 -40002a3e: f01d retw.n - -40002a40 <_X_ets_strstr>: -40002a40: 004136 entry a1, 32 -40002a43: 20b330 or a11, a3, a3 -40002a46: 20a220 or a10, a2, a2 -40002a49: 035225 call8 40005f6c <strstr> -40002a4c: 202aa0 or a2, a10, a10 -40002a4f: f01d retw.n -40002a51: 000000 ill - -40002a54 <bzero>: -40002a54: 004136 entry a1, 32 -40002a57: 20b330 or a11, a3, a3 -40002a5a: 20a220 or a10, a2, a2 -40002a5d: 03e4e5 call8 400068ac <multofup+0xc> -40002a60: 000090 retw - ... - -40002a64 <ets_str2macaddr>: -40002a64: 004136 entry a1, 32 -40002a67: 0003a2 l8ui a10, a3, 0 -40002a6a: 9b0c movi.n a11, 9 -40002a6c: 02ca26 beqi a10, 32, 40002a72 <ets_str2macaddr+0xe> -40002a6f: 139ab7 bne a10, a11, 40002a86 <ets_str2macaddr+0x22> -40002a72: 0a8076 loop a0, 40002a80 <ets_str2macaddr+0x1c> -40002a75: 0103a2 l8ui a10, a3, 1 -40002a78: 331b addi.n a3, a3, 1 -40002a7a: f7ca26 beqi a10, 32, 40002a75 <ets_str2macaddr+0x11> -40002a7d: 059ab7 bne a10, a11, 40002a86 <ets_str2macaddr+0x22> -40002a80: fffb86 j 40002a72 <ets_str2macaddr+0xe> -40002a83: 000000 ill -40002a86: 040c movi.n a4, 0 -40002a88: 0003a2 l8ui a10, a3, 0 -40002a8b: 0002e5 call8 40002ab8 <ets_str2macaddr+0x54> -40002a8e: 0a5d mov.n a5, a10 -40002a90: 01ea96 bltz a10, 40002ab2 <ets_str2macaddr+0x4e> -40002a93: 0103a2 l8ui a10, a3, 1 -40002a96: 000225 call8 40002ab8 <ets_str2macaddr+0x54> -40002a99: 015a96 bltz a10, 40002ab2 <ets_str2macaddr+0x4e> -40002a9c: 333b addi.n a3, a3, 3 -40002a9e: 924a add.n a9, a2, a4 -40002aa0: 1185c0 slli a8, a5, 4 -40002aa3: 441b addi.n a4, a4, 1 -40002aa5: 8a8a add.n a8, a10, a8 -40002aa7: 004982 s8i a8, a9, 0 -40002aaa: 744040 extui a4, a4, 0, 8 -40002aad: d76466 bnei a4, 6, 40002a88 <ets_str2macaddr+0x24> -40002ab0: f01d retw.n -40002ab2: 020c movi.n a2, 0 -40002ab4: f01d retw.n -40002ab6: 360000 excw -40002ab9: 3c0041 l32r a4, 3ffd1abc <_start-0x2e544> -40002abc: f62c95 call4 3fff8d88 <_start-0x7278> -40002abf: 02b627 bgeu a6, a2, 40002ac5 <ets_str2macaddr+0x61> -40002ac2: 3ab527 bgeu a5, a2, 40002b00 <ets_str2macaddr+0x9c> -40002ac5: 60a032 movi a3, 96 -40002ac8: 05b327 bgeu a3, a2, 40002ad1 <ets_str2macaddr+0x6d> -40002acb: 66a042 movi a4, 102 -40002ace: 0ab427 bgeu a4, a2, 40002adc <ets_str2macaddr+0x78> -40002ad1: 084c movi.n a8, 64 -40002ad3: 1db827 bgeu a8, a2, 40002af4 <ets_str2macaddr+0x90> -40002ad6: 46a092 movi a9, 70 -40002ad9: 173927 bltu a9, a2, 40002af4 <ets_str2macaddr+0x90> -40002adc: 02b627 bgeu a6, a2, 40002ae2 <ets_str2macaddr+0x7e> -40002adf: 1db527 bgeu a5, a2, 40002b00 <ets_str2macaddr+0x9c> -40002ae2: 0a4c movi.n a10, 64 -40002ae4: 10ba27 bgeu a10, a2, 40002af8 <ets_str2macaddr+0x94> -40002ae7: ab5c movi.n a11, 90 -40002ae9: 0b3b27 bltu a11, a2, 40002af8 <ets_str2macaddr+0x94> -40002aec: c9c222 addi a2, a2, -55 -40002aef: 232200 sext a2, a2, 7 -40002af2: f01d retw.n -40002af4: f27c movi.n a2, -1 -40002af6: f01d retw.n -40002af8: a9c222 addi a2, a2, -87 -40002afb: 232200 sext a2, a2, 7 -40002afe: f01d retw.n -40002b00: d0c222 addi a2, a2, -48 -40002b03: 232200 sext a2, a2, 7 -40002b06: f01d retw.n -40002b08: 004136 entry a1, 32 -40002b0b: 00bbe5 call8 400036c8 <_X_uart_wait_tx_empty+0x2c> -40002b0e: 0042a2 s8i a10, a2, 0 -40002b11: f01d retw.n - ... - -40002b14 <ets_putc>: -40002b14: 004136 entry a1, 32 -40002b17: 02ad mov.n a10, a2 -40002b19: 00b125 call8 4000362c <uart_tx_one_char> -40002b1c: f01d retw.n -40002b1e: 000000 ill -40002b21: 6e .byte 0x6e -40002b22: 366000 excw -40002b25: 310041 l32r a4, 3ffcef28 <_start-0x310d8> -40002b28: fe .byte 0xfe -40002b29: ff .byte 0xff -40002b2a: 0020c0 memw -40002b2d: 8c6322 s32i a2, a3, 0x230 -40002b30: f01d retw.n -40002b32: 360000 excw -40002b35: c20041 l32r a4, 3fff3338 <_start-0xccc8> -40002b38: b180a2 excw -40002b3b: fff9 s32i.n a15, a15, 60 -40002b3d: 0020c0 memw -40002b40: 892bb2 l32i a11, a11, 0x224 -40002b43: c0a2b0 sub a10, a2, a11 -40002b46: 0e2ca7 blt a12, a10, 40002b58 <ets_putc+0x44> -40002b49: 131aa6 blti a10, 1, 40002b60 <ets_putc+0x4c> -40002b4c: 03d2a2 addmi a10, a2, 0x300 -40002b4f: 84caa2 addi a10, a10, -124 -40002b52: fffd25 call8 40002b24 <ets_putc+0x10> -40002b55: f01d retw.n -40002b57: 02ad00 andb b10, b13, b0 -40002b5a: fffca5 call8 40002b24 <ets_putc+0x10> -40002b5d: f01d retw.n -40002b5f: abca00 depbits a0, a10, 26, 13 -40002b62: fffc25 call8 40002b24 <ets_putc+0x10> -40002b65: f01d retw.n -40002b67: 413600 srli a3, a0, 6 -40002b6a: 323900 orbc b3, b9, b0 -40002b6d: 4249 s32i.n a4, a2, 16 -40002b6f: 080c movi.n a8, 0 -40002b71: f57c movi.n a5, -1 -40002b73: 0259 s32i.n a5, a2, 0 -40002b75: 1289 s32i.n a8, a2, 4 -40002b77: 2289 s32i.n a8, a2, 8 -40002b79: f01d retw.n -40002b7b: dad000 depbits a0, a0, 13, 14 -40002b7e: ff .byte 0xff -40002b7f: 3f .byte 0x3f -40002b80: ca88 l32i.n a8, a10, 48 -40002b82: ff .byte 0xff -40002b83: 3f .byte 0x3f -40002b84: ccd8 l32i.n a13, a12, 48 -40002b86: ff .byte 0xff -40002b87: 3f .byte 0x3f -40002b88: 004136 entry a1, 32 -40002b8b: fffcb1 l32r a11, 40002b7c <ets_putc+0x68> -40002b8e: 0b98 l32i.n a9, a11, 0 -40002b90: 69bc beqz.n a9, 40002bca <ets_putc+0xb6> -40002b92: 00a0a2 movi a10, 0 -40002b95: 0d8076 loop a0, 40002ba6 <ets_putc+0x92> -40002b98: 1988 l32i.n a8, a9, 4 -40002b9a: c08280 sub a8, a2, a8 -40002b9d: 0818a6 blti a8, 1, 40002ba9 <ets_putc+0x95> -40002ba0: 09ad mov.n a10, a9 -40002ba2: 0998 l32i.n a9, a9, 0 -40002ba4: 198c beqz.n a9, 40002ba9 <ets_putc+0x95> -40002ba6: fffac6 j 40002b95 <ets_putc+0x81> -40002ba9: 0399 s32i.n a9, a3, 0 -40002bab: 1329 s32i.n a2, a3, 4 -40002bad: da9c beqz.n a10, 40002bce <ets_putc+0xba> -40002baf: 0a39 s32i.n a3, a10, 0 -40002bb1: 0398 l32i.n a9, a3, 0 -40002bb3: 119937 bne a9, a3, 40002bc8 <ets_putc+0xb4> -40002bb6: fff2a1 l32r a10, 40002b80 <ets_putc+0x6c> -40002bb9: fff2b1 l32r a11, 40002b84 <ets_putc+0x70> -40002bbc: b1a0c2 movi a12, 177 -40002bbf: 201110 or a1, a1, a1 -40002bc2: ffc425 call8 40002804 <ets_printf> -40002bc5: ffff06 j 40002bc5 <ets_putc+0xb1> -40002bc8: f01d retw.n -40002bca: 0399 s32i.n a9, a3, 0 -40002bcc: 1329 s32i.n a2, a3, 4 -40002bce: 02ad mov.n a10, a2 -40002bd0: 0b39 s32i.n a3, a11, 0 -40002bd2: fff625 call8 40002b34 <ets_putc+0x20> -40002bd5: fff606 j 40002bb1 <ets_putc+0x9d> -40002bd8: 1388 l32i.n a8, a3, 4 -40002bda: 360000 excw -40002bdd: 880041 l32r a4, 3ffe4be0 <_start-0x1b420> -40002be0: fd9102 l16si a0, a1, 0x1fa -40002be3: ff .byte 0xff -40002be4: 110826 beqi a8, -1, 40002bf9 <ets_putc+0xe5> -40002be7: ffe6a1 l32r a10, 40002b80 <ets_putc+0x6c> -40002bea: ffe6b1 l32r a11, 40002b84 <ets_putc+0x70> -40002bed: bda0c2 movi a12, 189 -40002bf0: ffc125 call8 40002804 <ets_printf> -40002bf3: ffff06 j 40002bf3 <ets_putc+0xdf> -40002bf6: 000000 ill -40002bf9: 823390 mull a3, a3, a9 -40002bfc: 148c beqz.n a4, 40002c01 <ets_putc+0xed> -40002bfe: 026232 s32i a3, a2, 8 -40002c01: fe4a65 call8 400010a8 <_X_ets_enter_critical> -40002c04: 20b220 or a11, a2, a2 -40002c07: ffc6a1 l32r a10, 40002b20 <ets_putc+0xc> -40002c0a: 0020c0 memw -40002c0d: 892aa2 l32i a10, a10, 0x224 -40002c10: f03d nop.n -40002c12: 80a3a0 add a10, a3, a10 -40002c15: fff725 call8 40002b88 <ets_putc+0x74> -40002c18: fe4a25 call8 400010bc <_X_ets_exit_critical> -40002c1b: f01d retw.n -40002c1d: 000000 ill -40002c20: 004136 entry a1, 32 -40002c23: 0288 l32i.n a8, a2, 0 -40002c25: a03330 addx4 a3, a3, a3 -40002c28: 110826 beqi a8, -1, 40002c3d <ets_putc+0x129> -40002c2b: ffd5a1 l32r a10, 40002b80 <ets_putc+0x6c> -40002c2e: ffd5b1 l32r a11, 40002b84 <ets_putc+0x70> -40002c31: d3a0c2 movi a12, 211 -40002c34: ffbce5 call8 40002804 <ets_printf> -40002c37: ffff06 j 40002c37 <ets_putc+0x123> -40002c3a: 000000 ill -40002c3d: 048c beqz.n a4, 40002c41 <ets_putc+0x12d> -40002c3f: 2239 s32i.n a3, a2, 8 -40002c41: fe4665 call8 400010a8 <_X_ets_enter_critical> -40002c44: 20b220 or a11, a2, a2 -40002c47: ffb6a1 l32r a10, 40002b20 <ets_putc+0xc> -40002c4a: 0020c0 memw -40002c4d: 892aa2 l32i a10, a10, 0x224 -40002c50: 80a3a0 add a10, a3, a10 -40002c53: fff365 call8 40002b88 <ets_putc+0x74> -40002c56: fe4665 call8 400010bc <_X_ets_exit_critical> -40002c59: 000090 retw -40002c5c: 004136 entry a1, 32 -40002c5f: fe44a5 call8 400010a8 <_X_ets_enter_critical> -40002c62: ffc6c1 l32r a12, 40002b7c <ets_putc+0x68> -40002c65: 0020f0 nop -40002c68: 002ca2 l32i a10, a12, 0 -40002c6b: 019a16 beqz a10, 40002c88 <ets_putc+0x174> -40002c6e: 00a0b2 movi a11, 0 -40002c71: 088076 loop a0, 40002c7d <ets_putc+0x169> -40002c74: 0812a7 beq a2, a10, 40002c80 <ets_putc+0x16c> -40002c77: 0abd mov.n a11, a10 -40002c79: 0aa8 l32i.n a10, a10, 0 -40002c7b: 9a8c beqz.n a10, 40002c88 <ets_putc+0x174> -40002c7d: fffc06 j 40002c71 <ets_putc+0x15d> -40002c80: 4a8c beqz.n a10, 40002c88 <ets_putc+0x174> -40002c82: 2b9c beqz.n a11, 40002c98 <ets_putc+0x184> -40002c84: 0a88 l32i.n a8, a10, 0 -40002c86: 0b89 s32i.n a8, a11, 0 -40002c88: fe4325 call8 400010bc <_X_ets_exit_critical> -40002c8b: 00a092 movi a9, 0 -40002c8e: ffafa2 movi a10, -1 -40002c91: 0062a2 s32i a10, a2, 0 -40002c94: 2299 s32i.n a9, a2, 8 -40002c96: f01d retw.n -40002c98: 0ab8 l32i.n a11, a10, 0 -40002c9a: 0cb9 s32i.n a11, a12, 0 -40002c9c: fffa06 j 40002c88 <ets_putc+0x174> -40002c9f: 413600 srli a3, a0, 6 -40002ca2: 028800 andb b8, b8, b0 -40002ca5: 0f0826 beqi a8, -1, 40002cb8 <ets_putc+0x1a4> -40002ca8: ffb6a1 l32r a10, 40002b80 <ets_putc+0x6c> -40002cab: ffb6b1 l32r a11, 40002b84 <ets_putc+0x70> -40002cae: 02a1c2 movi a12, 0x102 -40002cb1: ffb525 call8 40002804 <ets_printf> -40002cb4: ffff06 j 40002cb4 <ets_putc+0x1a0> -40002cb7: 02ad00 andb b10, b13, b0 -40002cba: 0b0c movi.n a11, 0 -40002cbc: 0c0c movi.n a12, 0 -40002cbe: ffeaa5 call8 40002b68 <ets_putc+0x54> -40002cc1: f01d retw.n -40002cc3: 413600 srli a3, a0, 6 -40002cc6: 3e2500 excw -40002cc9: fe .byte 0xfe -40002cca: ff9521 l32r a2, 40002b20 <ets_putc+0xc> -40002ccd: ffab31 l32r a3, 40002b7c <ets_putc+0x68> -40002cd0: 0020c0 memw -40002cd3: 03b8 l32i.n a11, a3, 0 -40002cd5: 892292 l32i a9, a2, 0x224 -40002cd8: 0b9c beqz.n a11, 40002cec <ets_putc+0x1d8> -40002cda: 1b88 l32i.n a8, a11, 4 -40002cdc: ffaf42 movi a4, -1 -40002cdf: c08890 sub a8, a8, a9 -40002ce2: 0e18a6 blti a8, 1, 40002cf4 <ets_putc+0x1e0> -40002ce5: 3b8c beqz.n a11, 40002cec <ets_putc+0x1d8> -40002ce7: 1ba8 l32i.n a10, a11, 4 -40002ce9: ffe4a5 call8 40002b34 <ets_putc+0x20> -40002cec: fe3ce5 call8 400010bc <_X_ets_exit_critical> -40002cef: f01d retw.n -40002cf1: 000000 ill -40002cf4: 000506 j 40002d0c <ets_putc+0x1f8> -40002cf7: c00000 sub a0, a0, a0 -40002cfa: b80020 excw -40002cfd: 229203 excw -40002d00: 1689 s32i.n a8, a6, 4 -40002d02: fe7b addi.n a15, a14, 7 -40002d04: 1ba8 l32i.n a10, a11, 4 -40002d06: c0aa90 sub a10, a10, a9 -40002d09: d81ae6 bgei a10, 1, 40002ce5 <ets_putc+0x1d1> -40002d0c: 0b5d mov.n a5, a11 -40002d0e: 13b9 s32i.n a11, a3, 4 -40002d10: 3bd8 l32i.n a13, a11, 12 -40002d12: 23d9 s32i.n a13, a3, 8 -40002d14: 0bc8 l32i.n a12, a11, 0 -40002d16: 03c9 s32i.n a12, a3, 0 -40002d18: 0b49 s32i.n a4, a11, 0 -40002d1a: fe3a25 call8 400010bc <_X_ets_exit_critical> -40002d1d: 3588 l32i.n a8, a5, 12 -40002d1f: 45a8 l32i.n a10, a5, 16 -40002d21: 0008e0 callx8 a8 -40002d24: fe3825 call8 400010a8 <_X_ets_enter_critical> -40002d27: 0598 l32i.n a9, a5, 0 -40002d29: 25a8 l32i.n a10, a5, 8 -40002d2b: ca0966 bnei a9, -1, 40002cf9 <ets_putc+0x1e5> -40002d2e: fc7a16 beqz a10, 40002cf9 <ets_putc+0x1e5> -40002d31: 15b8 l32i.n a11, a5, 4 -40002d33: abaa add.n a10, a11, a10 -40002d35: 05bd mov.n a11, a5 -40002d37: 15a9 s32i.n a10, a5, 4 -40002d39: ffe4e5 call8 40002b88 <ets_putc+0x74> -40002d3c: ffee46 j 40002cf9 <ets_putc+0x1e5> -40002d3f: 413600 srli a3, a0, 6 -40002d42: fa1c00 depbits a0, a12, 15, 2 -40002d45: 0b0c movi.n a11, 0 -40002d47: 0c0c movi.n a12, 0 -40002d49: fe24e5 call8 40000f98 <_XX_unk0f96> -40002d4c: f01d retw.n -40002d4e: 360000 excw -40002d51: 880041 l32r a4, 3ffe4d54 <_start-0x1b2ac> -40002d54: 088c02 excw -40002d57: f01d retw.n -40002d59: 0a0c movi.n a10, 0 -40002d5b: fff6a5 call8 40002cc4 <ets_putc+0x1b0> -40002d5e: f01d retw.n -40002d60: 002d40 excw -40002d63: 2d5040 excw -40002d66: e04000 subx4 a4, a0, a0 -40002d69: ffda add.n a15, a15, a13 -40002d6b: 3f .byte 0x3f -40002d6c: 004136 entry a1, 32 -40002d6f: 0aa0a2 movi a10, 10 -40002d72: fffbb1 l32r a11, 40002d60 <ets_putc+0x24c> -40002d75: ff8181 l32r a8, 40002b7c <ets_putc+0x68> -40002d78: 020c movi.n a2, 0 -40002d7a: 02cd mov.n a12, a2 -40002d7c: 006822 s32i a2, a8, 0 -40002d7f: fe36a5 call8 400010e8 <_X_ets_isr_attach> -40002d82: 00a4a2 movi a10, 0x400 -40002d85: fe37e5 call8 40001104 <_X_ets_isr_unmask> -40002d88: fff7a1 l32r a10, 40002d64 <ets_putc+0x250> -40002d8b: fb1c movi.n a11, 31 -40002d8d: fff6c1 l32r a12, 40002d68 <ets_putc+0x254> -40002d90: 4d0c movi.n a13, 4 -40002d92: fe1c25 call8 40000f54 <_X_ets_task> -40002d95: ff6291 l32r a9, 40002b20 <ets_putc+0xc> -40002d98: 0020c0 memw -40002d9b: 8c6922 s32i a2, a9, 0x230 -40002d9e: 88a0a2 movi a10, 136 -40002da1: 0020c0 memw -40002da4: 8a69a2 s32i a10, a9, 0x228 -40002da7: 0020c0 memw -40002daa: 886922 s32i a2, a9, 0x220 -40002dad: f01d retw.n -40002daf: c84400 excw -40002db2: ff .byte 0xff -40002db3: 3f .byte 0x3f - -40002db4 <ets_delay_us>: -40002db4: 004136 entry a1, 32 -40002db7: 0392e5 call8 400066e4 <_xtos_set_intlevel+0x74> -40002dba: fffd81 l32r a8, 40002db0 <ets_putc+0x29c> -40002dbd: 002882 l32i a8, a8, 0 -40002dc0: 0a3d mov.n a3, a10 -40002dc2: 822820 mull a2, a8, a2 -40002dc5: 0391e5 call8 400066e4 <_xtos_set_intlevel+0x74> -40002dc8: c09a30 sub a9, a10, a3 -40002dcb: 08b927 bgeu a9, a2, 40002dd7 <ets_delay_us+0x23> -40002dce: 039165 call8 400066e4 <_xtos_set_intlevel+0x74> -40002dd1: c0aa30 sub a10, a10, a3 -40002dd4: f63a27 bltu a10, a2, 40002dce <ets_delay_us+0x1a> -40002dd7: f01d retw.n -40002dd9: 000000 ill - -40002ddc <ets_update_cpu_frequency>: -40002ddc: 004136 entry a1, 32 -40002ddf: fff431 l32r a3, 40002db0 <ets_putc+0x29c> -40002de2: 0329 s32i.n a2, a3, 0 -40002de4: f01d retw.n - ... - -40002de8 <ets_get_cpu_frequency>: -40002de8: 004136 entry a1, 32 -40002deb: fff121 l32r a2, 40002db0 <ets_putc+0x29c> -40002dee: 0228 l32i.n a2, a2, 0 -40002df0: f01d retw.n -40002df2: 360000 excw -40002df5: a60041 l32r a4, 3ffec5f8 <_start-0x13a08> -40002df8: 424913 excw -40002dfb: 30efa0 xor a14, a15, a10 -40002dfe: 6d1450 excw -40002e01: 326003 excw -40002e04: a57621 l32r a2, 3ffec3dc <_start-0x13c24> -40002e07: 520a add.n a5, a2, a0 -40002e09: 1b0002 l8ui a0, a0, 27 -40002e0c: 454022 s8i a2, a0, 69 -40002e0f: 404030 excw -40002e12: f03d74 excw -40002e15: 25a376 loopgtz a3, 40002e3e <ets_get_cpu_frequency+0x56> -40002e18: 000232 l8ui a3, a2, 0 -40002e1b: 010252 l8ui a5, a2, 1 -40002e1e: 020262 l8ui a6, a2, 2 -40002e21: 030272 l8ui a7, a2, 3 -40002e24: 303340 xor a3, a3, a4 -40002e27: 224b addi.n a2, a2, 4 -40002e29: 743030 extui a3, a3, 0, 8 -40002e2c: 303530 xor a3, a5, a3 -40002e2f: 743030 extui a3, a3, 0, 8 -40002e32: 303630 xor a3, a6, a3 -40002e35: 743030 extui a3, a3, 0, 8 -40002e38: 303730 xor a3, a7, a3 -40002e3b: 744030 extui a4, a3, 0, 8 -40002e3e: 042d mov.n a2, a4 -40002e40: f01d retw.n -40002e42: 220000 orb b0, b0, b0 -40002e45: 1defa0 excw -40002e48: 0000f0 callx12 a0 - ... - -40002e4c <_st_0x3fffdb10_uartdev>: -40002e4c: ffdb10 excw -40002e4f: 3f .byte 0x3f - -40002e50 <_c_0x3fffdb00>: -40002e50: ffdb00 excw -40002e53: 3f .byte 0x3f -40002e54: 004000 break 0, 0 - ... - -40002e58 <_XX_unk2e58>: -40002e58: 006136 entry a1, 48 -40002e5b: 02ad mov.n a10, a2 -40002e5d: 005765 call8 400033d4 <_c_0x0000ffff+0x4> -40002e60: fffb41 l32r a4, 40002e4c <_st_0x3fffdb10_uartdev> -40002e63: c498 l32i.n a9, a4, 48 -40002e65: 230c movi.n a3, 2 -40002e67: 39ac beqz.n a9, 40002e8e <_XX_unk2e58+0x36> -40002e69: 211926 beqi a9, 1, 40002e8e <_XX_unk2e58+0x36> -40002e6c: f9b1a1 l32r a10, 40001530 <_s_waiting_for_host+0x4> -40002e6f: f9b1b1 l32r a11, 40001534 <_s_waiting_for_host+0x8> -40002e72: 01a0c2 movi a12, 1 -40002e75: 00b125 call8 40003988 <_X_RcvMsg> -40002e78: 00ea56 bnez a10, 40002e8a <_XX_unk2e58+0x32> -40002e7b: f9ada1 l32r a10, 40001530 <_s_waiting_for_host+0x4> -40002e7e: 000a82 l8ui a8, a10, 0 -40002e81: 010a92 l8ui a9, a10, 1 -40002e84: 002856 bnez a8, 40002e8a <_XX_unk2e58+0x32> -40002e87: 1e8926 beqi a9, 8, 40002ea9 <_XX_unk2e58+0x51> -40002e8a: 020c movi.n a2, 0 -40002e8c: f01d retw.n -40002e8e: 20a220 or a10, a2, a2 -40002e91: 01a0b2 movi a11, 1 -40002e94: 005b65 call8 4000344c <_c_0x000fffff+0x4> -40002e97: f4b0a0 extui a11, a10, 0, 16 -40002e9a: fecb16 beqz a11, 40002e8a <_XX_unk2e58+0x32> -40002e9d: 02ad mov.n a10, a2 -40002e9f: 0064a5 call8 400034e8 <uart_div_modify> -40002ea2: c439 s32i.n a3, a4, 48 -40002ea4: fff106 j 40002e6c <_XX_unk2e58+0x14> -40002ea7: 0c0000 excw -40002eaa: 411c movi.n a1, 20 -40002eac: ffe9 s32i.n a14, a15, 60 -40002eae: 8b0c movi.n a11, 8 -40002eb0: 015432 s16i a3, a4, 2 -40002eb3: 0144b2 s8i a11, a4, 1 -40002eb6: 0044c2 s8i a12, a4, 0 -40002eb9: 01bd mov.n a11, a1 -40002ebb: c44b addi.n a12, a4, 4 -40002ebd: 004065 call8 400032c4 <_X_UartConnectProc> -40002ec0: f98d61 l32r a6, 400014f4 <_c_0x60008e00> -40002ec3: f98b51 l32r a5, 400014f0 <_c_0xffff8fff> -40002ec6: 00a0d2 movi a13, 0 -40002ec9: 0844d2 s8i a13, a4, 8 -40002ecc: 0944d2 s8i a13, a4, 9 -40002ecf: 053216 beqz a2, 40002f26 <_XX_unk2e58+0xce> -40002ed2: f897f1 l32r a15, 40001130 <_c_0x60003e00> -40002ed5: ffdfa1 l32r a10, 40002e54 <_c_0x3fffdb00+0x4> -40002ed8: 0020c0 memw -40002edb: 9626d2 l32i a13, a6, 0x258 -40002ede: 10dd50 and a13, a13, a5 -40002ee1: 0020c0 memw -40002ee4: 9666d2 s32i a13, a6, 0x258 -40002ee7: 0020c0 memw -40002eea: 9626c2 l32i a12, a6, 0x258 -40002eed: 20cca0 or a12, a12, a10 -40002ef0: 0020c0 memw -40002ef3: 9666c2 s32i a12, a6, 0x258 -40002ef6: 0020c0 memw -40002ef9: 9526b2 l32i a11, a6, 0x254 -40002efc: 10bb50 and a11, a11, a5 -40002eff: 0020c0 memw -40002f02: 9566b2 s32i a11, a6, 0x254 -40002f05: 0020c0 memw -40002f08: 952692 l32i a9, a6, 0x254 -40002f0b: 2099a0 or a9, a9, a10 -40002f0e: 0020c0 memw -40002f11: 956692 s32i a9, a6, 0x254 -40002f14: f88681 l32r a8, 4000112c <_c_0xfffdffff> -40002f17: 0020c0 memw -40002f1a: f02fe2 l32i a14, a15, 0x3c0 -40002f1d: 10ee80 and a14, a14, a8 -40002f20: 0020c0 memw -40002f23: f06fe2 s32i a14, a15, 0x3c0 -40002f26: 830c movi.n a3, 8 -40002f28: 20a440 or a10, a4, a4 -40002f2b: 0aa0b2 movi a11, 10 -40002f2e: 008fa5 call8 40003828 <_X_SendMsg> -40002f31: 0b1a26 beqi a10, 1, 40002f40 <_XX_unk2e58+0xe8> -40002f34: ffc332 addi a3, a3, -1 -40002f37: fed356 bnez a3, 40002f28 <_XX_unk2e58+0xd0> -40002f3a: 220c movi.n a2, 2 -40002f3c: f01d retw.n -40002f3e: 160000 excw -40002f41: c0f462 s32ri a6, a4, 0x300 -40002f44: f20020 rems a0, a0, a2 -40002f47: 509626 beqi a6, 10, 40002f9b <_X_UartDwnLdProc+0x2f> -40002f4a: ff .byte 0xff -40002f4b: 20c010 or a12, a0, a1 -40002f4e: 66f200 excw -40002f51: 20c096 bltz a0, 40003161 <_XX_unk313c+0x25> -40002f54: 26e200 excw -40002f57: 20c096 bltz a0, 40003167 <_XX_unk313c+0x2b> -40002f5a: 66e200 excw -40002f5d: 020c96 bltz a12, 40002f81 <_X_UartDwnLdProc+0x15> -40002f60: f01d retw.n - ... - -40002f64 <_c_0x3fffdb04>: -40002f64: ffdb04 excw -40002f67: 3f .byte 0x3f -40002f68: ffc9f0 excw -40002f6b: 3f .byte 0x3f - -40002f6c <_X_UartDwnLdProc>: -40002f6c: 00a136 entry a1, 80 -40002f6f: 0a2c movi.n a10, 32 -40002f71: 280c movi.n a8, 2 -40002f73: ffb751 l32r a5, 40002e50 <_c_0x3fffdb00> -40002f76: 046d mov.n a6, a4 -40002f78: 070c movi.n a7, 0 -40002f7a: 6179 s32i.n a7, a1, 24 -40002f7c: 140c movi.n a4, 1 -40002f7e: 004542 s8i a4, a5, 0 -40002f81: 015582 s16i a8, a5, 2 -40002f84: fe17e5 call8 40001104 <_X_ets_isr_unmask> -40002f87: 6198 l32i.n a9, a1, 24 -40002f89: 5c2926 beqi a9, 2, 40002fe9 <_X_UartDwnLdProc+0x7d> -40002f8c: f43030 extui a3, a3, 0, 16 -40002f8f: 870c movi.n a7, 8 -40002f91: 8169 s32i.n a6, a1, 32 -40002f93: fff491 l32r a9, 40002f64 <_c_0x3fffdb04> -40002f96: 9199 s32i.n a9, a1, 36 -40002f98: 20b330 or a11, a3, a3 -40002f9b: 20a220 or a10, a2, a2 -40002f9e: 00a0c2 movi a12, 0 -40002fa1: 009e65 call8 40003988 <_X_RcvMsg> -40002fa4: aa0b addi.n a10, a10, -1 -40002fa6: 134a16 beqz a10, 400030de <_X_UartDwnLdProc+0x172> -40002fa9: 0002b2 l8ui a11, a2, 0 -40002fac: 1a0c movi.n a10, 1 -40002fae: 04fb16 beqz a11, 40003001 <_X_UartDwnLdProc+0x95> -40002fb1: 590c movi.n a9, 5 -40002fb3: 7199 s32i.n a9, a1, 28 -40002fb5: 094592 s8i a9, a5, 9 -40002fb8: 04cd mov.n a12, a4 -40002fba: 0105d2 l8ui a13, a5, 1 -40002fbd: 01a0e2 movi a14, 1 -40002fc0: 93aea0 movnez a10, a14, a10 -40002fc3: 0845a2 s8i a10, a5, 8 -40002fc6: f8cdd2 addi a13, a13, -8 -40002fc9: 83c7d0 moveqz a12, a7, a13 -40002fcc: 206cc0 or a6, a12, a12 -40002fcf: 011c16 beqz a12, 40002fe4 <_X_UartDwnLdProc+0x78> -40002fd2: 20a550 or a10, a5, a5 -40002fd5: 0aa0b2 movi a11, 10 -40002fd8: 0084e5 call8 40003828 <_X_SendMsg> -40002fdb: 161a26 beqi a10, 1, 40002ff5 <_X_UartDwnLdProc+0x89> -40002fde: ffc662 addi a6, a6, -1 -40002fe1: fed656 bnez a6, 40002fd2 <_X_UartDwnLdProc+0x66> -40002fe4: 61f8 l32i.n a15, a1, 24 -40002fe6: ae2f66 bnei a15, 2, 40002f98 <_X_UartDwnLdProc+0x2c> -40002fe9: 20a0a2 movi a10, 32 -40002fec: fe10a5 call8 400010f8 <_X_ets_isr_mask> -40002fef: 00a022 movi a2, 0 -40002ff2: 000090 retw -40002ff5: 20a0a2 movi a10, 32 -40002ff8: fe0fe5 call8 400010f8 <_X_ets_isr_mask> -40002ffb: 01a022 movi a2, 1 -40002ffe: 000090 retw -40003001: 010292 l8ui a9, a2, 1 -40003004: ffd981 l32r a8, 40002f68 <_c_0x3fffdb04+0x4> -40003007: 07a9f6 bgeui a9, 12, 40003012 <_X_UartDwnLdProc+0xa6> -4000300a: a08980 addx4 a8, a9, a8 -4000300d: 0888 l32i.n a8, a8, 0 -4000300f: 0008a0 jx a8 -40003012: 1a0c movi.n a10, 1 -40003014: 590c movi.n a9, 5 -40003016: 7199 s32i.n a9, a1, 28 -40003018: 7198 l32i.n a9, a1, 28 -4000301a: ffe5c6 j 40002fb5 <_X_UartDwnLdProc+0x49> -4000301d: 02ad00 andb b10, b13, b0 -40003020: 1cc1b2 addi a11, a1, 28 -40003023: 01cd mov.n a12, a1 -40003025: 001ea5 call8 40003210 <_XX_unk3210> -40003028: 5b0c movi.n a11, 5 -4000302a: 0145b2 s8i a11, a5, 1 -4000302d: fff9c6 j 40003018 <_X_UartDwnLdProc+0xac> -40003030: 02ad mov.n a10, a2 -40003032: 1cc1b2 addi a11, a1, 28 -40003035: 001ae5 call8 400031e4 <_XX_unk31e4> -40003038: bc0c movi.n a12, 11 -4000303a: 0145c2 s8i a12, a5, 1 -4000303d: fff5c6 j 40003018 <_X_UartDwnLdProc+0xac> -40003040: 02ad mov.n a10, a2 -40003042: 1cc1b2 addi a11, a1, 28 -40003045: 91c8 l32i.n a12, a1, 36 -40003047: 002d25 call8 40003318 <_X_UartRegReadProc> -4000304a: ad0c movi.n a13, 10 -4000304c: 0145d2 s8i a13, a5, 1 -4000304f: fff146 j 40003018 <_X_UartDwnLdProc+0xac> -40003052: 02ad mov.n a10, a2 -40003054: 1cc1b2 addi a11, a1, 28 -40003057: 0027e5 call8 400032d4 <_X_UartRegWriteProc> -4000305a: 9e0c movi.n a14, 9 -4000305c: 0145e2 s8i a14, a5, 1 -4000305f: ffed46 j 40003018 <_X_UartDwnLdProc+0xac> -40003062: 02ad mov.n a10, a2 -40003064: 1cc1b2 addi a11, a1, 28 -40003067: 91c8 l32i.n a12, a1, 36 -40003069: 0025a5 call8 400032c4 <_X_UartConnectProc> -4000306c: 014572 s8i a7, a5, 1 -4000306f: ffe946 j 40003018 <_X_UartDwnLdProc+0xac> -40003072: 02ad mov.n a10, a2 -40003074: 1cc1b2 addi a11, a1, 28 -40003077: 01cd mov.n a12, a1 -40003079: 001c65 call8 40003240 <_XX_unk3240> -4000307c: 7f0c movi.n a15, 7 -4000307e: 0145f2 s8i a15, a5, 1 -40003081: ffe4c6 j 40003018 <_X_UartDwnLdProc+0xac> -40003084: 02ad mov.n a10, a2 -40003086: 1cc1b2 addi a11, a1, 28 -40003089: 01cd mov.n a12, a1 -4000308b: 81d8 l32i.n a13, a1, 32 -4000308d: 0020e5 call8 4000329c <_X_MemDwnLdStopReqMsgProc> -40003090: 680c movi.n a8, 6 -40003092: 014582 s8i a8, a5, 1 -40003095: ffdfc6 j 40003018 <_X_UartDwnLdProc+0xac> -40003098: 02ad mov.n a10, a2 -4000309a: 1cc1b2 addi a11, a1, 28 -4000309d: 01cd mov.n a12, a1 -4000309f: 0011e5 call8 400031bc <_XX_unk31bc> -400030a2: 490c movi.n a9, 4 -400030a4: 81c8 l32i.n a12, a1, 32 -400030a6: 0b0c movi.n a11, 0 -400030a8: 0cb9 s32i.n a11, a12, 0 -400030aa: 014592 s8i a9, a5, 1 -400030ad: ffd9c6 j 40003018 <_X_UartDwnLdProc+0xac> -400030b0: 02ad mov.n a10, a2 -400030b2: 1cc1b2 addi a11, a1, 28 -400030b5: 01cd mov.n a12, a1 -400030b7: 000865 call8 4000313c <_XX_unk313c> -400030ba: 3d0c movi.n a13, 3 -400030bc: 0145d2 s8i a13, a5, 1 -400030bf: ffd546 j 40003018 <_X_UartDwnLdProc+0xac> -400030c2: 00a0a2 movi a10, 0 -400030c5: 00a0b2 movi a11, 0 -400030c8: 012a65 call8 40004370 <_X_spi_flash_attach> -400030cb: 20a220 or a10, a2, a2 -400030ce: 1cc1b2 addi a11, a1, 28 -400030d1: 01cd mov.n a12, a1 -400030d3: 0001e5 call8 400030f0 <_X_FlashDwnLdStartMsgProc> -400030d6: 2e0c movi.n a14, 2 -400030d8: 0145e2 s8i a14, a5, 1 -400030db: ffce46 j 40003018 <_X_UartDwnLdProc+0xac> -400030de: 20a0a2 movi a10, 32 -400030e1: fe0165 call8 400010f8 <_X_ets_isr_mask> -400030e4: 01a022 movi a2, 1 -400030e7: 000090 retw - ... - -400030ec <_c_0x00001800>: -400030ec: 001800 movsp a0, a8 - ... - -400030f0 <_X_FlashDwnLdStartMsgProc>: -400030f0: 004136 entry a1, 32 -400030f3: 011282 l16ui a8, a2, 2 -400030f6: 05a0a2 movi a10, 5 -400030f9: 05b826 beqi a8, 16, 40003102 <_X_FlashDwnLdStartMsgProc+0x12> -400030fc: 120c movi.n a2, 1 -400030fe: 03a9 s32i.n a10, a3, 0 -40003100: f01d retw.n -40003102: 0422b2 l32i a11, a2, 16 -40003105: fff991 l32r a9, 400030ec <_c_0x00001800> -40003108: f039b7 bltu a9, a11, 400030fc <_X_FlashDwnLdStartMsgProc+0xc> -4000310b: 0264b2 s32i a11, a4, 8 -4000310e: 0a0c movi.n a10, 0 -40003110: 32c8 l32i.n a12, a2, 12 -40003112: 22d8 l32i.n a13, a2, 8 -40003114: 04d9 s32i.n a13, a4, 0 -40003116: 14c9 s32i.n a12, a4, 4 -40003118: 34a9 s32i.n a10, a4, 12 -4000311a: 44a9 s32i.n a10, a4, 16 -4000311c: 52b8 l32i.n a11, a2, 20 -4000311e: 54b9 s32i.n a11, a4, 20 -40003120: 0132a5 call8 4000444c <Cache_Read_Disable> -40003123: 54a8 l32i.n a10, a4, 20 -40003125: 04b8 l32i.n a11, a4, 0 -40003127: 0178e5 call8 400048b4 <_X_SPIEraseArea> -4000312a: 6a8c beqz.n a10, 40003134 <_X_FlashDwnLdStartMsgProc+0x44> -4000312c: 120c movi.n a2, 1 -4000312e: 6e0c movi.n a14, 6 -40003130: 03e9 s32i.n a14, a3, 0 -40003132: f01d retw.n -40003134: 020c movi.n a2, 0 -40003136: f01d retw.n -40003138: 001810 movsp a1, a8 - ... - -4000313c <_XX_unk313c>: -4000313c: 004136 entry a1, 32 -4000313f: 011292 l16ui a9, a2, 2 -40003142: fffd81 l32r a8, 40003138 <_X_FlashDwnLdStartMsgProc+0x48> -40003145: 5a0c movi.n a10, 5 -40003147: 07b897 bgeu a8, a9, 40003152 <_XX_unk313c+0x16> -4000314a: 120c movi.n a2, 1 -4000314c: 03a9 s32i.n a10, a3, 0 -4000314e: f01d retw.n -40003150: c80000 excw -40003153: 32b834 excw -40003156: 24d8 l32i.n a13, a4, 8 -40003158: ee9bc7 bne a11, a12, 4000314a <_XX_unk313c+0xe> -4000315b: 22b8 l32i.n a11, a2, 8 -4000315d: 3e0c movi.n a14, 3 -4000315f: e73db7 bltu a13, a11, 4000314a <_XX_unk313c+0xe> -40003162: e48eb7 bany a14, a11, 4000314a <_XX_unk313c+0xe> -40003165: 040252 l8ui a5, a2, 4 -40003168: 18c262 addi a6, a2, 24 -4000316b: fc1b addi.n a15, a12, 1 -4000316d: 34f9 s32i.n a15, a4, 12 -4000316f: 06ad mov.n a10, a6 -40003171: ffc825 call8 40002df4 <ets_get_cpu_frequency+0xc> -40003174: 0915a7 beq a5, a10, 40003181 <_XX_unk313c+0x45> -40003177: 720c movi.n a2, 7 -40003179: 0329 s32i.n a2, a3, 0 -4000317b: 120c movi.n a2, 1 -4000317d: f01d retw.n -4000317f: a20000 muluh a0, a0, a0 -40003182: 600524 excw -40003185: c820b6 bltui a0, 2, 40003151 <_XX_unk313c+0x15> -40003188: 5ae522 s32c1i a2, a5, 0x168 -4000318b: 54a801 l32r a0, 3ffd842c <_start-0x27bd4> -4000318e: 06bd mov.n a11, a6 -40003190: 22c8 l32i.n a12, a2, 8 -40003192: 017065 call8 40004898 <SPIRead> -40003195: 06ad mov.n a10, a6 -40003197: 22b8 l32i.n a11, a2, 8 -40003199: ffc5a5 call8 40002df4 <ets_get_cpu_frequency+0xc> -4000319c: 0815a7 beq a5, a10, 400031a8 <_XX_unk313c+0x6c> -4000319f: 120c movi.n a2, 1 -400031a1: 880c movi.n a8, 8 -400031a3: 0389 s32i.n a8, a3, 0 -400031a5: f01d retw.n -400031a7: 44b800 extui a11, a0, 8, 5 -400031aa: 5498 l32i.n a9, a4, 20 -400031ac: 22a8 l32i.n a10, a2, 8 -400031ae: 020c movi.n a2, 0 -400031b0: 99aa add.n a9, a9, a10 -400031b2: bbaa add.n a11, a11, a10 -400031b4: 44b9 s32i.n a11, a4, 16 -400031b6: 5499 s32i.n a9, a4, 20 -400031b8: f01d retw.n - ... - -400031bc <_XX_unk31bc>: -400031bc: 004136 entry a1, 32 -400031bf: 3498 l32i.n a9, a4, 12 -400031c1: 2a0c movi.n a10, 2 -400031c3: 1488 l32i.n a8, a4, 4 -400031c5: 64a9 s32i.n a10, a4, 24 -400031c7: 6a0c movi.n a10, 6 -400031c9: 079897 bne a8, a9, 400031d4 <_XX_unk31bc+0x18> -400031cc: 44c8 l32i.n a12, a4, 16 -400031ce: 0024b2 l32i a11, a4, 0 -400031d1: 071bc7 beq a11, a12, 400031dc <_XX_unk31bc+0x20> -400031d4: 120c movi.n a2, 1 -400031d6: 03a9 s32i.n a10, a3, 0 -400031d8: f01d retw.n -400031da: 650000 extui a0, a0, 16, 7 -400031dd: 0c0131 l32r a3, 3ffc61e4 <_start-0x39e1c> -400031e0: f01d02 l16ui a0, a13, 0x1e0 - ... - -400031e4 <_XX_unk31e4>: -400031e4: 004136 entry a1, 32 -400031e7: 011282 l16ui a8, a2, 2 -400031ea: 891c movi.n a9, 24 -400031ec: 081897 beq a8, a9, 400031f8 <_XX_unk31e4+0x14> -400031ef: 120c movi.n a2, 1 -400031f1: 5a0c movi.n a10, 5 -400031f3: 03a9 s32i.n a10, a3, 0 -400031f5: f01d retw.n -400031f7: 22a200 orb b10, b2, b0 -400031fa: 22b202 l32ai a0, a2, 136 -400031fd: 22c203 excw -40003200: 52d804 excw -40003203: 62e8 l32i.n a14, a2, 24 -40003205: 72f8 l32i.n a15, a2, 28 -40003207: 0173a5 call8 40004940 <_XX_unk4940> -4000320a: 020c movi.n a2, 0 -4000320c: f01d retw.n - ... - -40003210 <_XX_unk3210>: -40003210: 004136 entry a1, 32 -40003213: 011252 l16ui a5, a2, 2 -40003216: 05a072 movi a7, 5 -40003219: 05b526 beqi a5, 16, 40003222 <_XX_unk3210+0x12> -4000321c: 120c movi.n a2, 1 -4000321e: 0379 s32i.n a7, a3, 0 -40003220: f01d retw.n -40003222: 4288 l32i.n a8, a2, 16 -40003224: ffb261 l32r a6, 400030ec <_c_0x00001800> -40003227: 5298 l32i.n a9, a2, 20 -40003229: ef3687 bltu a6, a8, 4000321c <_XX_unk3210+0xc> -4000322c: 2489 s32i.n a8, a4, 8 -4000322e: 5499 s32i.n a9, a4, 20 -40003230: 32a8 l32i.n a10, a2, 12 -40003232: 22b8 l32i.n a11, a2, 8 -40003234: 04b9 s32i.n a11, a4, 0 -40003236: 14a9 s32i.n a10, a4, 4 -40003238: 020c movi.n a2, 0 -4000323a: 3429 s32i.n a2, a4, 12 -4000323c: 4429 s32i.n a2, a4, 16 -4000323e: f01d retw.n - -40003240 <_XX_unk3240>: -40003240: 004136 entry a1, 32 -40003243: 011292 l16ui a9, a2, 2 -40003246: ffbc81 l32r a8, 40003138 <_X_FlashDwnLdStartMsgProc+0x48> -40003249: 5a0c movi.n a10, 5 -4000324b: 05b897 bgeu a8, a9, 40003254 <_XX_unk3240+0x14> -4000324e: 120c movi.n a2, 1 -40003250: 03a9 s32i.n a10, a3, 0 -40003252: f01d retw.n -40003254: 34c8 l32i.n a12, a4, 12 -40003256: 32b8 l32i.n a11, a2, 12 -40003258: 24d8 l32i.n a13, a4, 8 -4000325a: f09bc7 bne a11, a12, 4000324e <_XX_unk3240+0xe> -4000325d: 22b8 l32i.n a11, a2, 8 -4000325f: eb3db7 bltu a13, a11, 4000324e <_XX_unk3240+0xe> -40003262: 040252 l8ui a5, a2, 4 -40003265: 18c262 addi a6, a2, 24 -40003268: ec1b addi.n a14, a12, 1 -4000326a: 34e9 s32i.n a14, a4, 12 -4000326c: 06ad mov.n a10, a6 -4000326e: ffb865 call8 40002df4 <ets_get_cpu_frequency+0xc> -40003271: 0715a7 beq a5, a10, 4000327c <_XX_unk3240+0x3c> -40003274: 120c movi.n a2, 1 -40003276: 7f0c movi.n a15, 7 -40003278: 03f9 s32i.n a15, a3, 0 -4000327a: f01d retw.n -4000327c: 20b660 or a11, a6, a6 -4000327f: 0524a2 l32i a10, a4, 20 -40003282: 0222c2 l32i a12, a2, 8 -40003285: feb3e5 call8 40001dc4 <_X_ets_memcpy> -40003288: 4498 l32i.n a9, a4, 16 -4000328a: 2288 l32i.n a8, a2, 8 -4000328c: 5428 l32i.n a2, a4, 20 -4000328e: 998a add.n a9, a9, a8 -40003290: 228a add.n a2, a2, a8 -40003292: 5429 s32i.n a2, a4, 20 -40003294: 4499 s32i.n a9, a4, 16 -40003296: 020c movi.n a2, 0 -40003298: f01d retw.n - ... - -4000329c <_X_MemDwnLdStopReqMsgProc>: -4000329c: 004136 entry a1, 32 -4000329f: 011272 l16ui a7, a2, 2 -400032a2: 860c movi.n a6, 8 -400032a4: 08b677 bgeu a6, a7, 400032b0 <_X_MemDwnLdStopReqMsgProc+0x14> -400032a7: 120c movi.n a2, 1 -400032a9: 580c movi.n a8, 5 -400032ab: 0389 s32i.n a8, a3, 0 -400032ad: f01d retw.n -400032af: 2b0c00 depbits a0, a12, 18, 1 -400032b2: 0a0c movi.n a10, 0 -400032b4: 3298 l32i.n a9, a2, 12 -400032b6: 0802c2 l8ui a12, a2, 8 -400032b9: 020c movi.n a2, 0 -400032bb: 83abc0 moveqz a10, a11, a12 -400032be: 64a9 s32i.n a10, a4, 24 -400032c0: 0599 s32i.n a9, a5, 0 -400032c2: f01d retw.n - -400032c4 <_X_UartConnectProc>: -400032c4: 004136 entry a1, 32 -400032c7: 2228 l32i.n a2, a2, 8 -400032c9: 0429 s32i.n a2, a4, 0 -400032cb: 020c movi.n a2, 0 -400032cd: 0329 s32i.n a2, a3, 0 -400032cf: f01d retw.n -400032d1: 000000 ill - -400032d4 <_X_UartRegWriteProc>: -400032d4: 004136 entry a1, 32 -400032d7: 011242 l16ui a4, a2, 2 -400032da: 228b addi.n a2, a2, 8 -400032dc: 414440 srli a4, a4, 4 -400032df: e4ac beqz.n a4, 40003311 <_X_UartRegWriteProc+0x3d> -400032e1: ffaf52 movi a5, -1 -400032e4: 0612a2 l16ui a10, a2, 12 -400032e7: fface5 call8 40002db4 <ets_delay_us> -400032ea: 002292 l32i a9, a2, 0 -400032ed: 0020c0 memw -400032f0: 012282 l32i a8, a2, 4 -400032f3: 0222b2 l32i a11, a2, 8 -400032f6: 09a8 l32i.n a10, a9, 0 -400032f8: 30cb50 xor a12, a11, a5 -400032fb: 10aac0 and a10, a10, a12 -400032fe: 1088b0 and a8, a8, a11 -40003301: 2088a0 or a8, a8, a10 -40003304: 0020c0 memw -40003307: 0989 s32i.n a8, a9, 0 -40003309: 10c222 addi a2, a2, 16 -4000330c: 440b addi.n a4, a4, -1 -4000330e: d214e6 bgei a4, 1, 400032e4 <_X_UartRegWriteProc+0x10> -40003311: 020c movi.n a2, 0 -40003313: 0329 s32i.n a2, a3, 0 -40003315: f01d retw.n - ... - -40003318 <_X_UartRegReadProc>: -40003318: 004136 entry a1, 32 -4000331b: 2228 l32i.n a2, a2, 8 -4000331d: 0020c0 memw -40003320: 0228 l32i.n a2, a2, 0 -40003322: 0429 s32i.n a2, a4, 0 -40003324: 020c movi.n a2, 0 -40003326: 0329 s32i.n a2, a3, 0 -40003328: f01d retw.n - ... - -4000332c <_c_115200>: -4000332c: 01c200 slli a12, a2, 32 - ... - -40003330 <_c_0x3feffe00>: -40003330: effe00 excw -40003333: 3f .byte 0x3f - -40003334 <_c_0xffff83ff>: -40003334: ff .byte 0xff -40003335: ffff83 excw - -40003338 <_c_0x00001400>: -40003338: 001400 movsp a0, a4 - ... - -4000333c <_c_0x40003728_uart_int_handler>: -4000333c: 3728 l32i.n a2, a7, 12 -4000333e: 2c4000 excw - -40003340 <_c_0x3fffdb2c_uart_int_handler_arg>: -40003340: db2c movi.n a11, 45 -40003342: ff .byte 0xff -40003343: 3f .byte 0x3f - -40003344 <_X_uart_attach>: -40003344: 004136 entry a1, 32 -40003347: 03a0a2 movi a10, 3 -4000334a: 01a082 movi a8, 1 -4000334d: fff7b1 l32r a11, 4000332c <_c_115200> -40003350: febf91 l32r a9, 40002e4c <_st_0x3fffdb10_uartdev> -40003353: 0d0c movi.n a13, 0 -40003355: 59d9 s32i.n a13, a9, 20 -40003357: 29d9 s32i.n a13, a9, 8 -40003359: 39d9 s32i.n a13, a9, 12 -4000335b: 49d9 s32i.n a13, a9, 16 -4000335d: b9d9 s32i.n a13, a9, 44 -4000335f: c9d9 s32i.n a13, a9, 48 -40003361: d9d9 s32i.n a13, a9, 52 -40003363: 1849d2 s8i a13, a9, 24 -40003366: 1949d2 s8i a13, a9, 25 -40003369: 09b9 s32i.n a11, a9, 0 -4000336b: 284982 s8i a8, a9, 40 -4000336e: 19a9 s32i.n a10, a9, 4 -40003370: 40c9c2 addi a12, a9, 64 -40003373: 79c9 s32i.n a12, a9, 28 -40003375: 89c9 s32i.n a12, a9, 32 -40003377: 99c9 s32i.n a12, a9, 36 -40003379: 20a0a2 movi a10, 32 -4000337c: fdd7a5 call8 400010f8 <_X_ets_isr_mask> -4000337f: 1facc2 movi a12, 0xfffffc1f -40003382: a0a0b2 movi a11, 160 -40003385: ffeaf1 l32r a15, 40003330 <_c_0x3feffe00> -40003388: 0020c0 memw -4000338b: 9e2fa2 l32i a10, a15, 0x278 -4000338e: 10aac0 and a10, a10, a12 -40003391: 20aab0 or a10, a10, a11 -40003394: 0020c0 memw -40003397: 9e6fa2 s32i a10, a15, 0x278 -4000339a: ffe691 l32r a9, 40003334 <_c_0xffff83ff> -4000339d: ffe681 l32r a8, 40003338 <_c_0x00001400> -400033a0: 0020c0 memw -400033a3: 9e2fe2 l32i a14, a15, 0x278 -400033a6: 10ee90 and a14, a14, a9 -400033a9: 20ee80 or a14, a14, a8 -400033ac: 0020c0 memw -400033af: 9e6fe2 s32i a14, a15, 0x278 -400033b2: 5a0c movi.n a10, 5 -400033b4: ffe2b1 l32r a11, 4000333c <_c_0x40003728_uart_int_handler> -400033b7: ffe2c1 l32r a12, 40003340 <_c_0x3fffdb2c_uart_int_handler_arg> -400033ba: fdd2e5 call8 400010e8 <_X_ets_isr_attach> -400033bd: f01d retw.n - ... - -400033c0 <_XX_uart_set_unk33c0>: -400033c0: 004136 entry a1, 32 -400033c3: fea231 l32r a3, 40002e4c <_st_0x3fffdb10_uartdev> -400033c6: 194322 s8i a2, a3, 25 -400033c9: f01d retw.n - ... - -400033cc <_c_0x5ffffe00>: -400033cc: fffe00 excw -400033cf: 5f .byte 0x5f - -400033d0 <_c_0x0000ffff>: -400033d0: ff .byte 0xff -400033d1: ff .byte 0xff -400033d2: 360000 excw -400033d5: 510061 l32r a6, 3ffd77d8 <_start-0x28828> -400033d8: fe .byte 0xfe -400033d9: ff .byte 0xff -400033da: 190c movi.n a9, 1 -400033dc: 080c movi.n a8, 0 -400033de: fffb41 l32r a4, 400033cc <_c_0x5ffffe00> -400033e1: 838920 moveqz a8, a9, a2 -400033e4: 118800 slli a8, a8, 16 -400033e7: 884a add.n a8, a8, a4 -400033e9: 0020c0 memw -400033ec: 846852 s32i a5, a8, 0x210 -400033ef: e97c movi.n a9, -2 -400033f1: 0020c0 memw -400033f4: 832832 l32i a3, a8, 0x20c -400033f7: 103390 and a3, a3, a9 -400033fa: 0020c0 memw -400033fd: 836832 s32i a3, a8, 0x20c -40003400: ffd031 l32r a3, 40003340 <_c_0x3fffdb2c_uart_int_handler_arg> -40003403: 01bd mov.n a11, a1 -40003405: 03ad mov.n a10, a3 -40003407: 0059a5 call8 400039a0 <_X_uart_rx_readbuff> -4000340a: 7aac beqz.n a10, 40003435 <_c_0x0000ffff+0x65> -4000340c: fe90a1 l32r a10, 40002e4c <_st_0x3fffdb10_uartdev> -4000340f: 0d0c movi.n a13, 0 -40003411: bad9 s32i.n a13, a10, 44 -40003413: 11c200 slli a12, a2, 16 -40003416: cc4a add.n a12, a12, a4 -40003418: 0020c0 memw -4000341b: 846c52 s32i a5, a12, 0x210 -4000341e: 1d0c movi.n a13, 1 -40003420: 0020c0 memw -40003423: 832cb2 l32i a11, a12, 0x20c -40003426: 20bbd0 or a11, a11, a13 -40003429: 0020c0 memw -4000342c: 836cb2 s32i a11, a12, 0x20c -4000342f: 184a22 s8i a2, a10, 24 -40003432: f01d retw.n -40003434: 03ad00 excw -40003437: 01bd mov.n a11, a1 -40003439: 005665 call8 400039a0 <_X_uart_rx_readbuff> -4000343c: ff5a16 beqz a10, 40003435 <_c_0x0000ffff+0x65> -4000343f: fff246 j 4000340c <_c_0x0000ffff+0x3c> -40003442: 010000 slli a0, a0, 32 -40003445: 0008 l32i.n a0, a0, 0 - ... - -40003448 <_c_0x000fffff>: -40003448: ff .byte 0xff -40003449: ff .byte 0xff -4000344a: 0f .byte 0xf -4000344b: 413600 srli a3, a0, 6 -4000344e: 7fc100 excw -40003451: fe .byte 0xfe -40003452: e47c movi.n a4, -2 -40003454: ccb8 l32i.n a11, a12, 48 -40003456: 01a0d2 movi a13, 1 -40003459: 83bdb0 moveqz a11, a13, a11 -4000345c: 0c6cb2 s32i a11, a12, 48 -4000345f: ffdba1 l32r a10, 400033cc <_c_0x5ffffe00> -40003462: 119200 slli a9, a2, 16 -40003465: 29aa add.n a2, a9, a10 -40003467: 0020c0 memw -4000346a: 862282 l32i a8, a2, 0x218 -4000346d: 17e807 bbsi a8, 0, 40003488 <_c_0x000fffff+0x40> -40003470: 0020c0 memw -40003473: 8622f2 l32i a15, a2, 0x218 -40003476: 10ff40 and a15, a15, a4 -40003479: 0020c0 memw -4000347c: 8662f2 s32i a15, a2, 0x218 -4000347f: fff1e1 l32r a14, 40003444 <_c_0x0000ffff+0x74> -40003482: 0020c0 memw -40003485: 8662e2 s32i a14, a2, 0x218 -40003488: 0020c0 memw -4000348b: 8c2282 l32i a8, a2, 0x230 -4000348e: 13e8f6 bgeui a8, 128, 400034a5 <_c_0x000fffff+0x5d> -40003491: 045356 bnez a3, 400034da <_c_0x000fffff+0x92> -40003494: e8a3a2 movi a10, 0x3e8 -40003497: ff91e5 call8 40002db4 <ets_delay_us> -4000349a: 0020c0 memw -4000349d: 8c2292 l32i a9, a2, 0x230 -400034a0: f03d nop.n -400034a2: ebe9b6 bltui a9, 128, 40003491 <_c_0x000fffff+0x49> -400034a5: ffe8a1 l32r a10, 40003448 <_c_0x000fffff> -400034a8: 0020c0 memw -400034ab: 8a2282 l32i a8, a2, 0x228 -400034ae: 1088a0 and a8, a8, a10 -400034b1: 0020c0 memw -400034b4: 8b2292 l32i a9, a2, 0x22c -400034b7: 1099a0 and a9, a9, a10 -400034ba: 0020c0 memw -400034bd: 8622a2 l32i a10, a2, 0x218 -400034c0: 10aa40 and a10, a10, a4 -400034c3: 0020c0 memw -400034c6: 8662a2 s32i a10, a2, 0x218 -400034c9: 289a add.n a2, a8, a9 -400034cb: 080c movi.n a8, 0 -400034cd: 212120 srai a2, a2, 1 -400034d0: 532280 max a2, a2, a8 -400034d3: 223b addi.n a2, a2, 3 -400034d5: f01d retw.n -400034d7: 000000 ill -400034da: 020c movi.n a2, 0 -400034dc: f01d retw.n - ... - -400034e0 <_c_0x00060000>: -400034e0: 060000 excw - ... - -400034e4 <_c_0xfff9ffff>: -400034e4: ff .byte 0xff -400034e5: ff .byte 0xff -400034e6: fff9 s32i.n a15, a15, 60 - -400034e8 <uart_div_modify>: -400034e8: 004136 entry a1, 32 -400034eb: ffb861 l32r a6, 400033cc <_c_0x5ffffe00> -400034ee: 115200 slli a5, a2, 16 -400034f1: 556a add.n a5, a5, a6 -400034f3: 0020c0 memw -400034f6: 856532 s32i a3, a5, 0x214 -400034f9: fff991 l32r a9, 400034e0 <_c_0x00060000> -400034fc: 0020c0 memw -400034ff: 882582 l32i a8, a5, 0x220 -40003502: 208890 or a8, a8, a9 -40003505: 0020c0 memw -40003508: 886582 s32i a8, a5, 0x220 -4000350b: fff661 l32r a6, 400034e4 <_c_0xfff9ffff> -4000350e: 0020c0 memw -40003511: 882542 l32i a4, a5, 0x220 -40003514: 104460 and a4, a4, a6 -40003517: 0020c0 memw -4000351a: 886542 s32i a4, a5, 0x220 -4000351d: f01d retw.n - ... - -40003520 <_c_0xfffc0fff>: -40003520: ff .byte 0xff -40003521: 0f .byte 0xf -40003522: fffc bnez.n a15, 40003565 <_X_uart_init+0x31> - -40003524 <_c_0x00009000>: -40003524: 009000 all4 b0, b0:b1:b2:b3 - ... - -40003528 <_c_0x00020000>: -40003528: 020000 andb b0, b0, b0 - ... - -4000352c <_c_13000000>: -4000352c: c65d40 excw - ... - -40003530 <_c_0x08000000>: -40003530: 000000 ill -40003533: 3608 l32i.n a0, a6, 12 - -40003534 <_X_uart_init>: -40003534: 004136 entry a1, 32 -40003537: 0b9216 beqz a2, 400035f4 <_l_35f4> -4000353a: fff9d1 l32r a13, 40003520 <_c_0xfffc0fff> -4000353d: fff9c1 l32r a12, 40003524 <_c_0x00009000> -40003540: f6fc91 l32r a9, 40001130 <_c_0x60003e00> -40003543: 0020c0 memw -40003546: cf29b2 l32i a11, a9, 0x33c -40003549: f03d nop.n -4000354b: 10bbd0 and a11, a11, a13 -4000354e: 20bbc0 or a11, a11, a12 -40003551: 0020c0 memw -40003554: cf69b2 s32i a11, a9, 0x33c -40003557: fff4a1 l32r a10, 40003528 <_c_0x00020000> -4000355a: 0020c0 memw -4000355d: f02982 l32i a8, a9, 0x3c0 -40003560: 2088a0 or a8, a8, a10 -40003563: 0020c0 memw -40003566: f06982 s32i a8, a9, 0x3c0 -40003569: fe3831 l32r a3, 40002e4c <_st_0x3fffdb10_uartdev> -4000356c: fff0b1 l32r a11, 4000352c <_c_13000000> -4000356f: 03c8 l32i.n a12, a3, 0 -40003571: 02ad mov.n a10, a2 -40003573: c2bbc0 quou a11, a11, a12 -40003576: f4b0b0 extui a11, a11, 0, 16 -40003579: fff6e5 call8 400034e8 <uart_div_modify> -4000357c: 3398 l32i.n a9, a3, 12 -4000357e: ff93f1 l32r a15, 400033cc <_c_0x5ffffe00> -40003581: 11e200 slli a14, a2, 16 -40003584: 4388 l32i.n a8, a3, 16 -40003586: eefa add.n a14, a14, a15 -40003588: 23f8 l32i.n a15, a3, 8 -4000358a: 1188c0 slli a8, a8, 4 -4000358d: 20ff90 or a15, a15, a9 -40003590: 1398 l32i.n a9, a3, 4 -40003592: 20ff80 or a15, a15, a8 -40003595: 1199e0 slli a9, a9, 2 -40003598: ffe681 l32r a8, 40003530 <_c_0x08000000> -4000359b: 20ff90 or a15, a15, a9 -4000359e: 20ff80 or a15, a15, a8 -400035a1: 0020c0 memw -400035a4: 886ef2 s32i a15, a14, 0x220 -400035a7: ffced1 l32r a13, 400034e0 <_c_0x00060000> -400035aa: 0020c0 memw -400035ad: 882ec2 l32i a12, a14, 0x220 -400035b0: 20ccd0 or a12, a12, a13 -400035b3: 0020c0 memw -400035b6: 886ec2 s32i a12, a14, 0x220 -400035b9: ffcab1 l32r a11, 400034e4 <_c_0xfff9ffff> -400035bc: 0020c0 memw -400035bf: 882ea2 l32i a10, a14, 0x220 -400035c2: 10aab0 and a10, a10, a11 -400035c5: 0020c0 memw -400035c8: 886ea2 s32i a10, a14, 0x220 -400035cb: 280392 l8ui a9, a3, 40 -400035ce: 649090 extui a9, a9, 0, 7 -400035d1: 0020c0 memw -400035d4: 896e92 s32i a9, a14, 0x224 -400035d7: ff7e81 l32r a8, 400033d0 <_c_0x0000ffff> -400035da: 0020c0 memw -400035dd: 846e82 s32i a8, a14, 0x210 -400035e0: 1f0c movi.n a15, 1 -400035e2: 0020c0 memw -400035e5: 832ed2 l32i a13, a14, 0x20c -400035e8: 20ddf0 or a13, a13, a15 -400035eb: 0020c0 memw -400035ee: 836ed2 s32i a13, a14, 0x20c -400035f1: f01d retw.n - ... - -400035f4 <_l_35f4>: -400035f4: 7d7c movi.n a13, -9 -400035f6: f7bf91 l32r a9, 400014f4 <_c_0x60008e00> -400035f9: 0020c0 memw -400035fc: a229c2 l32i a12, a9, 0x288 -400035ff: 10ccd0 and a12, a12, a13 -40003602: 0020c0 memw -40003605: a269c2 s32i a12, a9, 0x288 -40003608: f7bab1 l32r a11, 400014f0 <_c_0xffff8fff> -4000360b: 0020c0 memw -4000360e: a229a2 l32i a10, a9, 0x288 -40003611: 10aab0 and a10, a10, a11 -40003614: 0020c0 memw -40003617: a269a2 s32i a10, a9, 0x288 -4000361a: 0020c0 memw -4000361d: a22982 l32i a8, a9, 0x288 -40003620: 0020c0 memw -40003623: a26982 s32i a8, a9, 0x288 -40003626: ffcfc6 j 40003569 <_X_uart_init+0x35> -40003629: 000000 ill - -4000362c <uart_tx_one_char>: -4000362c: 004136 entry a1, 32 -4000362f: fe0741 l32r a4, 40002e4c <_st_0x3fffdb10_uartdev> -40003632: 0020f0 nop -40003635: 190442 l8ui a4, a4, 25 -40003638: ff6581 l32r a8, 400033cc <_c_0x5ffffe00> -4000363b: 114400 slli a4, a4, 16 -4000363e: 448a add.n a4, a4, a8 -40003640: 0020c0 memw -40003643: 872432 l32i a3, a4, 0x21c -40003646: 0e7377 bbci a3, 23, 40003658 <uart_tx_one_char+0x2c> -40003649: 088076 loop a0, 40003655 <uart_tx_one_char+0x29> -4000364c: 0020c0 memw -4000364f: 872482 l32i a8, a4, 0x21c -40003652: 027877 bbci a8, 23, 40003658 <uart_tx_one_char+0x2c> -40003655: fffc06 j 40003649 <uart_tx_one_char+0x1d> -40003658: 0020c0 memw -4000365b: 806422 s32i a2, a4, 0x200 -4000365e: 020c movi.n a2, 0 -40003660: f01d retw.n - ... - -40003664 <_X_uart_tx_one_char2>: -40003664: 004136 entry a1, 32 -40003667: fdf941 l32r a4, 40002e4c <_st_0x3fffdb10_uartdev> -4000366a: 0020f0 nop -4000366d: 180442 l8ui a4, a4, 24 -40003670: ff5781 l32r a8, 400033cc <_c_0x5ffffe00> -40003673: 114400 slli a4, a4, 16 -40003676: 448a add.n a4, a4, a8 -40003678: 0020c0 memw -4000367b: 872432 l32i a3, a4, 0x21c -4000367e: 0e7377 bbci a3, 23, 40003690 <_X_uart_tx_one_char2+0x2c> -40003681: 088076 loop a0, 4000368d <_X_uart_tx_one_char2+0x29> -40003684: 0020c0 memw -40003687: 872482 l32i a8, a4, 0x21c -4000368a: 027877 bbci a8, 23, 40003690 <_X_uart_tx_one_char2+0x2c> -4000368d: fffc06 j 40003681 <_X_uart_tx_one_char2+0x1d> -40003690: 0020c0 memw -40003693: 806422 s32i a2, a4, 0x200 -40003696: 020c movi.n a2, 0 -40003698: f01d retw.n - ... - -4000369c <_X_uart_wait_tx_empty>: -4000369c: 004136 entry a1, 32 -4000369f: 115200 slli a5, a2, 16 -400036a2: ff4a81 l32r a8, 400033cc <_c_0x5ffffe00> -400036a5: f43c21 l32r a2, 40000798 <_c_0x00ff0000> -400036a8: 805580 add a5, a5, a8 -400036ab: 0020c0 memw -400036ae: 872532 l32i a3, a5, 0x21c -400036b1: 100237 bnone a2, a3, 400036c5 <_X_uart_wait_tx_empty+0x29> -400036b4: f03d nop.n -400036b6: 088076 loop a0, 400036c2 <_X_uart_wait_tx_empty+0x26> -400036b9: 0020c0 memw -400036bc: 872592 l32i a9, a5, 0x21c -400036bf: 020927 bnone a9, a2, 400036c5 <_X_uart_wait_tx_empty+0x29> -400036c2: fffb86 j 400036b4 <_X_uart_wait_tx_empty+0x18> -400036c5: f01d retw.n -400036c7: 413600 srli a3, a0, 6 -400036ca: e02100 subx4 a2, a1, a0 -400036cd: 52fd excw -400036cf: 22ffa0 orb b15, b15, b10 -400036d2: 311802 l16ui a0, a8, 98 -400036d5: 3e .byte 0x3e -400036d6: ff .byte 0xff -400036d7: 112200 slli a2, a2, 16 -400036da: 802230 add a2, a2, a3 -400036dd: 088076 loop a0, 400036e9 <_X_uart_wait_tx_empty+0x4d> -400036e0: 0020c0 memw -400036e3: 872232 l32i a3, a2, 0x21c -400036e6: 028537 bany a5, a3, 400036ec <_X_uart_wait_tx_empty+0x50> -400036e9: fffc06 j 400036dd <_X_uart_wait_tx_empty+0x41> -400036ec: 0020c0 memw -400036ef: 802222 l32i a2, a2, 0x200 -400036f2: 742020 extui a2, a2, 0, 8 -400036f5: f01d retw.n -400036f7: 413600 srli a3, a0, 6 -400036fa: d44100 extui a4, a0, 1, 14 -400036fd: 42fd excw -400036ff: 811804 excw -40003702: 00ff32 s32ri a3, a15, 0 -40003705: 8a1144 excw -40003708: 20c044 excw -4000370b: 243200 extui a3, a0, 2, 3 -4000370e: 303087 bltu a0, a8, 40003742 <_X_uart_int_handler+0x1a> -40003711: b38c74 excw -40003714: 0020c0 memw -40003717: 802482 l32i a8, a4, 0x200 -4000371a: 004282 s8i a8, a2, 0 -4000371d: 020c movi.n a2, 0 -4000371f: f01d retw.n -40003721: 120c movi.n a2, 1 -40003723: f01d retw.n -40003725: 000000 ill - -40003728 <_X_uart_int_handler>: -40003728: 004136 entry a1, 32 -4000372b: fdc861 l32r a6, 40002e4c <_st_0x3fffdb10_uartdev> -4000372e: 180c movi.n a8, 1 -40003730: 180662 l8ui a6, a6, 24 -40003733: ff2671 l32r a7, 400033cc <_c_0x5ffffe00> -40003736: 115600 slli a5, a6, 16 -40003739: 557a add.n a5, a5, a7 -4000373b: 0020c0 memw -4000373e: 822532 l32i a3, a5, 0x208 -40003741: 546307 bbci a3, 0, 40003799 <_X_uart_int_handler+0x71> -40003744: ffa092 movi a9, 255 -40003747: 0020c0 memw -4000374a: 846582 s32i a8, a5, 0x210 -4000374d: 116600 slli a6, a6, 16 -40003750: 667a add.n a6, a6, a7 -40003752: 0020c0 memw -40003755: 8726a2 l32i a10, a6, 0x21c -40003758: 3d09a7 bnone a9, a10, 40003799 <_X_uart_int_handler+0x71> -4000375b: 1258 l32i.n a5, a2, 4 -4000375d: 290c movi.n a9, 2 -4000375f: d80c movi.n a8, 13 -40003761: 2b8076 loop a0, 40003790 <_X_uart_int_handler+0x68> -40003764: 0020c0 memw -40003767: 8026a2 l32i a10, a6, 0x200 -4000376a: 74a0a0 extui a10, a10, 0, 8 -4000376d: 0045a2 s8i a10, a5, 0 -40003770: 0278 l32i.n a7, a2, 0 -40003772: 1258 l32i.n a5, a2, 4 -40003774: 01d7b2 addmi a11, a7, 0x100 -40003777: 551b addi.n a5, a5, 1 -40003779: 171a87 beq a10, a8, 40003794 <_X_uart_int_handler+0x6c> -4000377c: 1259 s32i.n a5, a2, 4 -4000377e: 0395b7 bne a5, a11, 40003785 <_X_uart_int_handler+0x5d> -40003781: 075d mov.n a5, a7 -40003783: 1279 s32i.n a7, a2, 4 -40003785: 0020c0 memw -40003788: 8726a2 l32i a10, a6, 0x21c -4000378b: 74a0a0 extui a10, a10, 0, 8 -4000378e: 7a8c beqz.n a10, 40003799 <_X_uart_int_handler+0x71> -40003790: fff346 j 40003761 <_X_uart_int_handler+0x39> -40003793: 429900 xorb b9, b9, b0 -40003796: fff886 j 4000377c <_X_uart_int_handler+0x54> -40003799: f01d retw.n -4000379b: 413600 srli a3, a0, 6 -4000379e: 23b600 sext a11, a6, 7 -400037a1: 140c26 beqi a12, -1, 400037b9 <_X_uart_int_handler+0x91> -400037a4: d50c movi.n a5, 13 -400037a6: 02ad mov.n a10, a2 -400037a8: fff4e5 call8 400036f8 <_X_uart_wait_tx_empty+0x5c> -400037ab: 071a66 bnei a10, 1, 400037b6 <_X_uart_int_handler+0x8e> -400037ae: 02ad mov.n a10, a2 -400037b0: fff465 call8 400036f8 <_X_uart_wait_tx_empty+0x5c> -400037b3: f71a26 beqi a10, 1, 400037ae <_X_uart_int_handler+0x86> -400037b6: 0002a2 l8ui a10, a2, 0 -400037b9: 0c9a26 beqi a10, 10, 400037c9 <_X_uart_int_handler+0xa1> -400037bc: 091a57 beq a10, a5, 400037c9 <_X_uart_int_handler+0xa1> -400037bf: 221b addi.n a2, a2, 1 -400037c1: 441b addi.n a4, a4, 1 -400037c3: 744040 extui a4, a4, 0, 8 -400037c6: dc9347 bne a3, a4, 400037a6 <_X_uart_int_handler+0x7e> -400037c9: 0d0c movi.n a13, 0 -400037cb: 0142d2 s8i a13, a2, 1 -400037ce: 0d2d mov.n a2, a13 -400037d0: f01d retw.n - ... - -400037d4 <_X_send_packet>: -400037d4: 004136 entry a1, 32 -400037d7: c0a0a2 movi a10, 192 -400037da: ffe8a5 call8 40003664 <_X_uart_tx_one_char2> -400037dd: 330b addi.n a3, a3, -1 -400037df: 3d0326 beqi a3, -1, 40003820 <_X_send_packet+0x4c> -400037e2: dba052 movi a5, 219 -400037e5: c0a042 movi a4, 192 -400037e8: 000306 j 400037f8 <_X_send_packet+0x24> -400037eb: 650000 extui a0, a0, 16, 7 -400037ee: 1bffe7 bbsi a15, 30, 4000380d <_X_send_packet+0x39> -400037f1: c33222 excw -400037f4: ff .byte 0xff -400037f5: 027396 bltz a3, 40003820 <_X_send_packet+0x4c> -400037f8: 0002a2 l8ui a10, a2, 0 -400037fb: 111a47 beq a10, a4, 40003810 <_X_send_packet+0x3c> -400037fe: eb9a57 bne a10, a5, 400037ed <_X_send_packet+0x19> -40003801: dba0a2 movi a10, 219 -40003804: ffe5e5 call8 40003664 <_X_uart_tx_one_char2> -40003807: dda0a2 movi a10, 221 -4000380a: ffe5a5 call8 40003664 <_X_uart_tx_one_char2> -4000380d: fff7c6 j 400037f0 <_X_send_packet+0x1c> -40003810: dba0a2 movi a10, 219 -40003813: ffe525 call8 40003664 <_X_uart_tx_one_char2> -40003816: dca0a2 movi a10, 220 -40003819: ffe4a5 call8 40003664 <_X_uart_tx_one_char2> -4000381c: fff406 j 400037f0 <_X_send_packet+0x1c> -4000381f: a0a200 addx4 a10, a2, a0 -40003822: e425c0 extui a2, a12, 5, 15 -40003825: ff .byte 0xff -40003826: f01d retw.n - -40003828 <_X_SendMsg>: -40003828: 004136 entry a1, 32 -4000382b: 03bd mov.n a11, a3 -4000382d: 02ad mov.n a10, a2 -4000382f: fffa65 call8 400037d4 <_X_send_packet> -40003832: 020c movi.n a2, 0 -40003834: f01d retw.n -40003836: c80000 excw -40003839: ffc8 l32i.n a12, a15, 60 -4000383b: 3f .byte 0x3f - -4000383c <_X_recv_packet>: -4000383c: 006136 entry a1, 48 -4000383f: 180c movi.n a8, 1 -40003841: 047d mov.n a7, a4 -40003843: fd8261 l32r a6, 40002e4c <_st_0x3fffdb10_uartdev> -40003846: 029d mov.n a9, a2 -40003848: 1199 s32i.n a9, a1, 4 -4000384a: 020c movi.n a2, 0 -4000384c: 004122 s8i a2, a1, 0 -4000384f: d658 l32i.n a5, a6, 52 -40003851: 937840 movnez a7, a8, a4 -40003854: 2179 s32i.n a7, a1, 8 -40003856: 932570 movnez a2, a5, a7 -40003859: c0a072 movi a7, 192 -4000385c: 1cc652 addi a5, a6, 28 -4000385f: 0d3416 beqz a4, 40003936 <_X_recv_packet+0xfa> -40003862: c698 l32i.n a9, a6, 48 -40003864: 1e2966 bnei a9, 2, 40003886 <_X_recv_packet+0x4a> -40003867: 000f86 j 400038a9 <_X_recv_packet+0x6d> -4000386a: 648c beqz.n a4, 40003874 <_X_recv_packet+0x38> -4000386c: c6e8 l32i.n a14, a6, 48 -4000386e: 024e66 bnei a14, 4, 40003874 <_X_recv_packet+0x38> -40003871: 002406 j 40003905 <_X_recv_packet+0xc9> -40003874: 0001a2 l8ui a10, a1, 0 -40003877: 1d1a77 beq a10, a7, 40003898 <_X_recv_packet+0x5c> -4000387a: dba0f2 movi a15, 219 -4000387d: 511af7 beq a10, a15, 400038d2 <_X_recv_packet+0x96> -40003880: 02a237 bge a2, a3, 40003886 <_X_recv_packet+0x4a> -40003883: 002746 j 40003924 <_X_recv_packet+0xe8> -40003886: 05ad mov.n a10, a5 -40003888: 01bd mov.n a11, a1 -4000388a: 001165 call8 400039a0 <_X_uart_rx_readbuff> -4000388d: fd9a16 beqz a10, 4000386a <_X_recv_packet+0x2e> -40003890: ff2416 beqz a4, 40003886 <_X_recv_packet+0x4a> -40003893: 020c movi.n a2, 0 -40003895: f01d retw.n -40003897: a21600 muluh a1, a6, a0 -4000389a: fe .byte 0xfe -4000389b: 0e7416 beqz a4, 40003986 <_X_recv_packet+0x14a> -4000389e: 280c movi.n a8, 2 -400038a0: 090c movi.n a9, 0 -400038a2: d699 s32i.n a9, a6, 52 -400038a4: c689 s32i.n a8, a6, 48 -400038a6: f01d retw.n -400038a8: 05ad00 extui a10, a0, 29, 1 -400038ab: 01bd mov.n a11, a1 -400038ad: 000f25 call8 400039a0 <_X_uart_rx_readbuff> -400038b0: 4adc bnez.n a10, 400038c8 <_X_recv_packet+0x8c> -400038b2: 0001a2 l8ui a10, a1, 0 -400038b5: 0020f0 nop -400038b8: c0ba70 sub a11, a10, a7 -400038bb: 09db16 beqz a11, 4000395c <_X_recv_packet+0x120> -400038be: 05ad mov.n a10, a5 -400038c0: 01bd mov.n a11, a1 -400038c2: 000de5 call8 400039a0 <_X_uart_rx_readbuff> -400038c5: fe9a16 beqz a10, 400038b2 <_X_recv_packet+0x76> -400038c8: 0001c2 l8ui a12, a1, 0 -400038cb: c49c77 bne a12, a7, 40003893 <_X_recv_packet+0x57> -400038ce: ffed06 j 40003886 <_X_recv_packet+0x4a> -400038d1: e4bc00 extui a11, a0, 12, 15 -400038d4: c698 l32i.n a9, a6, 48 -400038d6: 0101d2 l8ui a13, a1, 1 -400038d9: 023966 bnei a9, 3, 400038df <_X_recv_packet+0xa3> -400038dc: 002186 j 40003966 <_X_recv_packet+0x12a> -400038df: 0041d2 s8i a13, a1, 0 -400038e2: 24afe2 movi a14, -220 -400038e5: 0001a2 l8ui a10, a1, 0 -400038e8: 21d8 l32i.n a13, a1, 8 -400038ea: 3c0c movi.n a12, 3 -400038ec: 939cd0 movnez a9, a12, a13 -400038ef: c699 s32i.n a9, a6, 48 -400038f1: eaea add.n a14, a10, a14 -400038f3: 0a2ef6 bgeui a14, 2, 40003901 <_X_recv_packet+0xc5> -400038f6: ffd0b1 l32r a11, 40003838 <_X_SendMsg+0x10> -400038f9: aaba add.n a10, a10, a11 -400038fb: 7c0aa2 l8ui a10, a10, 124 -400038fe: 0041a2 s8i a10, a1, 0 -40003901: ffdec6 j 40003880 <_X_recv_packet+0x44> -40003904: a0e200 addx4 a14, a2, a0 -40003907: f2db addi.n a15, a2, 13 -40003909: f20001 l32r a0, 4000010c <_WindowOverflowHandler+0xc> -4000390c: e20141 l32r a4, 3fffc110 <_start-0x3ef0> -4000390f: 560041 l32r a4, 3ffd9110 <_start-0x26ef0> -40003912: adfbf4 excw -40003915: b11005 call0 3ffb4a18 <_start-0x4b5e8> -40003918: 086520 excw -4000391b: 1a2600 depbits a0, a6, 1, 3 -4000391e: 9859 s32i.n a5, a8, 36 -40003920: ef46c6 j 3ffff63f <_start-0x9c1> -40003923: ff .byte 0xff -40003924: 1198 l32i.n a9, a1, 4 -40003926: 929a add.n a9, a2, a9 -40003928: 0049a2 s8i a10, a9, 0 -4000392b: d688 l32i.n a8, a6, 52 -4000392d: 221b addi.n a2, a2, 1 -4000392f: 881b addi.n a8, a8, 1 -40003931: d689 s32i.n a8, a6, 52 -40003933: ffd3c6 j 40003886 <_X_recv_packet+0x4a> -40003936: 05ad mov.n a10, a5 -40003938: 01bd mov.n a11, a1 -4000393a: 000665 call8 400039a0 <_X_uart_rx_readbuff> -4000393d: 081a26 beqi a10, 1, 40003949 <_X_recv_packet+0x10d> -40003940: 0001a2 l8ui a10, a1, 0 -40003943: c0aa70 sub a10, a10, a7 -40003946: f3ca16 beqz a10, 40003886 <_X_recv_packet+0x4a> -40003949: 05ad mov.n a10, a5 -4000394b: 01bd mov.n a11, a1 -4000394d: 000525 call8 400039a0 <_X_uart_rx_readbuff> -40003950: f51a26 beqi a10, 1, 40003949 <_X_recv_packet+0x10d> -40003953: 0001b2 l8ui a11, a1, 0 -40003956: ef9b77 bne a11, a7, 40003949 <_X_recv_packet+0x10d> -40003959: ffca46 j 40003886 <_X_recv_packet+0x4a> -4000395c: 3d0c movi.n a13, 3 -4000395e: c6d9 s32i.n a13, a6, 48 -40003960: f2fb56 bnez a11, 40003893 <_X_recv_packet+0x57> -40003963: ffc7c6 j 40003886 <_X_recv_packet+0x4a> -40003966: 05ad mov.n a10, a5 -40003968: 01bd mov.n a11, a1 -4000396a: 4e0c movi.n a14, 4 -4000396c: c6e9 s32i.n a14, a6, 48 -4000396e: 000325 call8 400039a0 <_X_uart_rx_readbuff> -40003971: aa1a66 bnei a10, 1, 4000391f <_X_recv_packet+0xe3> -40003974: ffc6c6 j 40003893 <_X_recv_packet+0x57> -40003977: ad0000 excw -4000397a: 01bd05 call0 4000554c <_X_slc_init_attach+0x64> -4000397d: 000225 call8 400039a0 <_X_uart_rx_readbuff> -40003980: f51a26 beqi a10, 1, 40003979 <_X_recv_packet+0x13d> -40003983: ffe606 j 4000391f <_X_recv_packet+0xe3> -40003986: f01d retw.n - -40003988 <_X_RcvMsg>: -40003988: 004136 entry a1, 32 -4000398b: 04cd mov.n a12, a4 -4000398d: 03bd mov.n a11, a3 -4000398f: 02ad mov.n a10, a2 -40003991: ffeaa5 call8 4000383c <_X_recv_packet> -40003994: 2a8c beqz.n a10, 4000399a <_X_RcvMsg+0x12> -40003996: 020c movi.n a2, 0 -40003998: f01d retw.n -4000399a: 120c movi.n a2, 1 -4000399c: f01d retw.n - ... - -400039a0 <_X_uart_rx_readbuff>: -400039a0: 004136 entry a1, 32 -400039a3: 2268 l32i.n a6, a2, 8 -400039a5: 1248 l32i.n a4, a2, 4 -400039a7: 059467 bne a4, a6, 400039b0 <_X_uart_rx_readbuff+0x10> -400039aa: 120c movi.n a2, 1 -400039ac: f01d retw.n -400039ae: 820000 mull a0, a0, a0 -400039b1: 820006 j 3ffe41b5 <_start-0x1be4b> -400039b4: 380043 excw -400039b7: 225802 s16i a0, a8, 68 -400039ba: 01d382 addmi a8, a3, 0x100 -400039bd: 551b addi.n a5, a5, 1 -400039bf: 2259 s32i.n a5, a2, 8 -400039c1: 059587 bne a5, a8, 400039ca <_X_uart_rx_readbuff+0x2a> -400039c4: 2239 s32i.n a3, a2, 8 -400039c6: 020c movi.n a2, 0 -400039c8: f01d retw.n -400039ca: 020c movi.n a2, 0 -400039cc: f01d retw.n -400039ce: 360000 excw -400039d1: 410061 l32r a6, 3ffd3dd4 <_start-0x2c22c> -400039d4: 1e .byte 0x1e -400039d5: 88fd excw -400039d7: 2826b4 excw -400039da: 120c04 excw -400039dd: f01d retw.n -400039df: 01bd00 slli a11, a13, 32 -400039e2: 1cc432 addi a3, a4, 28 -400039e5: 03ad mov.n a10, a3 -400039e7: fffba5 call8 400039a0 <_X_uart_rx_readbuff> -400039ea: ba8c beqz.n a10, 400039f9 <_X_uart_rx_readbuff+0x59> -400039ec: 090c movi.n a9, 0 -400039ee: 004292 s8i a9, a2, 0 -400039f1: 092d mov.n a2, a9 -400039f3: b429 s32i.n a2, a4, 44 -400039f5: f01d retw.n -400039f7: ad0000 excw -400039fa: 019203 excw -400039fd: 01bd00 slli a11, a13, 32 -40003a00: 004292 s8i a9, a2, 0 -40003a03: 221b addi.n a2, a2, 1 -40003a05: fff9a5 call8 400039a0 <_X_uart_rx_readbuff> -40003a08: feda16 beqz a10, 400039f9 <_X_uart_rx_readbuff+0x59> -40003a0b: fff746 j 400039ec <_X_uart_rx_readbuff+0x4c> -40003a0e: 360000 excw -40003a11: 210041 l32r a4, 3ffcbe14 <_start-0x341ec> -40003a14: 0e .byte 0xe -40003a15: 1dfd excw -40003a17: 4e00f0 excw - -40003a18 <_c_0x60004e00>: -40003a18: 004e00 break 14, 0 -40003a1b: 413660 srli a3, a6, 6 - -40003a1c <_X_SelectSpiFunction>: -40003a1c: 004136 entry a1, 32 -40003a1f: 787c movi.n a8, -9 -40003a21: f6b371 l32r a7, 400014f0 <_c_0xffff8fff> -40003a24: f5c641 l32r a4, 4000113c <_c_0x1000> -40003a27: fffc51 l32r a5, 40003a18 <_c_0x60004e00> -40003a2a: f6b261 l32r a6, 400014f4 <_c_0x60008e00> -40003a2d: 123216 beqz a2, 40003b54 <_X_SelectSpiFunction+0x138> -40003a30: 0020c0 memw -40003a33: 8c2632 l32i a3, a6, 0x230 -40003a36: 103380 and a3, a3, a8 -40003a39: 0020c0 memw -40003a3c: 8c6632 s32i a3, a6, 0x230 -40003a3f: 0020c0 memw -40003a42: 8c2622 l32i a2, a6, 0x230 -40003a45: 102270 and a2, a2, a7 -40003a48: 0020c0 memw -40003a4b: 8c6622 s32i a2, a6, 0x230 -40003a4e: 0020c0 memw -40003a51: 8c26f2 l32i a15, a6, 0x230 -40003a54: 20ff40 or a15, a15, a4 -40003a57: 0020c0 memw -40003a5a: 8c66f2 s32i a15, a6, 0x230 -40003a5d: 0020c0 memw -40003a60: 8d26e2 l32i a14, a6, 0x234 -40003a63: 10ee80 and a14, a14, a8 -40003a66: 0020c0 memw -40003a69: 8d66e2 s32i a14, a6, 0x234 -40003a6c: 0020c0 memw -40003a6f: 8d26d2 l32i a13, a6, 0x234 -40003a72: 10dd70 and a13, a13, a7 -40003a75: 0020c0 memw -40003a78: 8d66d2 s32i a13, a6, 0x234 -40003a7b: 0020c0 memw -40003a7e: 8d26c2 l32i a12, a6, 0x234 -40003a81: 20cc40 or a12, a12, a4 -40003a84: 0020c0 memw -40003a87: 8d66c2 s32i a12, a6, 0x234 -40003a8a: 0020c0 memw -40003a8d: 8e26b2 l32i a11, a6, 0x238 -40003a90: 10bb80 and a11, a11, a8 -40003a93: 0020c0 memw -40003a96: 8e66b2 s32i a11, a6, 0x238 -40003a99: 0020c0 memw -40003a9c: 8e26a2 l32i a10, a6, 0x238 -40003a9f: 10aa70 and a10, a10, a7 -40003aa2: 0020c0 memw -40003aa5: 8e66a2 s32i a10, a6, 0x238 -40003aa8: 0020c0 memw -40003aab: 8e2692 l32i a9, a6, 0x238 -40003aae: 209940 or a9, a9, a4 -40003ab1: 0020c0 memw -40003ab4: 8e6692 s32i a9, a6, 0x238 -40003ab7: 0020c0 memw -40003aba: 8f2632 l32i a3, a6, 0x23c -40003abd: 103380 and a3, a3, a8 -40003ac0: 0020c0 memw -40003ac3: 8f6632 s32i a3, a6, 0x23c -40003ac6: 0020c0 memw -40003ac9: 8f2622 l32i a2, a6, 0x23c -40003acc: 102270 and a2, a2, a7 -40003acf: 0020c0 memw -40003ad2: 8f6622 s32i a2, a6, 0x23c -40003ad5: 0020c0 memw -40003ad8: 8f26f2 l32i a15, a6, 0x23c -40003adb: 20ff40 or a15, a15, a4 -40003ade: 0020c0 memw -40003ae1: 8f66f2 s32i a15, a6, 0x23c -40003ae4: 0020c0 memw -40003ae7: 9026e2 l32i a14, a6, 0x240 -40003aea: 10ee80 and a14, a14, a8 -40003aed: 0020c0 memw -40003af0: 9066e2 s32i a14, a6, 0x240 -40003af3: 0020c0 memw -40003af6: 9026d2 l32i a13, a6, 0x240 -40003af9: 10dd70 and a13, a13, a7 -40003afc: 0020c0 memw -40003aff: 9066d2 s32i a13, a6, 0x240 -40003b02: 0020c0 memw -40003b05: 9026c2 l32i a12, a6, 0x240 -40003b08: 20cc40 or a12, a12, a4 -40003b0b: 0020c0 memw -40003b0e: 9066c2 s32i a12, a6, 0x240 -40003b11: 0020c0 memw -40003b14: 9226b2 l32i a11, a6, 0x248 -40003b17: 10bb80 and a11, a11, a8 -40003b1a: 0020c0 memw -40003b1d: 9266b2 s32i a11, a6, 0x248 -40003b20: 0020c0 memw -40003b23: 9226a2 l32i a10, a6, 0x248 -40003b26: 10aa70 and a10, a10, a7 -40003b29: 0020c0 memw -40003b2c: 9266a2 s32i a10, a6, 0x248 -40003b2f: 0020c0 memw -40003b32: 922692 l32i a9, a6, 0x248 -40003b35: 209940 or a9, a9, a4 -40003b38: 0020c0 memw -40003b3b: 926692 s32i a9, a6, 0x248 -40003b3e: f2fe31 l32r a3, 40000738 <_c_0x80000000> -40003b41: 0020c0 memw -40003b44: 492522 l32i a2, a5, 0x124 -40003b47: 202230 or a2, a2, a3 -40003b4a: 0020c0 memw -40003b4d: 496522 s32i a2, a5, 0x124 -40003b50: f01d retw.n -40003b52: c00000 sub a0, a0, a0 -40003b55: a20020 muluh a0, a0, a2 -40003b58: 809826 beqi a8, 10, 40003adc <_X_SelectSpiFunction+0xc0> -40003b5b: 10aa add.n a1, a0, a10 -40003b5d: 0020c0 memw -40003b60: 9866a2 s32i a10, a6, 0x260 -40003b63: 0020c0 memw -40003b66: 982692 l32i a9, a6, 0x260 -40003b69: 109970 and a9, a9, a7 -40003b6c: 0020c0 memw -40003b6f: 986692 s32i a9, a6, 0x260 -40003b72: 0020c0 memw -40003b75: 982632 l32i a3, a6, 0x260 -40003b78: 203340 or a3, a3, a4 -40003b7b: 0020c0 memw -40003b7e: 986632 s32i a3, a6, 0x260 -40003b81: 0020c0 memw -40003b84: 992622 l32i a2, a6, 0x264 -40003b87: 102280 and a2, a2, a8 -40003b8a: 0020c0 memw -40003b8d: 996622 s32i a2, a6, 0x264 -40003b90: 0020c0 memw -40003b93: 9926f2 l32i a15, a6, 0x264 -40003b96: 10ff70 and a15, a15, a7 -40003b99: 0020c0 memw -40003b9c: 9966f2 s32i a15, a6, 0x264 -40003b9f: 0020c0 memw -40003ba2: 9926e2 l32i a14, a6, 0x264 -40003ba5: 20ee40 or a14, a14, a4 -40003ba8: 0020c0 memw -40003bab: 9966e2 s32i a14, a6, 0x264 -40003bae: 0020c0 memw -40003bb1: 9a26d2 l32i a13, a6, 0x268 -40003bb4: 10dd80 and a13, a13, a8 -40003bb7: 0020c0 memw -40003bba: 9a66d2 s32i a13, a6, 0x268 -40003bbd: 0020c0 memw -40003bc0: 9a26c2 l32i a12, a6, 0x268 -40003bc3: 10cc70 and a12, a12, a7 -40003bc6: 0020c0 memw -40003bc9: 9a66c2 s32i a12, a6, 0x268 -40003bcc: 0020c0 memw -40003bcf: 9a26b2 l32i a11, a6, 0x268 -40003bd2: 20bb40 or a11, a11, a4 -40003bd5: 0020c0 memw -40003bd8: 9a66b2 s32i a11, a6, 0x268 -40003bdb: 0020c0 memw -40003bde: 9526a2 l32i a10, a6, 0x254 -40003be1: 10aa80 and a10, a10, a8 -40003be4: 0020c0 memw -40003be7: 9566a2 s32i a10, a6, 0x254 -40003bea: 0020c0 memw -40003bed: 952692 l32i a9, a6, 0x254 -40003bf0: 109970 and a9, a9, a7 -40003bf3: 0020c0 memw -40003bf6: 956692 s32i a9, a6, 0x254 -40003bf9: 0020c0 memw -40003bfc: 952632 l32i a3, a6, 0x254 -40003bff: 203340 or a3, a3, a4 -40003c02: 0020c0 memw -40003c05: 956632 s32i a3, a6, 0x254 -40003c08: 0020c0 memw -40003c0b: 962622 l32i a2, a6, 0x258 -40003c0e: 102280 and a2, a2, a8 -40003c11: 0020c0 memw -40003c14: 966622 s32i a2, a6, 0x258 -40003c17: 0020c0 memw -40003c1a: 9626f2 l32i a15, a6, 0x258 -40003c1d: 10ff70 and a15, a15, a7 -40003c20: 0020c0 memw -40003c23: 9666f2 s32i a15, a6, 0x258 -40003c26: 0020c0 memw -40003c29: 9626e2 l32i a14, a6, 0x258 -40003c2c: 20ee40 or a14, a14, a4 -40003c2f: 0020c0 memw -40003c32: 9666e2 s32i a14, a6, 0x258 -40003c35: 0020c0 memw -40003c38: 9726d2 l32i a13, a6, 0x25c -40003c3b: 10dd80 and a13, a13, a8 -40003c3e: 0020c0 memw -40003c41: 9766d2 s32i a13, a6, 0x25c -40003c44: 0020c0 memw -40003c47: 9726c2 l32i a12, a6, 0x25c -40003c4a: 10cc70 and a12, a12, a7 -40003c4d: 0020c0 memw -40003c50: 9766c2 s32i a12, a6, 0x25c -40003c53: 0020c0 memw -40003c56: 9726b2 l32i a11, a6, 0x25c -40003c59: 20bb40 or a11, a11, a4 -40003c5c: 0020c0 memw -40003c5f: 9766b2 s32i a11, a6, 0x25c -40003c62: f2c7a1 l32r a10, 40000780 <_c_0x7fffffff> -40003c65: 0020c0 memw -40003c68: 492592 l32i a9, a5, 0x124 -40003c6b: 1099a0 and a9, a9, a10 -40003c6e: 0020c0 memw -40003c71: 496592 s32i a9, a5, 0x124 -40003c74: f01d retw.n - ... - -40003c78 <_c_0x60002e00>: -40003c78: 002e00 excw -40003c7b: 413660 srli a3, a6, 6 - -40003c7c <_X_SPI_chip_erase>: -40003c7c: 004136 entry a1, 32 -40003c7f: 20a220 or a10, a2, a2 -40003c82: 005865 call8 40004208 <_X_Wait_SPI_Idle> -40003c85: fb4ba1 l32r a10, 400029b4 <_c_0x00400000> -40003c88: fffc91 l32r a9, 40003c78 <_c_0x60002e00> -40003c8b: 0020c0 memw -40003c8e: 8069a2 s32i a10, a9, 0x200 -40003c91: 0020c0 memw -40003c94: 802982 l32i a8, a9, 0x200 -40003c97: d88c beqz.n a8, 40003ca8 <_X_SPI_chip_erase+0x2c> -40003c99: 078076 loop a0, 40003ca4 <_X_SPI_chip_erase+0x28> -40003c9c: 0020c0 memw -40003c9f: 8029b2 l32i a11, a9, 0x200 -40003ca2: 2b8c beqz.n a11, 40003ca8 <_X_SPI_chip_erase+0x2c> -40003ca4: fffc46 j 40003c99 <_X_SPI_chip_erase+0x1d> -40003ca7: 02ad00 andb b10, b13, b0 -40003caa: 0055e5 call8 40004208 <_X_Wait_SPI_Idle> -40003cad: 020c movi.n a2, 0 -40003caf: f01d retw.n -40003cb1: 000000 ill - -40003cb4 <_c_0x00ffffff>: -40003cb4: ff .byte 0xff -40003cb5: ff .byte 0xff -40003cb6: ff .byte 0xff - ... - -40003cb8 <_c_0x01000000>: -40003cb8: 000000 ill -40003cbb: 413601 l32r a0, 3ffd4194 <_start-0x2be6c> - -40003cbc <_XX_unk3cbc>: -40003cbc: 004136 entry a1, 32 -40003cbf: b48030 extui a8, a3, 0, 12 -40003cc2: 288c beqz.n a8, 40003cc8 <_XX_unk3cbc+0xc> -40003cc4: 120c movi.n a2, 1 -40003cc6: f01d retw.n -40003cc8: 02ad mov.n a10, a2 -40003cca: 0053e5 call8 40004208 <_X_Wait_SPI_Idle> -40003ccd: fff9c1 l32r a12, 40003cb4 <_c_0x00ffffff> -40003cd0: ffea91 l32r a9, 40003c78 <_c_0x60002e00> -40003cd3: 10c3c0 and a12, a3, a12 -40003cd6: 0020c0 memw -40003cd9: 8169c2 s32i a12, a9, 0x204 -40003cdc: fff7b1 l32r a11, 40003cb8 <_c_0x01000000> -40003cdf: 0020c0 memw -40003ce2: 8069b2 s32i a11, a9, 0x200 -40003ce5: 0020c0 memw -40003ce8: 8029a2 l32i a10, a9, 0x200 -40003ceb: 7a8c beqz.n a10, 40003cf6 <_XX_unk3cbc+0x3a> -40003ced: 0020c0 memw -40003cf0: 8029d2 l32i a13, a9, 0x200 -40003cf3: ff6d56 bnez a13, 40003ced <_XX_unk3cbc+0x31> -40003cf6: 02ad mov.n a10, a2 -40003cf8: 0050e5 call8 40004208 <_X_Wait_SPI_Idle> -40003cfb: 020c movi.n a2, 0 -40003cfd: f01d retw.n - ... - -40003d00 <_c_0x00800000>: -40003d00: 800000 add a0, a0, a0 -40003d03: 413600 srli a3, a0, 6 -40003d06: a22000 muluh a2, a0, a0 -40003d09: 4fe520 excw -40003d0c: e9b100 excw -40003d0f: ff .byte 0xff -40003d10: ffda91 l32r a9, 40003c78 <_c_0x60002e00> -40003d13: 10b3b0 and a11, a3, a11 -40003d16: 0020c0 memw -40003d19: 8169b2 s32i a11, a9, 0x204 -40003d1c: fff9a1 l32r a10, 40003d00 <_c_0x00800000> -40003d1f: 0020c0 memw -40003d22: 8069a2 s32i a10, a9, 0x200 -40003d25: 0020c0 memw -40003d28: 802982 l32i a8, a9, 0x200 -40003d2b: d88c beqz.n a8, 40003d3c <_c_0x00800000+0x3c> -40003d2d: 078076 loop a0, 40003d38 <_c_0x00800000+0x38> -40003d30: 0020c0 memw -40003d33: 8029c2 l32i a12, a9, 0x200 -40003d36: 2c8c beqz.n a12, 40003d3c <_c_0x00800000+0x3c> -40003d38: fffc46 j 40003d2d <_c_0x00800000+0x2d> -40003d3b: 02ad00 andb b10, b13, b0 -40003d3e: 004ca5 call8 40004208 <_X_Wait_SPI_Idle> -40003d41: 020c movi.n a2, 0 -40003d43: f01d retw.n -40003d45: 000000 ill -40003d48: 000000 ill -40003d4b: 000020 excw - -40003d4c <_c_0x02000000>: -40003d4c: 000000 ill -40003d4f: 413602 excw -40003d52: 380c00 excw -40003d55: 1f8857 bany a8, a5, 40003d78 <_c_0x02000000+0x2c> -40003d58: 4298 l32i.n a9, a2, 16 -40003d5a: e2a390 remu a10, a3, a9 -40003d5d: a5aa add.n a10, a5, a10 -40003d5f: 1539a7 bltu a9, a10, 40003d78 <_c_0x02000000+0x2c> -40003d62: 20a220 or a10, a2, a2 -40003d65: 004a25 call8 40004208 <_X_Wait_SPI_Idle> -40003d68: 0215e6 bgei a5, 1, 40003d6e <_c_0x02000000+0x22> -40003d6b: 002b86 j 40003e1d <_c_0x02000000+0xd1> -40003d6e: ffc261 l32r a6, 40003c78 <_c_0x60002e00> -40003d71: ffd071 l32r a7, 40003cb4 <_c_0x00ffffff> -40003d74: 0003c6 j 40003d87 <_c_0x02000000+0x3b> -40003d77: 120c00 andbc b0, b12, b0 -40003d7a: f01d retw.n -40003d7c: 02ad mov.n a10, a2 -40003d7e: 0048a5 call8 40004208 <_X_Wait_SPI_Idle> -40003d81: 0215e6 bgei a5, 1, 40003d87 <_c_0x02000000+0x3b> -40003d84: 002546 j 40003e1d <_c_0x02000000+0xd1> -40003d87: 10a370 and a10, a3, a7 -40003d8a: 56c5a6 blti a5, 32, 40003de4 <_c_0x02000000+0x98> -40003d8d: ffeed1 l32r a13, 40003d48 <_c_0x00800000+0x48> -40003d90: 20dad0 or a13, a10, a13 -40003d93: 0020c0 memw -40003d96: 8166d2 s32i a13, a6, 0x204 -40003d99: 080c movi.n a8, 0 -40003d9b: 890c movi.n a9, 8 -40003d9d: 11a976 loopgtz a9, 40003db2 <_c_0x02000000+0x66> -40003da0: a09860 addx4 a9, a8, a6 -40003da3: 04b8 l32i.n a11, a4, 0 -40003da5: 0020c0 memw -40003da8: 9069b2 s32i a11, a9, 0x240 -40003dab: 444b addi.n a4, a4, 4 -40003dad: 981b addi.n a9, a8, 1 -40003daf: 748090 extui a8, a9, 0, 8 -40003db2: e0c552 addi a5, a5, -32 -40003db5: 20c332 addi a3, a3, 32 -40003db8: 02ad mov.n a10, a2 -40003dba: 004025 call8 400041bc <_X_SPI_write_enable> -40003dbd: fb7a56 bnez a10, 40003d78 <_c_0x02000000+0x2c> -40003dc0: 0020c0 memw -40003dc3: ffe2f1 l32r a15, 40003d4c <_c_0x02000000> -40003dc6: 8066f2 s32i a15, a6, 0x200 -40003dc9: 0020c0 memw -40003dcc: 8026e2 l32i a14, a6, 0x200 -40003dcf: 0020f0 nop -40003dd2: fa6e16 beqz a14, 40003d7c <_c_0x02000000+0x30> -40003dd5: 088076 loop a0, 40003de1 <_c_0x02000000+0x95> -40003dd8: 0020c0 memw -40003ddb: 802682 l32i a8, a6, 0x200 -40003dde: f9a816 beqz a8, 40003d7c <_c_0x02000000+0x30> -40003de1: fffc06 j 40003dd5 <_c_0x02000000+0x89> -40003de4: 03bd mov.n a11, a3 -40003de6: 8b75b0 depbits a11, a5, 24, 8 -40003de9: 0020c0 memw -40003dec: 8166b2 s32i a11, a6, 0x204 -40003def: 219250 srai a9, a5, 2 -40003df2: 14a050 extui a10, a5, 0, 2 -40003df5: fa9c beqz.n a10, 40003e18 <_c_0x02000000+0xcc> -40003df7: a91b addi.n a10, a9, 1 -40003df9: 080c movi.n a8, 0 -40003dfb: 7490a0 extui a9, a10, 0, 8 -40003dfe: 119976 loopnez a9, 40003e13 <_c_0x02000000+0xc7> -40003e01: a09860 addx4 a9, a8, a6 -40003e04: 04b8 l32i.n a11, a4, 0 -40003e06: 0020c0 memw -40003e09: 9069b2 s32i a11, a9, 0x240 -40003e0c: 444b addi.n a4, a4, 4 -40003e0e: 981b addi.n a9, a8, 1 -40003e10: 748090 extui a8, a9, 0, 8 -40003e13: 050c movi.n a5, 0 -40003e15: ffe7c6 j 40003db8 <_c_0x02000000+0x6c> -40003e18: 09ad mov.n a10, a9 -40003e1a: fff6c6 j 40003df9 <_c_0x02000000+0xad> -40003e1d: 020c movi.n a2, 0 -40003e1f: f01d retw.n -40003e21: 000000 ill - -40003e24 <_XX_unk3e24>: -40003e24: 004136 entry a1, 32 -40003e27: 1288 l32i.n a8, a2, 4 -40003e29: 953a add.n a9, a5, a3 -40003e2b: 03b897 bgeu a8, a9, 40003e32 <_XX_unk3e24+0xe> -40003e2e: 120c movi.n a2, 1 -40003e30: f01d retw.n -40003e32: 02ad mov.n a10, a2 -40003e34: 003d25 call8 40004208 <_X_Wait_SPI_Idle> -40003e37: 0215e6 bgei a5, 1, 40003e3d <_XX_unk3e24+0x19> -40003e3a: 002e06 j 40003ef6 <_XX_unk3e24+0xd2> -40003e3d: ffc2f1 l32r a15, 40003d48 <_c_0x00800000+0x48> -40003e40: f23ee1 l32r a14, 40000738 <_c_0x80000000> -40003e43: ff8dd1 l32r a13, 40003c78 <_c_0x60002e00> -40003e46: 000b46 j 40003e77 <_XX_unk3e24+0x53> -40003e49: 219250 srai a9, a5, 2 -40003e4c: 14a050 extui a10, a5, 0, 2 -40003e4f: 09ea16 beqz a10, 40003ef1 <_XX_unk3e24+0xcd> -40003e52: a91b addi.n a10, a9, 1 -40003e54: 080c movi.n a8, 0 -40003e56: 7490a0 extui a9, a10, 0, 8 -40003e59: 119976 loopnez a9, 40003e6e <_XX_unk3e24+0x4a> -40003e5c: a098d0 addx4 a9, a8, a13 -40003e5f: 0020c0 memw -40003e62: 902992 l32i a9, a9, 0x240 -40003e65: 881b addi.n a8, a8, 1 -40003e67: 0499 s32i.n a9, a4, 0 -40003e69: 748080 extui a8, a8, 0, 8 -40003e6c: 444b addi.n a4, a4, 4 -40003e6e: 00a052 movi a5, 0 -40003e71: 0215e6 bgei a5, 1, 40003e77 <_XX_unk3e24+0x53> -40003e74: 001f86 j 40003ef6 <_XX_unk3e24+0xd2> -40003e77: 4ac5a6 blti a5, 32, 40003ec5 <_XX_unk3e24+0xa1> -40003e7a: 20c3f0 or a12, a3, a15 -40003e7d: 0020c0 memw -40003e80: 816dc2 s32i a12, a13, 0x204 -40003e83: 0020c0 memw -40003e86: 806de2 s32i a14, a13, 0x200 -40003e89: 0020c0 memw -40003e8c: 802db2 l32i a11, a13, 0x200 -40003e8f: eb8c beqz.n a11, 40003ea1 <_XX_unk3e24+0x7d> -40003e91: 078076 loop a0, 40003e9c <_XX_unk3e24+0x78> -40003e94: 0020c0 memw -40003e97: 802d82 l32i a8, a13, 0x200 -40003e9a: 388c beqz.n a8, 40003ea1 <_XX_unk3e24+0x7d> -40003e9c: fffc46 j 40003e91 <_XX_unk3e24+0x6d> -40003e9f: 0c0000 excw -40003ea2: 0c08 l32i.n a0, a12, 0 -40003ea4: 7689 s32i.n a8, a6, 28 -40003ea6: 11a9 s32i.n a10, a1, 4 -40003ea8: a098d0 addx4 a9, a8, a13 -40003eab: 0020c0 memw -40003eae: 902992 l32i a9, a9, 0x240 -40003eb1: 881b addi.n a8, a8, 1 -40003eb3: 0499 s32i.n a9, a4, 0 -40003eb5: 748080 extui a8, a8, 0, 8 -40003eb8: 444b addi.n a4, a4, 4 -40003eba: e0c552 addi a5, a5, -32 -40003ebd: 20c332 addi a3, a3, 32 -40003ec0: ffeb46 j 40003e71 <_XX_unk3e24+0x4d> -40003ec3: 800000 add a0, a0, a0 -40003ec6: a001a5 call8 3ffa3ee0 <_start-0x5c120> -40003ec9: c020a3 excw -40003ecc: a20020 muluh a0, a0, a2 -40003ecf: 816d excw -40003ed1: 0020c0 memw -40003ed4: 806de2 s32i a14, a13, 0x200 -40003ed7: 0020c0 memw -40003eda: 802d92 l32i a9, a13, 0x200 -40003edd: f68916 beqz a9, 40003e49 <_XX_unk3e24+0x25> -40003ee0: f03d nop.n -40003ee2: 088076 loop a0, 40003eee <_XX_unk3e24+0xca> -40003ee5: 0020c0 memw -40003ee8: 802db2 l32i a11, a13, 0x200 -40003eeb: f5ab16 beqz a11, 40003e49 <_XX_unk3e24+0x25> -40003eee: fffb86 j 40003ee0 <_XX_unk3e24+0xbc> -40003ef1: 09ad mov.n a10, a9 -40003ef3: ffd746 j 40003e54 <_XX_unk3e24+0x30> -40003ef6: 020c movi.n a2, 0 -40003ef8: f01d retw.n - ... - -40003efc <_X_SPI_read_status>: -40003efc: 004136 entry a1, 32 -40003eff: fd8c61 l32r a6, 40003530 <_c_0x08000000> -40003f02: ff5d51 l32r a5, 40003c78 <_c_0x60002e00> -40003f05: 080c movi.n a8, 0 -40003f07: 000346 j 40003f18 <_X_SPI_read_status+0x1c> -40003f0a: 5298 l32i.n a9, a2, 20 -40003f0c: 0020c0 memw -40003f0f: 842572 l32i a7, a5, 0x210 -40003f12: 107790 and a7, a7, a9 -40003f15: 236707 bbci a7, 0, 40003f3c <_X_SPI_read_status+0x40> -40003f18: 0020c0 memw -40003f1b: 846582 s32i a8, a5, 0x210 -40003f1e: 0020c0 memw -40003f21: 806562 s32i a6, a5, 0x200 -40003f24: 0020c0 memw -40003f27: 8025a2 l32i a10, a5, 0x200 -40003f2a: fdca16 beqz a10, 40003f0a <_X_SPI_read_status+0xe> -40003f2d: 088076 loop a0, 40003f39 <_X_SPI_read_status+0x3d> -40003f30: 0020c0 memw -40003f33: 8025b2 l32i a11, a5, 0x200 -40003f36: fd0b16 beqz a11, 40003f0a <_X_SPI_read_status+0xe> -40003f39: fffc06 j 40003f2d <_X_SPI_read_status+0x31> -40003f3c: 0379 s32i.n a7, a3, 0 -40003f3e: 020c movi.n a2, 0 -40003f40: f01d retw.n -40003f42: 480000 excw -40003f45: ffc8 l32i.n a12, a15, 60 -40003f47: 3f .byte 0x3f - -40003f48 <_c_0x90000000>: -40003f48: 000000 ill -40003f4b: 003590 excw - -40003f4c <_c_0x70000035>: -40003f4c: 000035 call12 40003f50 <_c_0x00040000> -40003f4f: 000070 excw - -40003f50 <_c_0x00040000>: -40003f50: 040000 extui a0, a0, 0, 1 - ... - -40003f54 <_XX_unk3f54>: -40003f54: 004136 entry a1, 32 -40003f57: fffba1 l32r a10, 40003f44 <_X_SPI_read_status+0x48> -40003f5a: 0020f0 nop -40003f5d: 0aa8 l32i.n a10, a10, 0 -40003f5f: 002aa5 call8 40004208 <_X_Wait_SPI_Idle> -40003f62: 0d0c movi.n a13, 0 -40003f64: ff4591 l32r a9, 40003c78 <_c_0x60002e00> -40003f67: 0020c0 memw -40003f6a: 8229a2 l32i a10, a9, 0x208 -40003f6d: 0020c0 memw -40003f70: 8269d2 s32i a13, a9, 0x208 -40003f73: 00a782 movi a8, 0x700 -40003f76: 0020c0 memw -40003f79: 886982 s32i a8, a9, 0x220 -40003f7c: fff3f1 l32r a15, 40003f48 <_c_0x90000000> -40003f7f: 0020c0 memw -40003f82: 8769f2 s32i a15, a9, 0x21c -40003f85: fff1e1 l32r a14, 40003f4c <_c_0x70000035> -40003f88: 0020c0 memw -40003f8b: 8969e2 s32i a14, a9, 0x224 -40003f8e: 0020c0 memw -40003f91: 9069d2 s32i a13, a9, 0x240 -40003f94: ffefc1 l32r a12, 40003f50 <_c_0x00040000> -40003f97: 0020c0 memw -40003f9a: 8069c2 s32i a12, a9, 0x200 -40003f9d: 0020c0 memw -40003fa0: 8029b2 l32i a11, a9, 0x200 -40003fa3: db8c beqz.n a11, 40003fb4 <_XX_unk3f54+0x60> -40003fa5: 078076 loop a0, 40003fb0 <_XX_unk3f54+0x5c> -40003fa8: 0020c0 memw -40003fab: 8029b2 l32i a11, a9, 0x200 -40003fae: 2b8c beqz.n a11, 40003fb4 <_XX_unk3f54+0x60> -40003fb0: fffc46 j 40003fa5 <_XX_unk3f54+0x51> -40003fb3: 20c000 or a12, a0, a0 -40003fb6: 29c200 excw -40003fb9: c0c090 sub a12, a0, a9 -40003fbc: cc8074 excw -40003fbf: 03c911 l32r a1, 3ffc4ee4 <_start-0x3b11c> -40003fc2: 0020c0 memw -40003fc5: 8269a2 s32i a10, a9, 0x208 -40003fc8: 020c movi.n a2, 0 -40003fca: f01d retw.n - -40003fcc <_c_0x04000000>: -40003fcc: 000000 ill -40003fcf: 413604 excw -40003fd2: 02ad00 andb b10, b13, b0 -40003fd5: 002325 call8 40004208 <_X_Wait_SPI_Idle> -40003fd8: ff2891 l32r a9, 40003c78 <_c_0x60002e00> -40003fdb: 0020c0 memw -40003fde: 846932 s32i a3, a9, 0x210 -40003fe1: fffaa1 l32r a10, 40003fcc <_c_0x04000000> -40003fe4: 0020c0 memw -40003fe7: 8069a2 s32i a10, a9, 0x200 -40003fea: 0020c0 memw -40003fed: 802982 l32i a8, a9, 0x200 -40003ff0: 0020f0 nop -40003ff3: d88c beqz.n a8, 40004004 <_c_0x04000000+0x38> -40003ff5: 078076 loop a0, 40004000 <_c_0x04000000+0x34> -40003ff8: 0020c0 memw -40003ffb: 8029b2 l32i a11, a9, 0x200 -40003ffe: 2b8c beqz.n a11, 40004004 <_c_0x04000000+0x38> -40004000: fffc46 j 40003ff5 <_c_0x04000000+0x29> -40004003: 020c00 andb b0, b12, b0 -40004006: f01d retw.n -40004008: 000000 ill -4000400b: 000070 excw -4000400e: 368800 excw - -40004010 <_XX_unk4010>: -40004010: 004136 entry a1, 32 -40004013: 000232 l8ui a3, a2, 0 -40004016: 0020f0 nop -40004019: 144230 extui a4, a3, 2, 2 -4000401c: 145430 extui a5, a3, 4, 2 -4000401f: 143030 extui a3, a3, 0, 2 -40004022: 09a316 beqz a3, 400040c0 <_XX_unk4010+0xb0> -40004025: 0233b6 bltui a3, 3, 4000402b <_XX_unk4010+0x1b> -40004028: 002506 j 400040c0 <_XX_unk4010+0xb0> -4000402b: 022366 bnei a3, 2, 40004031 <_XX_unk4010+0x21> -4000402e: 002186 j 400040b8 <_XX_unk4010+0xa8> -40004031: 0b1366 bnei a3, 1, 40004040 <_XX_unk4010+0x30> -40004034: 0224b6 bltui a4, 2, 4000403a <_XX_unk4010+0x2a> -40004037: 002146 j 400040c0 <_XX_unk4010+0xb0> -4000403a: 808340 add a8, a3, a4 -4000403d: 7f9587 bne a5, a8, 400040c0 <_XX_unk4010+0xb0> -40004040: ffc1a1 l32r a10, 40003f44 <_X_SPI_read_status+0x48> -40004043: f03d nop.n -40004045: 0aa8 l32i.n a10, a10, 0 -40004047: 001c25 call8 40004208 <_X_Wait_SPI_Idle> -4000404a: 0f0c movi.n a15, 0 -4000404c: ffefc1 l32r a12, 40004008 <_c_0x04000000+0x3c> -4000404f: ffc0b1 l32r a11, 40003f50 <_c_0x00040000> -40004052: ff09a1 l32r a10, 40003c78 <_c_0x60002e00> -40004055: 0020c0 memw -40004058: 822ad2 l32i a13, a10, 0x208 -4000405b: 0020c0 memw -4000405e: 0212e2 l16ui a14, a2, 4 -40004061: 826af2 s32i a15, a10, 0x208 -40004064: 10ce16 beqz a14, 40004174 <_XX_unk4010+0x164> -40004067: f87c movi.n a8, -1 -40004069: b09580 addx8 a9, a5, a8 -4000406c: ffb751 l32r a5, 40003f48 <_c_0x90000000> -4000406f: b08380 addx8 a8, a3, a8 -40004072: 0199f0 slli a9, a9, 17 -40004075: 118880 slli a8, a8, 8 -40004078: 208890 or a8, a8, a9 -4000407b: 0c9d mov.n a9, a12 -4000407d: 0020c0 memw -40004080: 886a82 s32i a8, a10, 0x220 -40004083: 0020c0 memw -40004086: 876a52 s32i a5, a10, 0x21c -40004089: 0102e2 l8ui a14, a2, 1 -4000408c: 0a7e90 depbits a9, a14, 0, 8 -4000408f: 0020c0 memw -40004092: 896a92 s32i a9, a10, 0x224 -40004095: 0020c0 memw -40004098: 906af2 s32i a15, a10, 0x240 -4000409b: 0020c0 memw -4000409e: 806ab2 s32i a11, a10, 0x200 -400040a1: 0020c0 memw -400040a4: 802a82 l32i a8, a10, 0x200 -400040a7: a89c beqz.n a8, 400040c5 <_XX_unk4010+0xb5> -400040a9: 078076 loop a0, 400040b4 <_XX_unk4010+0xa4> -400040ac: 0020c0 memw -400040af: 802a92 l32i a9, a10, 0x200 -400040b2: f98c beqz.n a9, 400040c5 <_XX_unk4010+0xb5> -400040b4: fffc46 j 400040a9 <_XX_unk4010+0x99> -400040b7: 44cc00 extui a12, a0, 12, 5 -400040ba: 022566 bnei a5, 2, 400040c0 <_XX_unk4010+0xb0> -400040bd: ffdc06 j 40004031 <_XX_unk4010+0x21> -400040c0: f01d retw.n -400040c2: 000000 ill -400040c5: 0020c0 memw -400040c8: 902ae2 l32i a14, a10, 0x240 -400040cb: 930b addi.n a9, a3, -1 -400040cd: 7480e0 extui a8, a14, 0, 8 -400040d0: f4e0e0 extui a14, a14, 0, 16 -400040d3: 83e890 moveqz a14, a8, a9 -400040d6: 0ca416 beqz a4, 400041a4 <_XX_unk4010+0x194> -400040d9: 0c9d mov.n a9, a12 -400040db: 0020c0 memw -400040de: 876a52 s32i a5, a10, 0x21c -400040e1: 020282 l8ui a8, a2, 2 -400040e4: 0a7890 depbits a9, a8, 0, 8 -400040e7: 0020c0 memw -400040ea: 896a92 s32i a9, a10, 0x224 -400040ed: 0020c0 memw -400040f0: 906af2 s32i a15, a10, 0x240 -400040f3: 0020c0 memw -400040f6: 806ab2 s32i a11, a10, 0x200 -400040f9: 0020c0 memw -400040fc: 802a82 l32i a8, a10, 0x200 -400040ff: d88c beqz.n a8, 40004110 <_XX_unk4010+0x100> -40004101: 078076 loop a0, 4000410c <_XX_unk4010+0xfc> -40004104: 0020c0 memw -40004107: 802a92 l32i a9, a10, 0x200 -4000410a: 298c beqz.n a9, 40004110 <_XX_unk4010+0x100> -4000410c: fffc46 j 40004101 <_XX_unk4010+0xf1> -4000410f: 20c000 or a12, a0, a0 -40004112: 128200 andbc b8, b2, b0 -40004115: 2a9202 l16si a0, a2, 84 -40004118: 12f290 andbc b15, b2, b9 -4000411b: 909003 excw -4000411e: ff8074 excw -40004121: 998010 excw -40004124: 9e9011 l32r a1, 3ffebb64 <_start-0x1449c> -40004127: 909020 addx2 a9, a0, a2 -4000412a: 8890f4 excw -4000412d: 1f8710 excw -40004130: 913a add.n a9, a1, a3 -40004132: c0ffb6 bltui a15, 0x100, 400040f6 <_XX_unk4010+0xe6> -40004135: 920020 excw -40004138: 876a add.n a8, a7, a6 -4000413a: 030282 l8ui a8, a2, 3 -4000413d: 0a78c0 depbits a12, a8, 0, 8 -40004140: 0020c0 memw -40004143: 896ac2 s32i a12, a10, 0x224 -40004146: 0312f2 l16ui a15, a2, 6 -40004149: 0020c0 memw -4000414c: 906af2 s32i a15, a10, 0x240 -4000414f: 0020c0 memw -40004152: 806ab2 s32i a11, a10, 0x200 -40004155: 0020c0 memw -40004158: 802ae2 l32i a14, a10, 0x200 -4000415b: de8c beqz.n a14, 4000416c <_XX_unk4010+0x15c> -4000415d: 078076 loop a0, 40004168 <_XX_unk4010+0x158> -40004160: 0020c0 memw -40004163: 802ab2 l32i a11, a10, 0x200 -40004166: 2b8c beqz.n a11, 4000416c <_XX_unk4010+0x15c> -40004168: fffc46 j 4000415d <_XX_unk4010+0x14d> -4000416b: 20c000 or a12, a0, a0 -4000416e: 6ad200 depbits a0, a2, 6, 14 -40004171: f01d82 l16ui a8, a13, 0x1e0 -40004174: f17181 l32r a8, 40000738 <_c_0x80000000> -40004177: 0020c0 memw -4000417a: 876a82 s32i a8, a10, 0x21c -4000417d: 0102f2 l8ui a15, a2, 1 -40004180: 0a7fc0 depbits a12, a15, 0, 8 -40004183: 0020c0 memw -40004186: 896ac2 s32i a12, a10, 0x224 -40004189: 0020c0 memw -4000418c: 806ab2 s32i a11, a10, 0x200 -4000418f: 0020c0 memw -40004192: 802ae2 l32i a14, a10, 0x200 -40004195: fd3e16 beqz a14, 4000416c <_XX_unk4010+0x15c> -40004198: 0020c0 memw -4000419b: 802a92 l32i a9, a10, 0x200 -4000419e: ff6956 bnez a9, 40004198 <_XX_unk4010+0x188> -400041a1: fff1c6 j 4000416c <_XX_unk4010+0x15c> -400041a4: 021292 l16ui a9, a2, 4 -400041a7: 0312f2 l16ui a15, a2, 6 -400041aa: 108e90 and a8, a14, a9 -400041ad: 10ff90 and a15, a15, a9 -400041b0: 021f87 beq a15, a8, 400041b6 <_XX_unk4010+0x1a6> -400041b3: ffde86 j 40004131 <_XX_unk4010+0x121> -400041b6: ffec86 j 4000416c <_XX_unk4010+0x15c> -400041b9: 000000 ill - -400041bc <_X_SPI_write_enable>: -400041bc: 006136 entry a1, 48 -400041bf: 02ad mov.n a10, a2 -400041c1: 080c movi.n a8, 0 -400041c3: 006182 s32i a8, a1, 0 -400041c6: 000425 call8 40004208 <_X_Wait_SPI_Idle> -400041c9: f165b1 l32r a11, 40000760 <_c_0x40000000> -400041cc: feab91 l32r a9, 40003c78 <_c_0x60002e00> -400041cf: 0020c0 memw -400041d2: 8069b2 s32i a11, a9, 0x200 -400041d5: 0020c0 memw -400041d8: 8029a2 l32i a10, a9, 0x200 -400041db: fa8c beqz.n a10, 400041ee <_X_SPI_write_enable+0x32> -400041dd: 078076 loop a0, 400041e8 <_X_SPI_write_enable+0x2c> -400041e0: 0020c0 memw -400041e3: 8029c2 l32i a12, a9, 0x200 -400041e6: 4c8c beqz.n a12, 400041ee <_X_SPI_write_enable+0x32> -400041e8: fffc46 j 400041dd <_X_SPI_write_enable+0x21> -400041eb: 000000 ill -400041ee: 01d8 l32i.n a13, a1, 0 -400041f0: 230c movi.n a3, 2 -400041f2: 0bed17 bbsi a13, 1, 40004201 <_X_SPI_write_enable+0x45> -400041f5: 02ad mov.n a10, a2 -400041f7: 01bd mov.n a11, a1 -400041f9: ffd025 call8 40003efc <_X_SPI_read_status> -400041fc: 01e8 l32i.n a14, a1, 0 -400041fe: f30e37 bnone a14, a3, 400041f5 <_X_SPI_write_enable+0x39> -40004201: 020c movi.n a2, 0 -40004203: f01d retw.n -40004205: 000000 ill - -40004208 <_X_Wait_SPI_Idle>: -40004208: 006136 entry a1, 48 -4000420b: 20a220 or a10, a2, a2 -4000420e: fe9a91 l32r a9, 40003c78 <_c_0x60002e00> -40004211: 0020c0 memw -40004214: be2982 l32i a8, a9, 0x2f8 -40004217: d88c beqz.n a8, 40004228 <_l_4228> -40004219: 078076 loop a0, 40004224 <_X_Wait_SPI_Idle+0x1c> -4000421c: 0020c0 memw -4000421f: be29b2 l32i a11, a9, 0x2f8 -40004222: 2b8c beqz.n a11, 40004228 <_l_4228> -40004224: fffc46 j 40004219 <_X_Wait_SPI_Idle+0x11> - ... - -40004228 <_l_4228>: -40004228: 01bd mov.n a11, a1 -4000422a: ffcd25 call8 40003efc <_X_SPI_read_status> -4000422d: 3a8c beqz.n a10, 40004234 <_l_4234> -4000422f: 120c movi.n a2, 1 -40004231: f01d retw.n - ... - -40004234 <_l_4234>: -40004234: 020c movi.n a2, 0 -40004236: f01d retw.n - -40004238 <_XX_unk4238>: -40004238: 006136 entry a1, 48 -4000423b: 02ad mov.n a10, a2 -4000423d: 01bd mov.n a11, a1 -4000423f: ffd165 call8 40003f54 <_XX_unk3f54> -40004242: 2a8c beqz.n a10, 40004248 <_XX_unk4238+0x10> -40004244: 120c movi.n a2, 1 -40004246: f01d retw.n -40004248: 0188 l32i.n a8, a1, 0 -4000424a: 036897 bbci a8, 9, 40004251 <_XX_unk4238+0x19> -4000424d: 020c movi.n a2, 0 -4000424f: f01d retw.n -40004251: f9d8b1 l32r a11, 400029b4 <_c_0x00400000> -40004254: fe89a1 l32r a10, 40003c78 <_c_0x60002e00> -40004257: 0020c0 memw -4000425a: 822a92 l32i a9, a10, 0x208 -4000425d: f03d nop.n -4000425f: 2099b0 or a9, a9, a11 -40004262: 0020c0 memw -40004265: 826a92 s32i a9, a10, 0x208 -40004268: 02ad mov.n a10, a2 -4000426a: fff525 call8 400041bc <_X_SPI_write_enable> -4000426d: fd3a56 bnez a10, 40004244 <_XX_unk4238+0xc> -40004270: 02ad mov.n a10, a2 -40004272: 00a2b2 movi a11, 0x200 -40004275: ffd5a5 call8 40003fd0 <_c_0x04000000+0x4> -40004278: fc8a56 bnez a10, 40004244 <_XX_unk4238+0xc> -4000427b: fff386 j 4000424d <_XX_unk4238+0x15> -4000427e: 360000 excw -40004281: ad0061 l32r a6, 3ffef684 <_start-0x1097c> -40004284: 01bd02 l32ai a0, a13, 4 -40004287: ffcce5 call8 40003f54 <_XX_unk3f54> -4000428a: 2a8c beqz.n a10, 40004290 <_XX_unk4238+0x58> -4000428c: 120c movi.n a2, 1 -4000428e: f01d retw.n -40004290: 0188 l32i.n a8, a1, 0 -40004292: 03e897 bbsi a8, 9, 40004299 <_XX_unk4238+0x61> -40004295: 020c movi.n a2, 0 -40004297: f01d retw.n -40004299: f9c6b1 l32r a11, 400029b4 <_c_0x00400000> -4000429c: fe77a1 l32r a10, 40003c78 <_c_0x60002e00> -4000429f: 0020c0 memw -400042a2: 822a92 l32i a9, a10, 0x208 -400042a5: f03d nop.n -400042a7: 2099b0 or a9, a9, a11 -400042aa: 0020c0 memw -400042ad: 826a92 s32i a9, a10, 0x208 -400042b0: 02ad mov.n a10, a2 -400042b2: fff0a5 call8 400041bc <_X_SPI_write_enable> -400042b5: fd3a56 bnez a10, 4000428c <_XX_unk4238+0x54> -400042b8: 02ad mov.n a10, a2 -400042ba: 04c1b2 addi a11, a1, 4 -400042bd: ffc3e5 call8 40003efc <_X_SPI_read_status> -400042c0: 02ad mov.n a10, a2 -400042c2: 0401b2 l8ui a11, a1, 4 -400042c5: ffd0a5 call8 40003fd0 <_c_0x04000000+0x4> -400042c8: fc0a56 bnez a10, 4000428c <_XX_unk4238+0x54> -400042cb: fff186 j 40004295 <_XX_unk4238+0x5d> -400042ce: 000000 ill -400042d1: 002880 excw -400042d4: 100000 and a0, a0, a0 - ... - -400042d8 <_X_SPIFlashModeConfig>: -400042d8: 004136 entry a1, 32 -400042db: 069216 beqz a2, 40004348 <_X_SPIFlashModeConfig+0x70> -400042de: 6e1226 beqi a2, 1, 40004350 <_X_SPIFlashModeConfig+0x78> -400042e1: 732226 beqi a2, 2, 40004358 <_X_SPIFlashModeConfig+0x80> -400042e4: 783226 beqi a2, 3, 40004360 <_X_SPIFlashModeConfig+0x88> -400042e7: 7d4226 beqi a2, 4, 40004368 <_X_SPIFlashModeConfig+0x90> -400042ea: 050c movi.n a5, 0 -400042ec: fe6321 l32r a2, 40003c78 <_c_0x60002e00> -400042ef: 0b23f6 bgeui a3, 2, 400042fe <_X_SPIFlashModeConfig+0x26> -400042f2: f11141 l32r a4, 40000738 <_c_0x80000000> -400042f5: 0020c0 memw -400042f8: 866242 s32i a4, a2, 0x218 -400042fb: 000646 j 40004318 <_X_SPIFlashModeConfig+0x40> -400042fe: 630b addi.n a6, a3, -1 -40004300: 118640 slli a8, a6, 12 -40004303: 206680 or a6, a6, a8 -40004306: 418130 srli a8, a3, 1 -40004309: ffc882 addi a8, a8, -1 -4000430c: 1188a0 slli a8, a8, 6 -4000430f: 206680 or a6, a6, a8 -40004312: 0020c0 memw -40004315: 866262 s32i a6, a2, 0x218 -40004318: ffeeb1 l32r a11, 400042d0 <_XX_unk4238+0x98> -4000431b: 20b5b0 or a11, a5, a11 -4000431e: 0020c0 memw -40004321: 8262b2 s32i a11, a2, 0x208 -40004324: ffeca1 l32r a10, 400042d4 <_XX_unk4238+0x9c> -40004327: 0020c0 memw -4000432a: 8062a2 s32i a10, a2, 0x200 -4000432d: 0020c0 memw -40004330: 802292 l32i a9, a2, 0x200 -40004333: d98c beqz.n a9, 40004344 <_X_SPIFlashModeConfig+0x6c> -40004335: 078076 loop a0, 40004340 <_X_SPIFlashModeConfig+0x68> -40004338: 0020c0 memw -4000433b: 8022c2 l32i a12, a2, 0x200 -4000433e: 2c8c beqz.n a12, 40004344 <_X_SPIFlashModeConfig+0x6c> -40004340: fffc46 j 40004335 <_X_SPIFlashModeConfig+0x5d> -40004343: f01d00 subx8 a1, a13, a0 -40004346: 510000 excw -40004349: fe5c movi.n a14, 95 -4000434b: ffe746 j 400042ec <_X_SPIFlashModeConfig+0x14> -4000434e: 510000 excw -40004351: 46ffe1 l32r a14, 3ffd5f50 <_start-0x2a0b0> -40004354: 00ffe5 call8 40005354 <_XX_unk51ac+0x1a8> -40004357: 6a5100 depbits a0, a1, 6, 6 -4000435a: fe .byte 0xfe -4000435b: ffe346 j 400042ec <_X_SPIFlashModeConfig+0x14> -4000435e: 510000 excw -40004361: fabd excw -40004363: ffe146 j 400042ec <_X_SPIFlashModeConfig+0x14> -40004366: 510000 excw -40004369: 46f473 excw -4000436c: df .byte 0xdf -4000436d: ff .byte 0xff - ... - -40004370 <_X_spi_flash_attach>: -40004370: 004136 entry a1, 32 -40004373: 20a220 or a10, a2, a2 -40004376: ff6a65 call8 40003a1c <_X_SelectSpiFunction> -40004379: 5a0c movi.n a10, 5 -4000437b: 04a0b2 movi a11, 4 -4000437e: fff5a5 call8 400042d8 <_X_SPIFlashModeConfig> -40004381: 03bd mov.n a11, a3 -40004383: 5a0c movi.n a10, 5 -40004385: 001b25 call8 40004538 <_X_SPIReadModeConfig> -40004388: f01d retw.n - ... - -4000438c <Cache_Read_Enable>: -4000438c: 004136 entry a1, 32 -4000438f: feeda1 l32r a10, 40003f44 <_X_SPI_read_status+0x48> -40004392: 002aa2 l32i a10, a10, 0 -40004395: ffe725 call8 40004208 <_X_Wait_SPI_Idle> -40004398: 0b2c movi.n a11, 32 -4000439a: fd6c movi.n a13, -17 -4000439c: fe37c1 l32r a12, 40003c78 <_c_0x60002e00> -4000439f: f7af92 movi a9, -9 -400043a2: fbe3a1 l32r a10, 40003330 <_c_0x3feffe00> -400043a5: 0020c0 memw -400043a8: 822a82 l32i a8, a10, 0x208 -400043ab: 108890 and a8, a8, a9 -400043ae: 0020c0 memw -400043b1: 826a82 s32i a8, a10, 0x208 -400043b4: f35ef1 l32r a15, 4000112c <_c_0xfffdffff> -400043b7: 0020c0 memw -400043ba: 822ce2 l32i a14, a12, 0x208 -400043bd: 10eef0 and a14, a14, a15 -400043c0: 0020c0 memw -400043c3: 826ce2 s32i a14, a12, 0x208 -400043c6: 0020c0 memw -400043c9: 822a92 l32i a9, a10, 0x208 -400043cc: 1099d0 and a9, a9, a13 -400043cf: 0020c0 memw -400043d2: 826a92 s32i a9, a10, 0x208 -400043d5: 10a082 movi a8, 16 -400043d8: 0020c0 memw -400043db: 822af2 l32i a15, a10, 0x208 -400043de: f03d nop.n -400043e0: 20ff80 or a15, a15, a8 -400043e3: 0020c0 memw -400043e6: 826af2 s32i a15, a10, 0x208 -400043e9: 0020c0 memw -400043ec: 822ae2 l32i a14, a10, 0x208 -400043ef: 0020f0 nop -400043f2: 0eee57 bbsi a14, 5, 40004404 <Cache_Read_Enable+0x78> -400043f5: 088076 loop a0, 40004401 <Cache_Read_Enable+0x75> -400043f8: 0020c0 memw -400043fb: 822ae2 l32i a14, a10, 0x208 -400043fe: 028eb7 bany a14, a11, 40004404 <Cache_Read_Enable+0x78> -40004401: fffc06 j 400043f5 <Cache_Read_Enable+0x69> -40004404: 0020c0 memw -40004407: 822a82 l32i a8, a10, 0x208 -4000440a: 1088d0 and a8, a8, a13 -4000440d: 0020c0 memw -40004410: 826a82 s32i a8, a10, 0x208 -40004413: 7f0c movi.n a15, 7 -40004415: 0020c0 memw -40004418: 822ae2 l32i a14, a10, 0x208 -4000441b: 20eef0 or a14, a14, a15 -4000441e: 0020c0 memw -40004421: 826ae2 s32i a14, a10, 0x208 -40004424: fc41b1 l32r a11, 40003528 <_c_0x00020000> -40004427: 0020c0 memw -4000442a: 822c92 l32i a9, a12, 0x208 -4000442d: 2099b0 or a9, a9, a11 -40004430: 0020c0 memw -40004433: 826c92 s32i a9, a12, 0x208 -40004436: 880c movi.n a8, 8 -40004438: 0020c0 memw -4000443b: 822af2 l32i a15, a10, 0x208 -4000443e: 20ff80 or a15, a15, a8 -40004441: 0020c0 memw -40004444: 826af2 s32i a15, a10, 0x208 -40004447: f01d retw.n -40004449: 000000 ill - -4000444c <Cache_Read_Disable>: -4000444c: 004136 entry a1, 32 -4000444f: 052c movi.n a5, 32 -40004451: f76c movi.n a7, -17 -40004453: fe09a1 l32r a10, 40003c78 <_c_0x60002e00> -40004456: 7d7c movi.n a13, -9 -40004458: fbb641 l32r a4, 40003330 <_c_0x3feffe00> -4000445b: 0020c0 memw -4000445e: 8224c2 l32i a12, a4, 0x208 -40004461: 10ccd0 and a12, a12, a13 -40004464: 0020c0 memw -40004467: 8264c2 s32i a12, a4, 0x208 -4000446a: f330b1 l32r a11, 4000112c <_c_0xfffdffff> -4000446d: 0020c0 memw -40004470: 822a92 l32i a9, a10, 0x208 -40004473: 1099b0 and a9, a9, a11 -40004476: 0020c0 memw -40004479: 826a92 s32i a9, a10, 0x208 -4000447c: 0020c0 memw -4000447f: 822482 l32i a8, a4, 0x208 -40004482: 108870 and a8, a8, a7 -40004485: 0020c0 memw -40004488: 826482 s32i a8, a4, 0x208 -4000448b: 061c movi.n a6, 16 -4000448d: 0020c0 memw -40004490: 822432 l32i a3, a4, 0x208 -40004493: 203360 or a3, a3, a6 -40004496: 0020c0 memw -40004499: 826432 s32i a3, a4, 0x208 -4000449c: 0020c0 memw -4000449f: 822422 l32i a2, a4, 0x208 -400044a2: 0ee257 bbsi a2, 5, 400044b4 <Cache_Read_Disable+0x68> -400044a5: 088076 loop a0, 400044b1 <Cache_Read_Disable+0x65> -400044a8: 0020c0 memw -400044ab: 8224e2 l32i a14, a4, 0x208 -400044ae: 028e57 bany a14, a5, 400044b4 <Cache_Read_Disable+0x68> -400044b1: fffc06 j 400044a5 <Cache_Read_Disable+0x59> -400044b4: 0020c0 memw -400044b7: 8224f2 l32i a15, a4, 0x208 -400044ba: 10ff70 and a15, a15, a7 -400044bd: 0020c0 memw -400044c0: 8264f2 s32i a15, a4, 0x208 -400044c3: f01d retw.n -400044c5: 000000 ill -400044c8: 006136 entry a1, 48 -400044cb: fe9e21 l32r a2, 40003f44 <_X_SPI_read_status+0x48> -400044ce: 01bd mov.n a11, a1 -400044d0: 0022a2 l32i a10, a2, 0 -400044d3: ffa825 call8 40003f54 <_XX_unk3f54> -400044d6: 2a8c beqz.n a10, 400044dc <Cache_Read_Disable+0x90> -400044d8: 120c movi.n a2, 1 -400044da: f01d retw.n -400044dc: 02a8 l32i.n a10, a2, 0 -400044de: ffcde5 call8 400041bc <_X_SPI_write_enable> -400044e1: ff3a56 bnez a10, 400044d8 <Cache_Read_Disable+0x8c> -400044e4: 02a8 l32i.n a10, a2, 0 -400044e6: 0021b2 l32i a11, a1, 0 -400044e9: ffae65 call8 40003fd0 <_c_0x04000000+0x4> -400044ec: fe8a56 bnez a10, 400044d8 <Cache_Read_Disable+0x8c> -400044ef: 020c movi.n a2, 0 -400044f1: f01d retw.n -400044f3: 613600 excw -400044f6: 932100 movnez a2, a1, a0 -400044f9: fe .byte 0xfe -400044fa: 01bd mov.n a11, a1 -400044fc: 0022a2 l32i a10, a2, 0 -400044ff: ffa565 call8 40003f54 <_XX_unk3f54> -40004502: 2a8c beqz.n a10, 40004508 <Cache_Read_Disable+0xbc> -40004504: 120c movi.n a2, 1 -40004506: f01d retw.n -40004508: 02a8 l32i.n a10, a2, 0 -4000450a: ffcb25 call8 400041bc <_X_SPI_write_enable> -4000450d: ff3a56 bnez a10, 40004504 <Cache_Read_Disable+0xb8> -40004510: 02a8 l32i.n a10, a2, 0 -40004512: 01b8 l32i.n a11, a1, 0 -40004514: cc1c movi.n a12, 28 -40004516: 20bbc0 or a11, a11, a12 -40004519: ffab65 call8 40003fd0 <_c_0x04000000+0x4> -4000451c: fe4a56 bnez a10, 40004504 <Cache_Read_Disable+0xb8> -4000451f: 020c movi.n a2, 0 -40004521: f01d retw.n -40004523: 9fff00 excw -40004526: 6f .byte 0x6f -40004527: fe .byte 0xfe -40004528: 002000 isync -4000452b: 200001 l32r a0, 3ffcc52c <_start-0x33ad4> -4000452e: 000010 excw -40004531: 008020 any4 b2, b0:b1:b2:b3 -40004534: 006000 rsil a0, 0 - ... - -40004538 <_X_SPIReadModeConfig>: -40004538: 004136 entry a1, 32 -4000453b: fffa91 l32r a9, 40004524 <Cache_Read_Disable+0xd8> -4000453e: fe81a1 l32r a10, 40003f44 <_X_SPI_read_status+0x48> -40004541: fdcd51 l32r a5, 40003c78 <_c_0x60002e00> -40004544: 0020c0 memw -40004547: 822582 l32i a8, a5, 0x208 -4000454a: f03d nop.n -4000454c: 108890 and a8, a8, a9 -4000454f: 0020c0 memw -40004552: 826582 s32i a8, a5, 0x208 -40004555: c2ac beqz.n a2, 40004585 <_X_SPIReadModeConfig+0x4d> -40004557: 451226 beqi a2, 1, 400045a0 <_X_SPIReadModeConfig+0x68> -4000455a: 4a2226 beqi a2, 2, 400045a8 <_X_SPIReadModeConfig+0x70> -4000455d: 4f3226 beqi a2, 3, 400045b0 <_X_SPIReadModeConfig+0x78> -40004560: 544226 beqi a2, 4, 400045b8 <_X_SPIReadModeConfig+0x80> -40004563: 040c movi.n a4, 0 -40004565: 1f1226 beqi a2, 1, 40004588 <_X_SPIReadModeConfig+0x50> -40004568: 438c beqz.n a3, 40004570 <_X_SPIReadModeConfig+0x38> -4000456a: 002aa2 l32i a10, a10, 0 -4000456d: ffd125 call8 40004280 <_XX_unk4238+0x48> -40004570: 0020c0 memw -40004573: 8225a2 l32i a10, a5, 0x208 -40004576: 20aa40 or a10, a10, a4 -40004579: 0020c0 memw -4000457c: 8265a2 s32i a10, a5, 0x208 -4000457f: 020c movi.n a2, 0 -40004581: f01d retw.n -40004583: 410000 srli a0, a0, 0 -40004586: ffe8 l32i.n a14, a15, 60 -40004588: 0aa8 l32i.n a10, a10, 0 -4000458a: ffcae5 call8 40004238 <_XX_unk4238> -4000458d: 0020c0 memw -40004590: 8225b2 l32i a11, a5, 0x208 -40004593: 20bb40 or a11, a11, a4 -40004596: 0020c0 memw -40004599: 8265b2 s32i a11, a5, 0x208 -4000459c: 020c movi.n a2, 0 -4000459e: f01d retw.n -400045a0: ffe341 l32r a4, 4000452c <Cache_Read_Disable+0xe0> -400045a3: ffef86 j 40004565 <_X_SPIReadModeConfig+0x2d> -400045a6: 410000 srli a0, a0, 0 -400045a9: 86ffe2 s32ri a14, a15, 0x218 -400045ac: ffed excw -400045ae: 410000 srli a0, a0, 0 -400045b1: 86ffe1 l32r a14, 3ffe61b0 <_start-0x19e50> -400045b4: ffeb addi.n a15, a15, 14 -400045b6: 410000 srli a0, a0, 0 -400045b9: df .byte 0xdf -400045ba: e986f3 excw -400045bd: ff .byte 0xff -400045be: 360000 excw -400045c1: a10041 l32r a4, 3ffec9c4 <_start-0x1363c> -400045c4: a2fe60 muluh a15, a14, a6 -400045c7: 002a add.n a0, a0, a2 -400045c9: ffc3e5 call8 40004208 <_X_Wait_SPI_Idle> -400045cc: ffd6c1 l32r a12, 40004524 <Cache_Read_Disable+0xd8> -400045cf: fdaaa1 l32r a10, 40003c78 <_c_0x60002e00> -400045d2: 0020c0 memw -400045d5: 822ab2 l32i a11, a10, 0x208 -400045d8: 10bbc0 and a11, a11, a12 -400045db: 0020c0 memw -400045de: 826ab2 s32i a11, a10, 0x208 -400045e1: 32bc beqz.n a2, 40004618 <_X_SPIReadModeConfig+0xe0> -400045e3: 491226 beqi a2, 1, 40004630 <_X_SPIReadModeConfig+0xf8> -400045e6: 5e2226 beqi a2, 2, 40004648 <_X_SPIReadModeConfig+0x110> -400045e9: 733226 beqi a2, 3, 40004660 <_X_SPIReadModeConfig+0x128> -400045ec: 104226 beqi a2, 4, 40004600 <_X_SPIReadModeConfig+0xc8> -400045ef: 0020c0 memw -400045f2: 822ad2 l32i a13, a10, 0x208 -400045f5: 0020c0 memw -400045f8: 826ad2 s32i a13, a10, 0x208 -400045fb: 020c movi.n a2, 0 -400045fd: f01d retw.n -400045ff: cdf100 excw -40004602: 20c0f3 excw -40004605: 2ae200 depbits a0, a2, 2, 15 -40004608: eef082 s32ri a8, a0, 0x3b8 -4000460b: 20c020 or a12, a0, a2 -4000460e: 6ae200 depbits a0, a2, 6, 15 -40004611: 020c82 l8ui a8, a12, 2 -40004614: f01d retw.n -40004616: 910000 srl a0, a0 -40004619: c0ffc4 excw -4000461c: 220020 orb b0, b0, b2 -4000461f: 822a add.n a8, a2, a2 -40004621: 202290 or a2, a2, a9 -40004624: 0020c0 memw -40004627: 826a22 s32i a2, a10, 0x208 -4000462a: 020c movi.n a2, 0 -4000462c: f01d retw.n -4000462e: 910000 srl a0, a0 -40004631: bf .byte 0xbf -40004632: ff .byte 0xff -40004633: 0020c0 memw -40004636: 822a82 l32i a8, a10, 0x208 -40004639: 208890 or a8, a8, a9 -4000463c: 0020c0 memw -4000463f: 826a82 s32i a8, a10, 0x208 -40004642: 020c movi.n a2, 0 -40004644: f01d retw.n -40004646: c10000 mul16u a0, a0, a0 -40004649: ffba add.n a15, a15, a11 -4000464b: 0020c0 memw -4000464e: 822ab2 l32i a11, a10, 0x208 -40004651: 20bbc0 or a11, a11, a12 -40004654: 0020c0 memw -40004657: 826ab2 s32i a11, a10, 0x208 -4000465a: 020c movi.n a2, 0 -4000465c: f01d retw.n -4000465e: 910000 srl a0, a0 -40004661: c0ffb5 call12 3ffc565c <_start-0x3a9a4> -40004664: 220020 orb b0, b0, b2 -40004667: 822a add.n a8, a2, a2 -40004669: 202290 or a2, a2, a9 -4000466c: 0020c0 memw -4000466f: 826a22 s32i a2, a10, 0x208 -40004672: 020c movi.n a2, 0 -40004674: f01d retw.n -40004676: 360000 excw -40004679: a10041 l32r a4, 3ffeca7c <_start-0x13584> -4000467c: a2fe32 s32ri a3, a14, 0x288 -4000467f: 002a add.n a0, a0, a2 -40004681: ffb865 call8 40004208 <_X_Wait_SPI_Idle> -40004684: fd7d91 l32r a9, 40003c78 <_c_0x60002e00> -40004687: 0d22f6 bgeui a2, 2, 40004698 <_X_SPIReadModeConfig+0x160> -4000468a: f02bb1 l32r a11, 40000738 <_c_0x80000000> -4000468d: 0020c0 memw -40004690: 8669b2 s32i a11, a9, 0x218 -40004693: 020c movi.n a2, 0 -40004695: f01d retw.n -40004697: c20b00 quou a0, a11, a0 -4000469a: 11dc40 slli a13, a12, 12 -4000469d: 20ccd0 or a12, a12, a13 -400046a0: 41d120 srli a13, a2, 1 -400046a3: dd0b addi.n a13, a13, -1 -400046a5: 11dda0 slli a13, a13, 6 -400046a8: 20ccd0 or a12, a12, a13 -400046ab: 0020c0 memw -400046ae: 8669c2 s32i a12, a9, 0x218 -400046b1: 020c movi.n a2, 0 -400046b3: f01d retw.n -400046b5: 000000 ill -400046b8: 004136 entry a1, 32 -400046bb: fe2221 l32r a2, 40003f44 <_X_SPI_read_status+0x48> -400046be: f03d nop.n -400046c0: 0022a2 l32i a10, a2, 0 -400046c3: ffafa5 call8 400041bc <_X_SPI_write_enable> -400046c6: 2a8c beqz.n a10, 400046cc <_X_SPIReadModeConfig+0x194> -400046c8: 120c movi.n a2, 1 -400046ca: f01d retw.n -400046cc: 02a8 l32i.n a10, a2, 0 -400046ce: ff5ae5 call8 40003c7c <_X_SPI_chip_erase> -400046d1: ff3a56 bnez a10, 400046c8 <_X_SPIReadModeConfig+0x190> -400046d4: 020c movi.n a2, 0 -400046d6: f01d retw.n -400046d8: 004136 entry a1, 32 -400046db: fe1a31 l32r a3, 40003f44 <_X_SPI_read_status+0x48> -400046de: 03a8 l32i.n a10, a3, 0 -400046e0: 2a98 l32i.n a9, a10, 8 -400046e2: 1a88 l32i.n a8, a10, 4 -400046e4: c28890 quou a8, a8, a9 -400046e7: 063287 bltu a2, a8, 400046f1 <_X_SPIReadModeConfig+0x1b9> -400046ea: 120c movi.n a2, 1 -400046ec: f01d retw.n -400046ee: 000000 ill -400046f1: ffaca5 call8 400041bc <_X_SPI_write_enable> -400046f4: ff2a56 bnez a10, 400046ea <_X_SPIReadModeConfig+0x1b2> -400046f7: 03a8 l32i.n a10, a3, 0 -400046f9: 2ab8 l32i.n a11, a10, 8 -400046fb: 82bb20 mull a11, a11, a2 -400046fe: ff6065 call8 40003d04 <_c_0x00800000+0x4> -40004701: fe5a56 bnez a10, 400046ea <_X_SPIReadModeConfig+0x1b2> -40004704: 020c movi.n a2, 0 -40004706: f01d retw.n - -40004708 <SPIEraseSector>: -40004708: 004136 entry a1, 32 -4000470b: fe0e31 l32r a3, 40003f44 <_X_SPI_read_status+0x48> -4000470e: 03a8 l32i.n a10, a3, 0 -40004710: 3a98 l32i.n a9, a10, 12 -40004712: 1a88 l32i.n a8, a10, 4 -40004714: c28890 quou a8, a8, a9 -40004717: 063287 bltu a2, a8, 40004721 <SPIEraseSector+0x19> -4000471a: 120c movi.n a2, 1 -4000471c: f01d retw.n -4000471e: 000000 ill -40004721: ffa9a5 call8 400041bc <_X_SPI_write_enable> -40004724: ff2a56 bnez a10, 4000471a <SPIEraseSector+0x12> -40004727: 03a8 l32i.n a10, a3, 0 -40004729: 3ab8 l32i.n a11, a10, 12 -4000472b: 82bb20 mull a11, a11, a2 -4000472e: ff58e5 call8 40003cbc <_XX_unk3cbc> -40004731: fe5a56 bnez a10, 4000471a <SPIEraseSector+0x12> -40004734: 020c movi.n a2, 0 -40004736: f01d retw.n - -40004738 <SPIWrite>: -40004738: 006136 entry a1, 48 -4000473b: fe02c1 l32r a12, 40003f44 <_X_SPI_read_status+0x48> -4000473e: 046d mov.n a6, a4 -40004740: 0ca8 l32i.n a10, a12, 0 -40004742: 942a add.n a9, a4, a2 -40004744: 1a88 l32i.n a8, a10, 4 -40004746: 4a78 l32i.n a7, a10, 16 -40004748: 143897 bltu a8, a9, 40004760 <SPIWrite+0x28> -4000474b: e25270 remu a5, a2, a7 -4000474e: c05750 sub a5, a7, a5 -40004751: 0fb457 bgeu a4, a5, 40004764 <SPIWrite+0x2c> -40004754: 04dd mov.n a13, a4 -40004756: 03cd mov.n a12, a3 -40004758: 02bd mov.n a11, a2 -4000475a: ff5f65 call8 40003d50 <_c_0x02000000+0x4> -4000475d: 05fa16 beqz a10, 400047c0 <SPIWrite+0x88> -40004760: 120c movi.n a2, 1 -40004762: f01d retw.n -40004764: 02bd mov.n a11, a2 -40004766: 03cd mov.n a12, a3 -40004768: 05dd mov.n a13, a5 -4000476a: ff5e65 call8 40003d50 <_c_0x02000000+0x4> -4000476d: fefa56 bnez a10, 40004760 <SPIWrite+0x28> -40004770: 0129 s32i.n a2, a1, 0 -40004772: 1169 s32i.n a6, a1, 4 -40004774: c04650 sub a4, a6, a5 -40004777: c24470 quou a4, a4, a7 -4000477a: 74ac beqz.n a4, 400047a5 <SPIWrite+0x6d> -4000477c: 806520 add a6, a5, a2 -4000477f: 00a022 movi a2, 0 -40004782: 06bd mov.n a11, a6 -40004784: 07dd mov.n a13, a7 -40004786: fdefa1 l32r a10, 40003f44 <_X_SPI_read_status+0x48> -40004789: 41c250 srli a12, a5, 2 -4000478c: a0cc30 addx4 a12, a12, a3 -4000478f: 002aa2 l32i a10, a10, 0 -40004792: ff5be5 call8 40003d50 <_c_0x02000000+0x4> -40004795: fc7a56 bnez a10, 40004760 <SPIWrite+0x28> -40004798: 667a add.n a6, a6, a7 -4000479a: 575a add.n a5, a7, a5 -4000479c: 01c222 addi a2, a2, 1 -4000479f: 742020 extui a2, a2, 0, 8 -400047a2: dc9427 bne a4, a2, 40004782 <SPIWrite+0x4a> -400047a5: fde7a1 l32r a10, 40003f44 <_X_SPI_read_status+0x48> -400047a8: 11d8 l32i.n a13, a1, 4 -400047aa: 01b8 l32i.n a11, a1, 0 -400047ac: 41c250 srli a12, a5, 2 -400047af: a0cc30 addx4 a12, a12, a3 -400047b2: bb5a add.n a11, a11, a5 -400047b4: c0dd50 sub a13, a13, a5 -400047b7: 002aa2 l32i a10, a10, 0 -400047ba: ff5965 call8 40003d50 <_c_0x02000000+0x4> -400047bd: f9fa56 bnez a10, 40004760 <SPIWrite+0x28> -400047c0: 020c movi.n a2, 0 -400047c2: f01d retw.n -400047c4: 011000 slli a1, a0, 32 -400047c7: 413600 srli a3, a0, 6 -400047ca: fe4100 excw -400047cd: ff .byte 0xff -400047ce: fad831 l32r a3, 40003330 <_c_0x3feffe00> -400047d1: 0020c0 memw -400047d4: 9a2322 l32i a2, a3, 0x268 -400047d7: 202240 or a2, a2, a4 -400047da: 0020c0 memw -400047dd: 9a6322 s32i a2, a3, 0x268 -400047e0: f01d retw.n -400047e2: 000000 ill -400047e5: ae .byte 0xae -400047e6: 366001 l32r a0, 3ffd2168 <_start-0x2de98> -400047e9: 4d0041 l32r a4, 3ffd7bec <_start-0x28414> -400047ec: f51c03 excw -400047ef: 458527 bany a5, a2, 40004838 <SPIWrite+0x100> -400047f2: fffc61 l32r a6, 400047e4 <SPIWrite+0xac> -400047f5: 0020c0 memw -400047f8: 896622 s32i a2, a6, 0x224 -400047fb: 08a032 movi a3, 8 -400047fe: 00a022 movi a2, 0 -40004801: 0ea376 loopgtz a3, 40004813 <SPIWrite+0xdb> -40004804: a03260 addx4 a3, a2, a6 -40004807: 0458 l32i.n a5, a4, 0 -40004809: 0020c0 memw -4000480c: 806352 s32i a5, a3, 0x200 -4000480f: 444b addi.n a4, a4, 4 -40004811: 221b addi.n a2, a2, 1 -40004813: 01a0a2 movi a10, 1 -40004816: 0020c0 memw -40004819: 8866a2 s32i a10, a6, 0x220 -4000481c: 0020c0 memw -4000481f: 882692 l32i a9, a6, 0x220 -40004822: 0ee907 bbsi a9, 0, 40004834 <SPIWrite+0xfc> -40004825: 088076 loop a0, 40004831 <SPIWrite+0xf9> -40004828: 0020c0 memw -4000482b: 8826b2 l32i a11, a6, 0x220 -4000482e: 02eb07 bbsi a11, 0, 40004834 <SPIWrite+0xfc> -40004831: fffc06 j 40004825 <SPIWrite+0xed> -40004834: 020c movi.n a2, 0 -40004836: f01d retw.n -40004838: 120c movi.n a2, 1 -4000483a: f01d retw.n -4000483c: ff .byte 0xff -4000483d: ef .byte 0xef -4000483e: fe .byte 0xfe -4000483f: ff .byte 0xff -40004840: 004136 entry a1, 32 -40004843: fffe41 l32r a4, 4000483c <SPIWrite+0x104> -40004846: faba31 l32r a3, 40003330 <_c_0x3feffe00> -40004849: 0020c0 memw -4000484c: 9a2322 l32i a2, a3, 0x268 -4000484f: 102240 and a2, a2, a4 -40004852: 0020c0 memw -40004855: 9a6322 s32i a2, a3, 0x268 -40004858: f01d retw.n -4000485a: 360000 excw -4000485d: 1c0041 l32r a4, 3ffcb860 <_start-0x347a0> -40004860: 20fa add.n a2, a0, a15 -40004862: cc4480 excw -40004865: 4718 l32i.n a1, a7, 16 -40004867: 030a add.n a0, a3, a0 -40004869: 120c movi.n a2, 1 -4000486b: f01d retw.n -4000486d: fff5a5 call8 400047c8 <SPIWrite+0x90> -40004870: 415540 srli a5, a4, 5 -40004873: a59c beqz.n a5, 40004891 <SPIWrite+0x159> -40004875: 00a042 movi a4, 0 -40004878: 02ad mov.n a10, a2 -4000487a: 11b4d0 slli a11, a4, 3 -4000487d: a0bb30 addx4 a11, a11, a3 -40004880: fff665 call8 400047e8 <SPIWrite+0xb0> -40004883: 02ad mov.n a10, a2 -40004885: 03bd mov.n a11, a3 -40004887: 0c2c movi.n a12, 32 -40004889: ffeae5 call8 40004738 <SPIWrite> -4000488c: 441b addi.n a4, a4, 1 -4000488e: e69457 bne a4, a5, 40004878 <SPIWrite+0x140> -40004891: fffae5 call8 40004840 <SPIWrite+0x108> -40004894: f01d retw.n - ... - -40004898 <SPIRead>: -40004898: 004136 entry a1, 32 -4000489b: 04dd mov.n a13, a4 -4000489d: 03cd mov.n a12, a3 -4000489f: fda9a1 l32r a10, 40003f44 <_X_SPI_read_status+0x48> -400048a2: 02bd mov.n a11, a2 -400048a4: 0aa8 l32i.n a10, a10, 0 -400048a6: ff57e5 call8 40003e24 <_XX_unk3e24> -400048a9: 3a8c beqz.n a10, 400048b0 <SPIRead+0x18> -400048ab: 120c movi.n a2, 1 -400048ad: f01d retw.n -400048af: 020c00 andb b0, b12, b0 -400048b2: f01d retw.n - -400048b4 <_X_SPIEraseArea>: -400048b4: 004136 entry a1, 32 -400048b7: 05a0a2 movi a10, 5 -400048ba: 01a0b2 movi a11, 1 -400048bd: ffc7a5 call8 40004538 <_X_SPIReadModeConfig> -400048c0: fda141 l32r a4, 40003f44 <_X_SPI_read_status+0x48> -400048c3: 04a8 l32i.n a10, a4, 0 -400048c5: 923a add.n a9, a2, a3 -400048c7: 1a88 l32i.n a8, a10, 4 -400048c9: 3ab8 l32i.n a11, a10, 12 -400048cb: 053897 bltu a8, a9, 400048d4 <_X_SPIEraseArea+0x20> -400048ce: e2b2b0 remu a11, a2, a11 -400048d1: 004b16 beqz a11, 400048d9 <_X_SPIEraseArea+0x25> -400048d4: 120c movi.n a2, 1 -400048d6: f01d retw.n -400048d8: bee500 excw -400048db: ff .byte 0xff -400048dc: ff4a56 bnez a10, 400048d4 <_X_SPIEraseArea+0x20> -400048df: 0448 l32i.n a4, a4, 0 -400048e1: 3488 l32i.n a8, a4, 12 -400048e3: 2448 l32i.n a4, a4, 8 -400048e5: c29380 quou a9, a3, a8 -400048e8: e2c380 remu a12, a3, a8 -400048eb: c22280 quou a2, a2, a8 -400048ee: c24480 quou a4, a4, a8 -400048f1: e25240 remu a5, a2, a4 -400048f4: 1c8c beqz.n a12, 400048f9 <_X_SPIEraseArea+0x45> -400048f6: 01c992 addi a9, a9, 1 -400048f9: c05450 sub a5, a4, a5 -400048fc: 435950 min a5, a9, a5 -400048ff: c03950 sub a3, a9, a5 -40004902: e58c beqz.n a5, 40004914 <_X_SPIEraseArea+0x60> -40004904: 02ad mov.n a10, a2 -40004906: ffe025 call8 40004708 <SPIEraseSector> -40004909: fc7a56 bnez a10, 400048d4 <_X_SPIEraseArea+0x20> -4000490c: 221b addi.n a2, a2, 1 -4000490e: ffc552 addi a5, a5, -1 -40004911: fef556 bnez a5, 40004904 <_X_SPIEraseArea+0x50> -40004914: 11b437 bgeu a4, a3, 40004929 <_X_SPIEraseArea+0x75> -40004917: c2a240 quou a10, a2, a4 -4000491a: ffdbe5 call8 400046d8 <_X_SPIReadModeConfig+0x1a0> -4000491d: fb3a56 bnez a10, 400048d4 <_X_SPIEraseArea+0x20> -40004920: 802240 add a2, a2, a4 -40004923: c03340 sub a3, a3, a4 -40004926: ed3437 bltu a4, a3, 40004917 <_X_SPIEraseArea+0x63> -40004929: 0f13a6 blti a3, 1, 4000493c <_X_SPIEraseArea+0x88> -4000492c: 02ad mov.n a10, a2 -4000492e: ffdda5 call8 40004708 <SPIEraseSector> -40004931: f9fa56 bnez a10, 400048d4 <_X_SPIEraseArea+0x20> -40004934: 221b addi.n a2, a2, 1 -40004936: ffc332 addi a3, a3, -1 -40004939: fef356 bnez a3, 4000492c <_X_SPIEraseArea+0x78> -4000493c: 020c movi.n a2, 0 -4000493e: f01d retw.n - -40004940 <_XX_unk4940>: -40004940: 004136 entry a1, 32 -40004943: fd8081 l32r a8, 40003f44 <_X_SPI_read_status+0x48> -40004946: 0888 l32i.n a8, a8, 0 -40004948: 1839 s32i.n a3, a8, 4 -4000494a: 2849 s32i.n a4, a8, 8 -4000494c: 3859 s32i.n a5, a8, 12 -4000494e: 4869 s32i.n a6, a8, 16 -40004950: 0829 s32i.n a2, a8, 0 -40004952: 5879 s32i.n a7, a8, 20 -40004954: 020c movi.n a2, 0 -40004956: f01d retw.n -40004958: 4bac beqz.n a11, 40004980 <_XX_unk4940+0x40> -4000495a: 884000 excw -4000495d: 600040 neg a0, a4 -40004960: 4128 l32i.n a2, a1, 16 -40004962: 506000 witlb a0, a0 -40004965: ffdc bnez.n a15, 40004988 <_XX_unk4940+0x48> -40004967: 3f .byte 0x3f -40004968: 004136 entry a1, 32 -4000496b: 04a0a2 movi a10, 4 -4000496e: fffab1 l32r a11, 40004958 <_XX_unk4940+0x18> -40004971: 00a0c2 movi a12, 0 -40004974: fc7725 call8 400010e8 <_X_ets_isr_attach> -40004977: 10a0a2 movi a10, 16 -4000497a: fc77e5 call8 400010f8 <_X_ets_isr_mask> -4000497d: 0a0c movi.n a10, 0 -4000497f: 0b0c movi.n a11, 0 -40004981: 0c0c movi.n a12, 0 -40004983: fd7c movi.n a13, -1 -40004985: 000525 call8 400049d8 <gpio_output_set> -40004988: 0a0c movi.n a10, 0 -4000498a: 0b0c movi.n a11, 0 -4000498c: 0c0c movi.n a12, 0 -4000498e: ffa0d2 movi a13, 255 -40004991: 000665 call8 400049f8 <gpio_output_set_high> -40004994: fff221 l32r a2, 4000495c <_XX_unk4940+0x1c> -40004997: f1e631 l32r a3, 40001130 <_c_0x60003e00> -4000499a: fff151 l32r a5, 40004960 <_XX_unk4940+0x20> -4000499d: fff141 l32r a4, 40004964 <_XX_unk4940+0x24> -400049a0: 080c movi.n a8, 0 -400049a2: 0489 s32i.n a8, a4, 0 -400049a4: 1489 s32i.n a8, a4, 4 -400049a6: 02ad mov.n a10, a2 -400049a8: 0b0c movi.n a11, 0 -400049aa: 000925 call8 40004a3c <gpio_output_set_high+0x44> -400049ad: 0020c0 memw -400049b0: 224b addi.n a2, a2, 4 -400049b2: 441b addi.n a4, a4, 1 -400049b4: a22392 l32i a9, a3, 0x288 -400049b7: 334b addi.n a3, a3, 4 -400049b9: 249790 extui a9, a9, 7, 3 -400049bc: 0f4492 s8i a9, a4, 15 -400049bf: e39257 bne a2, a5, 400049a6 <_XX_unk4940+0x66> -400049c2: fc7c movi.n a12, -1 -400049c4: f1dbb1 l32r a11, 40001130 <_c_0x60003e00> -400049c7: 0020c0 memw -400049ca: 936bc2 s32i a12, a11, 0x24c -400049cd: ffa0a2 movi a10, 255 -400049d0: 0020c0 memw -400049d3: 966ba2 s32i a10, a11, 0x258 -400049d6: f01d retw.n - -400049d8 <gpio_output_set>: -400049d8: 004136 entry a1, 32 -400049db: f1d561 l32r a6, 40001130 <_c_0x60003e00> -400049de: 0020c0 memw -400049e1: 826622 s32i a2, a6, 0x208 -400049e4: 0020c0 memw -400049e7: 836632 s32i a3, a6, 0x20c -400049ea: 0020c0 memw -400049ed: 896642 s32i a4, a6, 0x224 -400049f0: 0020c0 memw -400049f3: 8a6652 s32i a5, a6, 0x228 -400049f6: f01d retw.n - -400049f8 <gpio_output_set_high>: -400049f8: 004136 entry a1, 32 -400049fb: f1cd61 l32r a6, 40001130 <_c_0x60003e00> -400049fe: 0020c0 memw -40004a01: 856622 s32i a2, a6, 0x214 -40004a04: 0020c0 memw -40004a07: 866632 s32i a3, a6, 0x218 -40004a0a: 0020c0 memw -40004a0d: 8c6642 s32i a4, a6, 0x230 -40004a10: 0020c0 memw -40004a13: 8d6652 s32i a5, a6, 0x234 -40004a16: f01d retw.n -40004a18: 004136 entry a1, 32 -40004a1b: f1c521 l32r a2, 40001130 <_c_0x60003e00> -40004a1e: 0020c0 memw -40004a21: 8f2222 l32i a2, a2, 0x23c -40004a24: f01d retw.n -40004a26: 360000 excw -40004a29: 210041 l32r a4, 3ffcce2c <_start-0x331d4> -40004a2c: c0f1c1 l32r a12, 3fff4df0 <_start-0xb210> -40004a2f: 220020 orb b0, b0, b2 -40004a32: 1d9022 l16si a2, a0, 58 -40004a35: 0000f0 callx12 a0 -40004a38: ffdc60 excw -40004a3b: 3f .byte 0x3f -40004a3c: 004136 entry a1, 32 -40004a3f: fc66a5 call8 400010a8 <_X_ets_enter_critical> -40004a42: ffc6a1 l32r a10, 4000495c <_XX_unk4940+0x1c> -40004a45: 1192e0 slli a9, a2, 2 -40004a48: 8099a0 add a9, a9, a10 -40004a4b: 0020c0 memw -40004a4e: 006932 s32i a3, a9, 0 -40004a51: 27a082 movi a8, 39 -40004a54: 3e3827 bltu a8, a2, 40004a96 <gpio_output_set_high+0x9e> -40004a57: fff8a1 l32r a10, 40004a38 <gpio_output_set_high+0x40> -40004a5a: 24b730 extui a11, a3, 7, 3 -40004a5d: c2aa add.n a12, a2, a10 -40004a5f: 004cb2 s8i a11, a12, 0 -40004a62: 0bfc bnez.n a11, 40004a96 <gpio_output_set_high+0x9e> -40004a64: 1c0c movi.n a12, 1 -40004a66: fb7c movi.n a11, -1 -40004a68: f0caa2 addi a10, a10, -16 -40004a6b: 12c2f6 bgeui a2, 32, 40004a81 <gpio_output_set_high+0x89> -40004a6e: 0ad8 l32i.n a13, a10, 0 -40004a70: 401200 ssl a2 -40004a73: a1ec00 sll a14, a12 -40004a76: 30eeb0 xor a14, a14, a11 -40004a79: 10dde0 and a13, a13, a14 -40004a7c: 0ad9 s32i.n a13, a10, 0 -40004a7e: 000506 j 40004a96 <gpio_output_set_high+0x9e> -40004a81: 012af2 l32i a15, a10, 4 -40004a84: e0c292 addi a9, a2, -32 -40004a87: 401900 ssl a9 -40004a8a: a18c00 sll a8, a12 -40004a8d: 3088b0 xor a8, a8, a11 -40004a90: 10ff80 and a15, a15, a8 -40004a93: 016af2 s32i a15, a10, 4 -40004a96: fc6265 call8 400010bc <_X_ets_exit_critical> -40004a99: 000090 retw -40004a9c: 004136 entry a1, 32 -40004a9f: ffaf81 l32r a8, 4000495c <_XX_unk4940+0x1c> -40004aa2: 1152e0 slli a5, a2, 2 -40004aa5: 558a add.n a5, a5, a8 -40004aa7: 0020c0 memw -40004aaa: 0558 l32i.n a5, a5, 0 -40004aac: 732c movi.n a3, 39 -40004aae: 163327 bltu a3, a2, 40004ac8 <gpio_output_set_high+0xd0> -40004ab1: ffe131 l32r a3, 40004a38 <gpio_output_set_high+0x40> -40004ab4: 223a add.n a2, a2, a3 -40004ab6: 000222 l8ui a2, a2, 0 -40004ab9: 7fac32 movi a3, 0xfffffc7f -40004abc: 103530 and a3, a5, a3 -40004abf: 112290 slli a2, a2, 7 -40004ac2: 202230 or a2, a2, a3 -40004ac5: f01d retw.n -40004ac7: 052d00 extui a2, a0, 29, 1 -40004aca: f01d retw.n -40004acc: 004136 entry a1, 32 -40004acf: ffa521 l32r a2, 40004964 <_XX_unk4940+0x24> -40004ad2: 0228 l32i.n a2, a2, 0 -40004ad4: f01d retw.n -40004ad6: 360000 excw -40004ad9: 210041 l32r a4, 3ffccedc <_start-0x33124> -40004adc: 28ffa2 s32ri a10, a15, 160 -40004adf: f01d12 l16ui a1, a13, 0x1e0 -40004ae2: 360000 excw -40004ae5: 250041 l32r a4, 3ffcdee8 <_start-0x32118> -40004ae8: fc5c movi.n a12, 95 -40004aea: f19191 l32r a9, 40001130 <_c_0x60003e00> -40004aed: a09290 addx4 a9, a2, a9 -40004af0: 0020c0 memw -40004af3: 7facb2 movi a11, 0xfffffc7f -40004af6: a22982 l32i a8, a9, 0x288 -40004af9: 11a390 slli a10, a3, 7 -40004afc: 1088b0 and a8, a8, a11 -40004aff: 2088a0 or a8, a8, a10 -40004b02: 0020c0 memw -40004b05: a26982 s32i a8, a9, 0x288 -40004b08: fc5b25 call8 400010bc <_X_ets_exit_critical> -40004b0b: f01d retw.n -40004b0d: 000000 ill -40004b10: 004136 entry a1, 32 -40004b13: fc5965 call8 400010a8 <_X_ets_enter_critical> -40004b16: ff93b1 l32r a11, 40004964 <_XX_unk4940+0x24> -40004b19: ffaf92 movi a9, -1 -40004b1c: 002b82 l32i a8, a11, 0 -40004b1f: 309290 xor a9, a2, a9 -40004b22: 10a890 and a10, a8, a9 -40004b25: 006ba2 s32i a10, a11, 0 -40004b28: 0c0897 bnone a8, a9, 40004b38 <gpio_output_set_high+0x140> -40004b2b: f181d1 l32r a13, 40001130 <_c_0x60003e00> -40004b2e: 0020c0 memw -40004b31: 926da2 s32i a10, a13, 0x248 -40004b34: 0c0c movi.n a12, 0 -40004b36: 0bc9 s32i.n a12, a11, 0 -40004b38: ffc041 l32r a4, 40004a38 <gpio_output_set_high+0x40> -40004b3b: 030c movi.n a3, 0 -40004b3d: 075237 bbc a2, a3, 40004b48 <gpio_output_set_high+0x150> -40004b40: 03ad mov.n a10, a3 -40004b42: 0004b2 l8ui a11, a4, 0 -40004b45: fff9e5 call8 40004ae4 <gpio_output_set_high+0xec> -40004b48: 01c442 addi a4, a4, 1 -40004b4b: 01c332 addi a3, a3, 1 -40004b4e: ebc366 bnei a3, 32, 40004b3d <gpio_output_set_high+0x145> -40004b51: fc56a5 call8 400010bc <_X_ets_exit_critical> -40004b54: 000090 retw -40004b57: 413600 srli a3, a0, 6 -40004b5a: 54e500 extui a14, a0, 5, 6 -40004b5d: b1fc bnez.n a1, 40004b9c <gpio_output_set_high+0x1a4> -40004b5f: 92ff81 l32r a8, 3ffe975c <_start-0x168a4> -40004b62: af .byte 0xaf -40004b63: ff .byte 0xff -40004b64: 012b82 l32i a8, a11, 4 -40004b67: 309290 xor a9, a2, a9 -40004b6a: 10a890 and a10, a8, a9 -40004b6d: 016ba2 s32i a10, a11, 4 -40004b70: 0c0897 bnone a8, a9, 40004b80 <gpio_output_set_high+0x188> -40004b73: f16fd1 l32r a13, 40001130 <_c_0x60003e00> -40004b76: 0020c0 memw -40004b79: 956da2 s32i a10, a13, 0x254 -40004b7c: 0c0c movi.n a12, 0 -40004b7e: 1bc9 s32i.n a12, a11, 4 -40004b80: ffae41 l32r a4, 40004a38 <gpio_output_set_high+0x40> -40004b83: 030c movi.n a3, 0 -40004b85: 085237 bbc a2, a3, 40004b91 <gpio_output_set_high+0x199> -40004b88: 20c3a2 addi a10, a3, 32 -40004b8b: 2004b2 l8ui a11, a4, 32 -40004b8e: fff565 call8 40004ae4 <gpio_output_set_high+0xec> -40004b91: 01c442 addi a4, a4, 1 -40004b94: 01c332 addi a3, a3, 1 -40004b97: ea8366 bnei a3, 8, 40004b85 <gpio_output_set_high+0x18d> -40004b9a: fc5225 call8 400010bc <_X_ets_exit_critical> -40004b9d: 000090 retw -40004ba0: 004136 entry a1, 32 -40004ba3: ff7041 l32r a4, 40004964 <_XX_unk4940+0x24> -40004ba6: 3439 s32i.n a3, a4, 12 -40004ba8: 2429 s32i.n a2, a4, 8 -40004baa: f01d retw.n -40004bac: 004136 entry a1, 32 -40004baf: f16051 l32r a5, 40001130 <_c_0x60003e00> -40004bb2: 0020c0 memw -40004bb5: 912532 l32i a3, a5, 0x244 -40004bb8: 0020c0 memw -40004bbb: 942522 l32i a2, a5, 0x250 -40004bbe: 040c movi.n a4, 0 -40004bc0: 065347 bbc a3, a4, 40004bca <gpio_output_set_high+0x1d2> -40004bc3: 04ad mov.n a10, a4 -40004bc5: 0b0c movi.n a11, 0 -40004bc7: fff1e5 call8 40004ae4 <gpio_output_set_high+0xec> -40004bca: 441b addi.n a4, a4, 1 -40004bcc: f0c466 bnei a4, 32, 40004bc0 <gpio_output_set_high+0x1c8> -40004bcf: ff6561 l32r a6, 40004964 <_XX_unk4940+0x24> -40004bd2: 0020c0 memw -40004bd5: 936532 s32i a3, a5, 0x24c -40004bd8: 0698 l32i.n a9, a6, 0 -40004bda: 89ac beqz.n a9, 40004c06 <gpio_output_set_high+0x20e> -40004bdc: 208390 or a8, a3, a9 -40004bdf: 006682 s32i a8, a6, 0 -40004be2: 040c movi.n a4, 0 -40004be4: 085247 bbc a2, a4, 40004bf0 <gpio_output_set_high+0x1f8> -40004be7: 20c4a2 addi a10, a4, 32 -40004bea: 00a0b2 movi a11, 0 -40004bed: ffef65 call8 40004ae4 <gpio_output_set_high+0xec> -40004bf0: 441b addi.n a4, a4, 1 -40004bf2: ee8466 bnei a4, 8, 40004be4 <gpio_output_set_high+0x1ec> -40004bf5: 0020c0 memw -40004bf8: 966522 s32i a2, a5, 0x258 -40004bfb: 1698 l32i.n a9, a6, 4 -40004bfd: 499c beqz.n a9, 40004c15 <gpio_output_set_high+0x21d> -40004bff: 20a290 or a10, a2, a9 -40004c02: 16a9 s32i.n a10, a6, 4 -40004c04: f01d retw.n -40004c06: 03ad mov.n a10, a3 -40004c08: 0639 s32i.n a3, a6, 0 -40004c0a: 2688 l32i.n a8, a6, 8 -40004c0c: 36b8 l32i.n a11, a6, 12 -40004c0e: 0008e0 callx8 a8 -40004c11: fff346 j 40004be2 <gpio_output_set_high+0x1ea> -40004c14: 02ad00 andb b10, b13, b0 -40004c17: 1629 s32i.n a2, a6, 4 -40004c19: 2688 l32i.n a8, a6, 8 -40004c1b: 36b8 l32i.n a11, a6, 12 -40004c1d: 0008e0 callx8 a8 -40004c20: f01d retw.n -40004c22: 360000 excw -40004c25: 250041 l32r a4, 3ffce028 <_start-0x31fd8> -40004c28: fc48 l32i.n a4, a12, 60 -40004c2a: f14191 l32r a9, 40001130 <_c_0x60003e00> -40004c2d: a09290 addx4 a9, a2, a9 -40004c30: 0020c0 memw -40004c33: 7facb2 movi a11, 0xfffffc7f -40004c36: a22982 l32i a8, a9, 0x288 -40004c39: 11a390 slli a10, a3, 7 -40004c3c: 1088b0 and a8, a8, a11 -40004c3f: 2088a0 or a8, a8, a10 -40004c42: 00a4a2 movi a10, 0x400 -40004c45: 2088a0 or a8, a8, a10 -40004c48: 0020c0 memw -40004c4b: a26982 s32i a8, a9, 0x288 -40004c4e: fc46e5 call8 400010bc <_X_ets_exit_critical> -40004c51: f01d retw.n -40004c53: 413600 srli a3, a0, 6 -40004c56: 030c00 rsr.scompare1 a0 -40004c59: 7fa872 movi a7, 0xfffff87f -40004c5c: f13541 l32r a4, 40001130 <_c_0x60003e00> -40004c5f: 822c movi.n a2, 40 -40004c61: 19a276 loopgtz a2, 40004c7e <gpio_output_set_high+0x286> -40004c64: a06340 addx4 a6, a3, a4 -40004c67: 0020c0 memw -40004c6a: a22652 l32i a5, a6, 0x288 -40004c6d: 0865a7 bbci a5, 10, 40004c79 <gpio_output_set_high+0x281> -40004c70: 108570 and a8, a5, a7 -40004c73: 0020c0 memw -40004c76: a26682 s32i a8, a6, 0x288 -40004c79: 331b addi.n a3, a3, 1 -40004c7b: 743030 extui a3, a3, 0, 8 -40004c7e: f01d retw.n - -40004c80 <_c_0xbfffffff>: -40004c80: ff .byte 0xff -40004c81: ff .byte 0xff -40004c82: ff .byte 0xff -40004c83: bf .byte 0xbf -40004c84: fff000 excw -40004c87: ff .byte 0xff - -40004c88 <_c_0xff000fff>: -40004c88: ff .byte 0xff -40004c89: 0f .byte 0xf -40004c8a: 36ff00 excw - -40004c8c <lldesc_build_chain>: -40004c8c: 006136 entry a1, 48 -40004c8f: b4f060 extui a15, a6, 0, 12 -40004c92: 00a092 movi a9, 0 -40004c95: fffae1 l32r a14, 40004c80 <_c_0xbfffffff> -40004c98: eebad1 l32r a13, 40000780 <_c_0x7fffffff> -40004c9b: eea7c1 l32r a12, 40000738 <_c_0x80000000> -40004c9e: f70db1 l32r a11, 400028d4 <_c_0xdfffffff> -40004ca1: 036172 s32i a7, a1, 12 -40004ca4: fff8a1 l32r a10, 40004c84 <_c_0xbfffffff+0x4> -40004ca7: c27560 quou a7, a5, a6 -40004caa: 205110 or a5, a1, a1 -40004cad: 628076 loop a0, 40004d13 <lldesc_build_chain+0x87> -40004cb0: 1249 s32i.n a4, a2, 4 -40004cb2: 0020c0 memw -40004cb5: 0238 l32i.n a3, a2, 0 -40004cb7: 1033a0 and a3, a3, a10 -40004cba: 2033f0 or a3, a3, a15 -40004cbd: 0020c0 memw -40004cc0: 0239 s32i.n a3, a2, 0 -40004cc2: 0020c0 memw -40004cc5: 0288 l32i.n a8, a2, 0 -40004cc7: 1088d0 and a8, a8, a13 -40004cca: 2088c0 or a8, a8, a12 -40004ccd: 0020c0 memw -40004cd0: 3138 l32i.n a3, a1, 12 -40004cd2: 0289 s32i.n a8, a2, 0 -40004cd4: 040316 beqz a3, 40004d18 <lldesc_build_chain+0x8c> -40004cd7: 0020c0 memw -40004cda: 0288 l32i.n a8, a2, 0 -40004cdc: 0020c0 memw -40004cdf: 0238 l32i.n a3, a2, 0 -40004ce1: b43030 extui a3, a3, 0, 12 -40004ce4: cab380 depbits a8, a3, 12, 12 -40004ce7: 0020c0 memw -40004cea: 0289 s32i.n a8, a2, 0 -40004cec: 0020c0 memw -40004cef: 0288 l32i.n a8, a2, 0 -40004cf1: 1088e0 and a8, a8, a14 -40004cf4: 0020c0 memw -40004cf7: 0289 s32i.n a8, a2, 0 -40004cf9: 0020c0 memw -40004cfc: 0288 l32i.n a8, a2, 0 -40004cfe: 1088b0 and a8, a8, a11 -40004d01: 0020c0 memw -40004d04: 464a add.n a4, a6, a4 -40004d06: 991b addi.n a9, a9, 1 -40004d08: 0289 s32i.n a8, a2, 0 -40004d0a: 2529 s32i.n a2, a5, 8 -40004d0c: 2558 l32i.n a5, a5, 8 -40004d0e: 22cb addi.n a2, a2, 12 -40004d10: 18b977 bgeu a9, a7, 40004d2c <lldesc_build_chain+0xa0> -40004d13: ffe586 j 40004cad <lldesc_build_chain+0x21> -40004d16: c00000 sub a0, a0, a0 -40004d19: 810020 src a0, a0, a2 -40004d1c: ffdb addi.n a15, a15, 13 -40004d1e: 0238 l32i.n a3, a2, 0 -40004d20: 103380 and a3, a3, a8 -40004d23: 0020c0 memw -40004d26: 0239 s32i.n a3, a2, 0 -40004d28: fff006 j 40004cec <lldesc_build_chain+0x60> -40004d2b: d19800 mul16s a9, a8, a0 -40004d2e: c1b8 l32i.n a11, a1, 48 -40004d30: 0a0c movi.n a10, 0 -40004d32: 25a9 s32i.n a10, a5, 8 -40004d34: 21a8 l32i.n a10, a1, 8 -40004d36: 0ba9 s32i.n a10, a11, 0 -40004d38: 0959 s32i.n a5, a9, 0 -40004d3a: f01d retw.n -40004d3c: 004136 entry a1, 32 -40004d3f: ffc332 addi a3, a3, -1 -40004d42: f43030 extui a3, a3, 0, 16 -40004d45: 019376 loopnez a3, 40004d4a <lldesc_build_chain+0xbe> -40004d48: 2228 l32i.n a2, a2, 8 -40004d4a: f01d retw.n -40004d4c: 004136 entry a1, 32 -40004d4f: 015410 slli a5, a4, 31 -40004d52: ee8b81 l32r a8, 40000780 <_c_0x7fffffff> -40004d55: 0020c0 memw -40004d58: 0268 l32i.n a6, a2, 0 -40004d5a: fb0460 depbits a6, a4, 31, 1 -40004d5d: 084d mov.n a4, a8 -40004d5f: 0020c0 memw -40004d62: 0269 s32i.n a6, a2, 0 -40004d64: 330b addi.n a3, a3, -1 -40004d66: f43030 extui a3, a3, 0, 16 -40004d69: 119376 loopnez a3, 40004d7e <lldesc_build_chain+0xf2> -40004d6c: 2228 l32i.n a2, a2, 8 -40004d6e: 0020c0 memw -40004d71: 0238 l32i.n a3, a2, 0 -40004d73: 103340 and a3, a3, a4 -40004d76: 203350 or a3, a3, a5 -40004d79: 0020c0 memw -40004d7c: 0239 s32i.n a3, a2, 0 -40004d7e: f01d retw.n - -40004d80 <_st_0x3fffdc90>: -40004d80: ffdc90 excw -40004d83: 3f .byte 0x3f -40004d84: ffdd50 excw -40004d87: 3f .byte 0x3f - -40004d88 <_XX_unk4d88>: -40004d88: 008136 entry a1, 64 -40004d8b: fffec1 l32r a12, 40004d84 <_st_0x3fffdc90+0x4> -40004d8e: 00a2d2 movi a13, 0x200 -40004d91: 14c182 addi a8, a1, 20 -40004d94: 10c192 addi a9, a1, 16 -40004d97: fffa21 l32r a2, 40004d80 <_st_0x3fffdc90> -40004d9a: 00a0f2 movi a15, 0 -40004d9d: 40a0b2 movi a11, 64 -40004da0: 20ebb0 or a14, a11, a11 -40004da3: 22f9 s32i.n a15, a2, 8 -40004da5: 0052b2 s16i a11, a2, 0 -40004da8: a28b addi.n a10, a2, 8 -40004daa: 32a9 s32i.n a10, a2, 12 -40004dac: 60a0b2 movi a11, 96 -40004daf: 60c2a2 addi a10, a2, 96 -40004db2: 0199 s32i.n a9, a1, 0 -40004db4: 1189 s32i.n a8, a1, 4 -40004db6: ffed65 call8 40004c8c <lldesc_build_chain> -40004db9: 51c8 l32i.n a12, a1, 20 -40004dbb: 41d8 l32i.n a13, a1, 16 -40004dbd: 22d9 s32i.n a13, a2, 8 -40004dbf: cc8b addi.n a12, a12, 8 -40004dc1: 32c9 s32i.n a12, a2, 12 -40004dc3: f01d retw.n -40004dc5: 000000 ill -40004dc8: dc98 l32i.n a9, a12, 52 -40004dca: ff .byte 0xff -40004dcb: 3f .byte 0x3f -40004dcc: 004136 entry a1, 32 -40004dcf: ffec51 l32r a5, 40004d80 <_st_0x3fffdc90> -40004dd2: 2588 l32i.n a8, a5, 8 -40004dd4: 058816 beqz a8, 40004e30 <_XX_unk4d88+0xa8> -40004dd7: fc2d25 call8 400010a8 <_X_ets_enter_critical> -40004dda: 2548 l32i.n a4, a5, 8 -40004ddc: 2498 l32i.n a9, a4, 8 -40004dde: 026592 s32i a9, a5, 8 -40004de1: 04f916 beqz a9, 40004e34 <_XX_unk4d88+0xac> -40004de4: fc2d65 call8 400010bc <_X_ets_exit_critical> -40004de7: 00a0a2 movi a10, 0 -40004dea: 0ca0b2 movi a11, 12 -40004ded: 24a9 s32i.n a10, a4, 8 -40004def: 14a8 l32i.n a10, a4, 4 -40004df1: fdc625 call8 40002a54 <bzero> -40004df4: f0a0f2 movi a15, 240 -40004df7: 14d8 l32i.n a13, a4, 4 -40004df9: 22cb addi.n a2, a2, 12 -40004dfb: 418820 srli a8, a2, 8 -40004dfe: 034d82 s8i a8, a13, 3 -40004e01: 024d22 s8i a2, a13, 2 -40004e04: 000de2 l8ui a14, a13, 0 -40004e07: 014d32 s8i a3, a13, 1 -40004e0a: 10eef0 and a14, a14, a15 -40004e0d: 004de2 s8i a14, a13, 0 -40004e10: 0020c0 memw -40004e13: dd2b addi.n a13, a13, 2 -40004e15: 04b8 l32i.n a11, a4, 0 -40004e17: 010dc2 l8ui a12, a13, 1 -40004e1a: 000dd2 l8ui a13, a13, 0 -40004e1d: 11cc80 slli a12, a12, 8 -40004e20: 20ccd0 or a12, a12, a13 -40004e23: cabcb0 depbits a11, a12, 12, 12 -40004e26: 0020c0 memw -40004e29: 04b9 s32i.n a11, a4, 0 -40004e2b: 042d mov.n a2, a4 -40004e2d: f01d retw.n -40004e2f: 020c00 andb b0, b12, b0 -40004e32: f01d retw.n -40004e34: ffe591 l32r a9, 40004dc8 <_XX_unk4d88+0x40> -40004e37: 3599 s32i.n a9, a5, 12 -40004e39: ffe9c6 j 40004de4 <_XX_unk4d88+0x5c> -40004e3c: 004136 entry a1, 32 -40004e3f: ee5081 l32r a8, 40000780 <_c_0x7fffffff> -40004e42: ee3df1 l32r a15, 40000738 <_c_0x80000000> -40004e45: 00a032 movi a3, 0 -40004e48: 0020c0 memw -40004e4b: 0022e2 l32i a14, a2, 0 -40004e4e: 10ee80 and a14, a14, a8 -40004e51: 20eef0 or a14, a14, a15 -40004e54: 0020c0 memw -40004e57: 02e9 s32i.n a14, a2, 0 -40004e59: ff89d1 l32r a13, 40004c80 <_c_0xbfffffff> -40004e5c: 0020c0 memw -40004e5f: 02c8 l32i.n a12, a2, 0 -40004e61: 10ccd0 and a12, a12, a13 -40004e64: 0020c0 memw -40004e67: 02c9 s32i.n a12, a2, 0 -40004e69: f69ab1 l32r a11, 400028d4 <_c_0xdfffffff> -40004e6c: 0020c0 memw -40004e6f: 02a8 l32i.n a10, a2, 0 -40004e71: 10aab0 and a10, a10, a11 -40004e74: 0020c0 memw -40004e77: 02a9 s32i.n a10, a2, 0 -40004e79: ff8391 l32r a9, 40004c88 <_c_0xff000fff> -40004e7c: 0020c0 memw -40004e7f: 0288 l32i.n a8, a2, 0 -40004e81: 108890 and a8, a8, a9 -40004e84: 0020c0 memw -40004e87: 0289 s32i.n a8, a2, 0 -40004e89: fc21e5 call8 400010a8 <_X_ets_enter_critical> -40004e8c: ffbda1 l32r a10, 40004d80 <_st_0x3fffdc90> -40004e8f: 2239 s32i.n a3, a2, 8 -40004e91: 3ab8 l32i.n a11, a10, 12 -40004e93: 928b addi.n a9, a2, 8 -40004e95: 0b29 s32i.n a2, a11, 0 -40004e97: 3a99 s32i.n a9, a10, 12 -40004e99: fc2225 call8 400010bc <_X_ets_exit_critical> -40004e9c: f01d retw.n -40004e9e: 360000 excw -40004ea1: cd0041 l32r a4, 3fff82a4 <_start-0x7d5c> -40004ea4: 03bd04 excw -40004ea7: 02ad mov.n a10, a2 -40004ea9: 209220 or a9, a2, a2 -40004eac: 05c216 beqz a2, 40004f0c <_XX_unk4d88+0x184> -40004eaf: ff7631 l32r a3, 40004c88 <_c_0xff000fff> -40004eb2: ff7321 l32r a2, 40004c80 <_c_0xbfffffff> -40004eb5: ee32f1 l32r a15, 40000780 <_c_0x7fffffff> -40004eb8: ee20e1 l32r a14, 40000738 <_c_0x80000000> -40004ebb: f686d1 l32r a13, 400028d4 <_c_0xdfffffff> -40004ebe: 00a042 movi a4, 0 -40004ec1: 438076 loop a0, 40004f08 <_XX_unk4d88+0x180> -40004ec4: 0020c0 memw -40004ec7: 0988 l32i.n a8, a9, 0 -40004ec9: 1088f0 and a8, a8, a15 -40004ecc: 2088e0 or a8, a8, a14 -40004ecf: 0020c0 memw -40004ed2: 0989 s32i.n a8, a9, 0 -40004ed4: 0020c0 memw -40004ed7: 0988 l32i.n a8, a9, 0 -40004ed9: 108820 and a8, a8, a2 -40004edc: 208840 or a8, a8, a4 -40004edf: 0020c0 memw -40004ee2: 0989 s32i.n a8, a9, 0 -40004ee4: 0020c0 memw -40004ee7: 0988 l32i.n a8, a9, 0 -40004ee9: 1088d0 and a8, a8, a13 -40004eec: 208840 or a8, a8, a4 -40004eef: 0020c0 memw -40004ef2: 0989 s32i.n a8, a9, 0 -40004ef4: 0020c0 memw -40004ef7: 0988 l32i.n a8, a9, 0 -40004ef9: 108830 and a8, a8, a3 -40004efc: 208840 or a8, a8, a4 -40004eff: 0020c0 memw -40004f02: 0989 s32i.n a8, a9, 0 -40004f04: 2998 l32i.n a9, a9, 8 -40004f06: 298c beqz.n a9, 40004f0c <_XX_unk4d88+0x184> -40004f08: ffed46 j 40004ec1 <_XX_unk4d88+0x139> -40004f0b: 8aa500 depbits a0, a5, 8, 11 -40004f0e: f01d00 subx8 a1, a13, a0 -40004f11: 000000 ill - -40004f14 <_XX_unk4f14>: -40004f14: 004136 entry a1, 32 -40004f17: 20b220 or a11, a2, a2 -40004f1a: ee1991 l32r a9, 40000780 <_c_0x7fffffff> -40004f1d: ee0681 l32r a8, 40000738 <_c_0x80000000> -40004f20: 0020c0 memw -40004f23: 0022f2 l32i a15, a2, 0 -40004f26: 10ff90 and a15, a15, a9 -40004f29: 20ff80 or a15, a15, a8 -40004f2c: 0020c0 memw -40004f2f: 0062f2 s32i a15, a2, 0 -40004f32: ff53e1 l32r a14, 40004c80 <_c_0xbfffffff> -40004f35: 0020c0 memw -40004f38: 02d8 l32i.n a13, a2, 0 -40004f3a: 10dde0 and a13, a13, a14 -40004f3d: 0020c0 memw -40004f40: 02d9 s32i.n a13, a2, 0 -40004f42: f664c1 l32r a12, 400028d4 <_c_0xdfffffff> -40004f45: 0020c0 memw -40004f48: 02a8 l32i.n a10, a2, 0 -40004f4a: 10aac0 and a10, a10, a12 -40004f4d: 0020c0 memw -40004f50: 02a9 s32i.n a10, a2, 0 -40004f52: ff4d91 l32r a9, 40004c88 <_c_0xff000fff> -40004f55: 02ad mov.n a10, a2 -40004f57: 0020c0 memw -40004f5a: 0288 l32i.n a8, a2, 0 -40004f5c: 108890 and a8, a8, a9 -40004f5f: 0020c0 memw -40004f62: 1c0c movi.n a12, 1 -40004f64: 0289 s32i.n a8, a2, 0 -40004f66: 008525 call8 400057b8 <_XX_unk57b8> -40004f69: f01d retw.n - ... - -40004f6c <_XX_unk4f6c>: -40004f6c: 006136 entry a1, 48 -40004f6f: 20a110 or a10, a1, a1 -40004f72: 04c1b2 addi a11, a1, 4 -40004f75: 0087e5 call8 400057f4 <_XX_unk57f4> -40004f78: 0021c2 l32i a12, a1, 0 -40004f7b: ff81a1 l32r a10, 40004d80 <_st_0x3fffdc90> -40004f7e: ac9c beqz.n a12, 40004f9c <_XX_unk4f6c+0x30> -40004f80: 6a98 l32i.n a9, a10, 24 -40004f82: 698c beqz.n a9, 40004f8c <_XX_unk4f6c+0x20> -40004f84: 29c9 s32i.n a12, a9, 8 -40004f86: 1188 l32i.n a8, a1, 4 -40004f88: 6a89 s32i.n a8, a10, 24 -40004f8a: f01d retw.n -40004f8c: 00a0b2 movi a11, 0 -40004f8f: 012192 l32i a9, a1, 4 -40004f92: 056ac2 s32i a12, a10, 20 -40004f95: 6a99 s32i.n a9, a10, 24 -40004f97: da1c movi.n a10, 29 -40004f99: fbffe5 call8 40000f98 <_XX_unk0f96> -40004f9c: f01d retw.n -40004f9e: 360000 excw -40004fa1: 410041 l32r a4, 3ffd53a4 <_start-0x2ac5c> -40004fa4: 32ff77 bbsi a15, 23, 40004fda <_XX_unk4fc8+0x12> -40004fa7: 201424 excw -40004faa: 329332 l16si a3, a3, 100 -40004fad: 1d1464 excw -40004fb0: 0000f0 callx12 a0 -40004fb3: 413600 srli a3, a0, 6 -40004fb6: 724100 excw -40004fb9: ff .byte 0xff -40004fba: 152432 l32i a3, a4, 84 -40004fbd: 933220 movnez a3, a2, a2 -40004fc0: 156432 s32i a3, a4, 84 -40004fc3: f01d retw.n -40004fc5: 000000 ill - -40004fc8 <_XX_unk4fc8>: -40004fc8: 006136 entry a1, 48 -40004fcb: 01ad mov.n a10, a1 -40004fcd: b14b addi.n a11, a1, 4 -40004fcf: 0087a5 call8 40005848 <_XX_unk5848> -40004fd2: 2e0a26 beqi a10, -1, 40005004 <_XX_unk4fc8+0x3c> -40004fd5: ff6aa1 l32r a10, 40004d80 <_st_0x3fffdc90> -40004fd8: 01c8 l32i.n a12, a1, 0 -40004fda: 162ad2 l32i a13, a10, 88 -40004fdd: 8a98 l32i.n a9, a10, 32 -40004fdf: 7d8c beqz.n a13, 40004fea <_XX_unk4fc8+0x22> -40004fe1: 0cad mov.n a10, a12 -40004fe3: 11b8 l32i.n a11, a1, 4 -40004fe5: 000de0 callx8 a13 -40004fe8: f01d retw.n -40004fea: 698c beqz.n a9, 40004ff4 <_XX_unk4fc8+0x2c> -40004fec: 29c9 s32i.n a12, a9, 8 -40004fee: 1188 l32i.n a8, a1, 4 -40004ff0: 8a89 s32i.n a8, a10, 32 -40004ff2: f01d retw.n -40004ff4: 02a0b2 movi a11, 2 -40004ff7: 012192 l32i a9, a1, 4 -40004ffa: 076ac2 s32i a12, a10, 28 -40004ffd: 8a99 s32i.n a9, a10, 32 -40004fff: da1c movi.n a10, 29 -40005001: fbf965 call8 40000f98 <_XX_unk0f96> -40005004: f01d retw.n - ... - -40005008 <_s_no_rds>: -40005008: ffcce4 excw -4000500b: 3f .byte 0x3f - -4000500c <_XX_unk500c>: -4000500c: 004136 entry a1, 32 -4000500f: 12a8 l32i.n a10, a2, 4 -40005011: 070a92 l8ui a9, a10, 7 -40005014: 060ab2 l8ui a11, a10, 6 -40005017: 119980 slli a9, a9, 8 -4000501a: 2099b0 or a9, a9, a11 -4000501d: 050ab2 l8ui a11, a10, 5 -40005020: 119980 slli a9, a9, 8 -40005023: 2099b0 or a9, a9, a11 -40005026: 040ab2 l8ui a11, a10, 4 -40005029: 119980 slli a9, a9, 8 -4000502c: 2099b0 or a9, a9, a11 -4000502f: 890b addi.n a8, a9, -1 -40005031: 0a8816 beqz a8, 400050dd <_XX_unk500c+0xd1> -40005034: 603926 beqi a9, 3, 40005098 <_XX_unk500c+0x8c> -40005037: fbc9b2 addi a11, a9, -5 -4000503a: 0e6b16 beqz a11, 40005124 <_XX_unk500c+0x118> -4000503d: 07a926 beqi a9, 12, 40005048 <_XX_unk500c+0x3c> -40005040: 02ad mov.n a10, a2 -40005042: ffed25 call8 40004f14 <_XX_unk4f14> -40005045: f01d retw.n -40005047: ca3200 depbits a0, a2, 12, 4 -4000504a: 420c movi.n a2, 4 -4000504c: 18ca add.n a1, a8, a12 -4000504e: 07a0b2 movi a11, 7 -40005051: 0ca0a2 movi a10, 12 -40005054: ffd765 call8 40004dcc <_XX_unk4d88+0x44> -40005057: 0a5d mov.n a5, a10 -40005059: 7acc bnez.n a10, 40005064 <_XX_unk500c+0x58> -4000505b: ffeba1 l32r a10, 40005008 <_s_no_rds> -4000505e: fd7a65 call8 40002804 <ets_printf> -40005061: fff6c6 j 40005040 <_XX_unk500c+0x34> -40005064: 20b440 or a11, a4, a4 -40005067: 0603d2 l8ui a13, a3, 6 -4000506a: 0703c2 l8ui a12, a3, 7 -4000506d: 012aa2 l32i a10, a10, 4 -40005070: 11cc80 slli a12, a12, 8 -40005073: 0ccaa2 addi a10, a10, 12 -40005076: 20ccd0 or a12, a12, a13 -40005079: 0503d2 l8ui a13, a3, 5 -4000507c: 11cc80 slli a12, a12, 8 -4000507f: 20ccd0 or a12, a12, a13 -40005082: 0403d2 l8ui a13, a3, 4 -40005085: 11cc80 slli a12, a12, 8 -40005088: 20ccd0 or a12, a12, a13 -4000508b: fcd3a5 call8 40001dc4 <_X_ets_memcpy> -4000508e: 05bd mov.n a11, a5 -40005090: 05ad mov.n a10, a5 -40005092: 0013a5 call8 400051cc <_XX_unk51ac+0x20> -40005095: ffe9c6 j 40005040 <_XX_unk500c+0x34> -40005098: 0d0a82 l8ui a8, a10, 13 -4000509b: 0e0af2 l8ui a15, a10, 14 -4000509e: 0f0ae2 l8ui a14, a10, 15 -400050a1: 130ad2 l8ui a13, a10, 19 -400050a4: 11ee80 slli a14, a14, 8 -400050a7: 11dd80 slli a13, a13, 8 -400050aa: 20eef0 or a14, a14, a15 -400050ad: 120af2 l8ui a15, a10, 18 -400050b0: 11ee80 slli a14, a14, 8 -400050b3: 20ee80 or a14, a14, a8 -400050b6: 20ddf0 or a13, a13, a15 -400050b9: 110af2 l8ui a15, a10, 17 -400050bc: 11dd80 slli a13, a13, 8 -400050bf: 20ddf0 or a13, a13, a15 -400050c2: 100af2 l8ui a15, a10, 16 -400050c5: 11dd80 slli a13, a13, 8 -400050c8: 20ddf0 or a13, a13, a15 -400050cb: 0c0af2 l8ui a15, a10, 12 -400050ce: 11ee80 slli a14, a14, 8 -400050d1: 20eef0 or a14, a14, a15 -400050d4: 0020c0 memw -400050d7: 0ed9 s32i.n a13, a14, 0 -400050d9: ffd8c6 j 40005040 <_XX_unk500c+0x34> -400050dc: cab200 depbits a0, a2, 12, 12 -400050df: 0ae214 excw -400050e2: 0e .byte 0xe -400050e3: 110af2 l8ui a15, a10, 17 -400050e6: 130ac2 l8ui a12, a10, 19 -400050e9: 120ad2 l8ui a13, a10, 18 -400050ec: 11cc80 slli a12, a12, 8 -400050ef: 20ccd0 or a12, a12, a13 -400050f2: 11cc80 slli a12, a12, 8 -400050f5: 0f0ad2 l8ui a13, a10, 15 -400050f8: 20ccf0 or a12, a12, a15 -400050fb: 100af2 l8ui a15, a10, 16 -400050fe: 11dd80 slli a13, a13, 8 -40005101: 11cc80 slli a12, a12, 8 -40005104: 20dde0 or a13, a13, a14 -40005107: 0d0ae2 l8ui a14, a10, 13 -4000510a: 11dd80 slli a13, a13, 8 -4000510d: 20ccf0 or a12, a12, a15 -40005110: 20dde0 or a13, a13, a14 -40005113: 0c0ae2 l8ui a14, a10, 12 -40005116: 11dd80 slli a13, a13, 8 -40005119: 20dde0 or a13, a13, a14 -4000511c: 0dad mov.n a10, a13 -4000511e: fcca65 call8 40001dc4 <_X_ets_memcpy> -40005121: ffc6c6 j 40005040 <_XX_unk500c+0x34> -40005124: 0c0ab2 l8ui a11, a10, 12 -40005127: 0f0ac2 l8ui a12, a10, 15 -4000512a: 0e0ad2 l8ui a13, a10, 14 -4000512d: 11cc80 slli a12, a12, 8 -40005130: 20ccd0 or a12, a12, a13 -40005133: 0d0ad2 l8ui a13, a10, 13 -40005136: 11cc80 slli a12, a12, 8 -40005139: 20ccd0 or a12, a12, a13 -4000513c: 11ac80 slli a10, a12, 8 -4000513f: 20aab0 or a10, a10, a11 -40005142: fbfd25 call8 40001114 <_XX_set_0x3fffda30_0> -40005145: 02a0d2 movi a13, 2 -40005148: ff0ee1 l32r a14, 40004d80 <_st_0x3fffdc90> -4000514b: 00a0f2 movi a15, 0 -4000514e: 166ef2 s32i a15, a14, 88 -40005151: 0b6ed2 s32i a13, a14, 44 -40005154: ffba06 j 40005040 <_XX_unk500c+0x34> -40005157: 413600 srli a3, a0, 6 -4000515a: 092100 l32e a0, a1, -56 -4000515d: ff .byte 0xff -4000515e: b228 l32i.n a2, a2, 44 -40005160: f01d retw.n - ... - -40005164 <_fp_0x40004f6c>: -40005164: 4f6c movi.n a15, -28 -40005166: c84000 excw - -40005168 <_fp_0x40004fc8>: -40005168: 4fc8 l32i.n a12, a15, 16 -4000516a: 0c4000 excw -4000516d: 400050 excw - -40005170 <_X_sip_init_attach>: -40005170: 004136 entry a1, 32 -40005173: 02dd mov.n a13, a2 -40005175: fffba1 l32r a10, 40005164 <_fp_0x40004f6c> -40005178: fffcb1 l32r a11, 40005168 <_fp_0x40004fc8> -4000517b: ff0131 l32r a3, 40004d80 <_st_0x3fffdc90> -4000517e: 080c movi.n a8, 0 -40005180: 03cd mov.n a12, a3 -40005182: b389 s32i.n a8, a3, 44 -40005184: 003625 call8 400054e8 <_X_slc_init_attach> -40005187: c3a9 s32i.n a10, a3, 48 -40005189: ffbfe5 call8 40004d88 <_XX_unk4d88> -4000518c: c398 l32i.n a9, a3, 48 -4000518e: fff7a1 l32r a10, 4000516c <_fp_0x40004fc8+0x4> -40005191: 1663a2 s32i a10, a3, 88 -40005194: 001992 l16ui a9, a9, 0 -40005197: 015392 s16i a9, a3, 2 -4000519a: 004de5 call8 40005678 <_X_slc_enable> -4000519d: 1b0c movi.n a11, 1 -4000519f: b3b9 s32i.n a11, a3, 44 -400051a1: f01d retw.n -400051a3: 544400 extui a4, a0, 4, 6 -400051a6: 504000 iitlb a0 -400051a9: df .byte 0xdf -400051aa: ff .byte 0xff -400051ab: 3f .byte 0x3f - -400051ac <_XX_unk51ac>: -400051ac: 004136 entry a1, 32 -400051af: fffda1 l32r a10, 400051a4 <_X_sip_init_attach+0x34> -400051b2: 1da0b2 movi a11, 29 -400051b5: fffcc1 l32r a12, 400051a8 <_X_sip_init_attach+0x38> -400051b8: 04a0d2 movi a13, 4 -400051bb: fef191 l32r a9, 40004d80 <_st_0x3fffdc90> -400051be: 00a082 movi a8, 0 -400051c1: a989 s32i.n a8, a9, 40 -400051c3: 9989 s32i.n a8, a9, 36 -400051c5: fbd8e5 call8 40000f54 <_X_ets_task> -400051c8: f01d retw.n -400051ca: 360000 excw -400051cd: ad0041 l32r a4, 3fff05d0 <_start-0xfa30> -400051d0: eb8102 excw -400051d3: fe .byte 0xfe -400051d4: 1298 l32i.n a9, a2, 4 -400051d6: a8f8 l32i.n a15, a8, 40 -400051d8: 0849f2 s8i a15, a9, 8 -400051db: 41c8f0 srli a12, a15, 8 -400051de: 0949c2 s8i a12, a9, 9 -400051e1: ff1b addi.n a15, a15, 1 -400051e3: 41c8c0 srli a12, a12, 8 -400051e6: 0a49c2 s8i a12, a9, 10 -400051e9: 41c8c0 srli a12, a12, 8 -400051ec: 0b49c2 s8i a12, a9, 11 -400051ef: a8f9 s32i.n a15, a8, 40 -400051f1: 03bd mov.n a11, a3 -400051f3: fea3e1 l32r a14, 40004c80 <_c_0xbfffffff> -400051f6: ed5ad1 l32r a13, 40000760 <_c_0x40000000> -400051f9: 0020c0 memw -400051fc: 03c8 l32i.n a12, a3, 0 -400051fe: 10cce0 and a12, a12, a14 -40005201: 20ccd0 or a12, a12, a13 -40005204: 0020c0 memw -40005207: 03c9 s32i.n a12, a3, 0 -40005209: 994b addi.n a9, a9, 4 -4000520b: 0d0c movi.n a13, 0 -4000520d: 0020c0 memw -40005210: 0049d2 s8i a13, a9, 0 -40005213: 0020c0 memw -40005216: 0149d2 s8i a13, a9, 1 -40005219: 0c0c movi.n a12, 0 -4000521b: 0020c0 memw -4000521e: 0249c2 s8i a12, a9, 2 -40005221: 080c movi.n a8, 0 -40005223: 0020c0 memw -40005226: 034982 s8i a8, a9, 3 -40005229: 0050a5 call8 40005734 <_XX_unk5734> -4000522c: 020c movi.n a2, 0 -4000522e: f01d retw.n -40005230: 004136 entry a1, 32 -40005233: fed321 l32r a2, 40004d80 <_st_0x3fffdc90> -40005236: f01d retw.n -40005238: 004136 entry a1, 32 -4000523b: fed141 l32r a4, 40004d80 <_st_0x3fffdc90> -4000523e: 5488 l32i.n a8, a4, 20 -40005240: 010816 beqz a8, 40005254 <_XX_unk51ac+0xa8> -40005243: fbe665 call8 400010a8 <_X_ets_enter_critical> -40005246: 5428 l32i.n a2, a4, 20 -40005248: 050c movi.n a5, 0 -4000524a: 6459 s32i.n a5, a4, 24 -4000524c: 5459 s32i.n a5, a4, 20 -4000524e: fbe6e5 call8 400010bc <_X_ets_exit_critical> -40005251: 057256 bnez a2, 400052ac <_XX_unk51ac+0x100> -40005254: f01d retw.n -40005256: ffc9b2 addi a11, a9, -1 -40005259: 083b16 beqz a11, 400052e0 <_XX_unk51ac+0x134> -4000525c: fdc9c2 addi a12, a9, -3 -4000525f: 07dc16 beqz a12, 400052e0 <_XX_unk51ac+0x134> -40005262: 432966 bnei a9, 2, 400052a9 <_XX_unk51ac+0xfd> -40005265: 030ac2 l8ui a12, a10, 3 -40005268: 020ab2 l8ui a11, a10, 2 -4000526b: 11ac80 slli a10, a12, 8 -4000526e: 20aab0 or a10, a10, a11 -40005271: 0314b2 l16ui a11, a4, 6 -40005274: 0162a5 call8 400068a0 <multofup> -40005277: ffca62 addi a6, a10, -1 -4000527a: 02ad mov.n a10, a2 -4000527c: f46060 extui a6, a6, 0, 16 -4000527f: 06bd mov.n a11, a6 -40005281: ffaba5 call8 40004d3c <lldesc_build_chain+0xb0> -40005284: 2a28 l32i.n a2, a10, 8 -40005286: 2a59 s32i.n a5, a10, 8 -40005288: 1224d2 l32i a13, a4, 72 -4000528b: 0abd mov.n a11, a10 -4000528d: 5d8c beqz.n a13, 40005296 <_XX_unk51ac+0xea> -4000528f: 06cd mov.n a12, a6 -40005291: 03ad mov.n a10, a3 -40005293: 000de0 callx8 a13 -40005296: 02bd mov.n a11, a2 -40005298: 2228 l32i.n a2, a2, 8 -4000529a: 2b59 s32i.n a5, a11, 8 -4000529c: 1324d2 l32i a13, a4, 76 -4000529f: 6d8c beqz.n a13, 400052a9 <_XX_unk51ac+0xfd> -400052a1: 0bad mov.n a10, a11 -400052a3: 01a0c2 movi a12, 1 -400052a6: 000de0 callx8 a13 -400052a9: fa7216 beqz a2, 40005254 <_XX_unk51ac+0xa8> -400052ac: 12a8 l32i.n a10, a2, 4 -400052ae: 000a92 l8ui a9, a10, 0 -400052b1: 023d mov.n a3, a2 -400052b3: 349090 extui a9, a9, 0, 4 -400052b6: f9c956 bnez a9, 40005256 <_XX_unk51ac+0xaa> -400052b9: 2228 l32i.n a2, a2, 8 -400052bb: 2359 s32i.n a5, a3, 8 -400052bd: 010ab2 l8ui a11, a10, 1 -400052c0: 1324d2 l32i a13, a4, 76 -400052c3: 118b66 bnei a11, 8, 400052d8 <_XX_unk51ac+0x12c> -400052c6: fdfd16 beqz a13, 400052a9 <_XX_unk51ac+0xfd> -400052c9: 03bd mov.n a11, a3 -400052cb: 20a330 or a10, a3, a3 -400052ce: 01a0c2 movi a12, 1 -400052d1: 000de0 callx8 a13 -400052d4: fff446 j 400052a9 <_XX_unk51ac+0xfd> -400052d7: 03ad00 excw -400052da: ffb625 call8 40004e3c <_XX_unk4d88+0xb4> -400052dd: fff206 j 400052a9 <_XX_unk51ac+0xfd> -400052e0: 030ac2 l8ui a12, a10, 3 -400052e3: 020ab2 l8ui a11, a10, 2 -400052e6: 11ac80 slli a10, a12, 8 -400052e9: 20aab0 or a10, a10, a11 -400052ec: 0314b2 l16ui a11, a4, 6 -400052ef: 015b25 call8 400068a0 <multofup> -400052f2: f460a0 extui a6, a10, 0, 16 -400052f5: 20a330 or a10, a3, a3 -400052f8: 20b660 or a11, a6, a6 -400052fb: ffa425 call8 40004d3c <lldesc_build_chain+0xb0> -400052fe: 2a28 l32i.n a2, a10, 8 -40005300: 2a59 s32i.n a5, a10, 8 -40005302: 1224d2 l32i a13, a4, 72 -40005305: 0abd mov.n a11, a10 -40005307: f9ed16 beqz a13, 400052a9 <_XX_unk51ac+0xfd> -4000530a: 06cd mov.n a12, a6 -4000530c: 03ad mov.n a10, a3 -4000530e: 000de0 callx8 a13 -40005311: ffe506 j 400052a9 <_XX_unk51ac+0xfd> -40005314: ccec bnez.n a12, 40005344 <_XX_unk51ac+0x198> -40005316: ff .byte 0xff -40005317: 3f .byte 0x3f -40005318: 004136 entry a1, 32 -4000531b: fe9961 l32r a6, 40004d80 <_st_0x3fffdc90> -4000531e: 072682 l32i a8, a6, 28 -40005321: 014816 beqz a8, 40005339 <_XX_unk51ac+0x18d> -40005324: fbd825 call8 400010a8 <_X_ets_enter_critical> -40005327: 7628 l32i.n a2, a6, 28 -40005329: 030c movi.n a3, 0 -4000532b: 8639 s32i.n a3, a6, 32 -4000532d: 7639 s32i.n a3, a6, 28 -4000532f: fbd8e5 call8 400010bc <_X_ets_exit_critical> -40005332: 328c beqz.n a2, 40005339 <_XX_unk51ac+0x18d> -40005334: 050c movi.n a5, 0 -40005336: 001246 j 40005383 <_XX_unk51ac+0x1d7> -40005339: f01d retw.n -4000533b: 370000 excw -4000533e: 1c69 s32i.n a6, a12, 4 -40005340: 0b03a2 l8ui a10, a3, 11 -40005343: 11aa80 slli a10, a10, 8 -40005346: 20aab0 or a10, a10, a11 -40005349: 0903b2 l8ui a11, a3, 9 -4000534c: 11aa80 slli a10, a10, 8 -4000534f: 20aab0 or a10, a10, a11 -40005352: 0803b2 l8ui a11, a3, 8 -40005355: 11aa80 slli a10, a10, 8 -40005358: 20aab0 or a10, a10, a11 -4000535b: 96a9 s32i.n a10, a6, 36 -4000535d: 010556 bnez a5, 40005371 <_XX_unk51ac+0x1c5> -40005360: 0103b2 l8ui a11, a3, 1 -40005363: 0a6b17 bbci a11, 1, 40005371 <_XX_unk51ac+0x1c5> -40005366: 001165 call8 4000547c <_c_0x60017e00+0x4> -40005369: 4acc bnez.n a10, 40005371 <_XX_unk51ac+0x1c5> -4000536b: 000f65 call8 40005460 <_XX_unk51ac+0x2b4> -4000536e: 01a052 movi a5, 1 -40005371: 000392 l8ui a9, a3, 0 -40005374: 349090 extui a9, a9, 0, 4 -40005377: 04d916 beqz a9, 400053c8 <_XX_unk51ac+0x21c> -4000537a: 621926 beqi a9, 1, 400053e0 <_XX_unk51ac+0x234> -4000537d: 5f2926 beqi a9, 2, 400053e0 <_XX_unk51ac+0x234> -40005380: fb5216 beqz a2, 40005339 <_XX_unk51ac+0x18d> -40005383: 1238 l32i.n a3, a2, 4 -40005385: 024d mov.n a4, a2 -40005387: 010392 l8ui a9, a3, 1 -4000538a: 0a03b2 l8ui a11, a3, 10 -4000538d: 14a290 extui a10, a9, 2, 2 -40005390: fa9a56 bnez a10, 4000533d <_XX_unk51ac+0x191> -40005393: 96c8 l32i.n a12, a6, 36 -40005395: bc1b addi.n a11, a12, 1 -40005397: 96b9 s32i.n a11, a6, 36 -40005399: 0b03a2 l8ui a10, a3, 11 -4000539c: 0a03b2 l8ui a11, a3, 10 -4000539f: 11aa80 slli a10, a10, 8 -400053a2: 20aab0 or a10, a10, a11 -400053a5: 0903b2 l8ui a11, a3, 9 -400053a8: 11aa80 slli a10, a10, 8 -400053ab: 20aab0 or a10, a10, a11 -400053ae: 0803b2 l8ui a11, a3, 8 -400053b1: 11aa80 slli a10, a10, 8 -400053b4: 20aab0 or a10, a10, a11 -400053b7: a21ac7 beq a10, a12, 4000535d <_XX_unk51ac+0x1b1> -400053ba: 0abd mov.n a11, a10 -400053bc: 02dd mov.n a13, a2 -400053be: ffd5a1 l32r a10, 40005314 <_XX_unk51ac+0x168> -400053c1: fd4425 call8 40002804 <ets_printf> -400053c4: ffe546 j 4000535d <_XX_unk51ac+0x1b1> -400053c7: 04ad00 extui a10, a0, 13, 1 -400053ca: 04bd mov.n a11, a4 -400053cc: 2428 l32i.n a2, a4, 8 -400053ce: 090c movi.n a9, 0 -400053d0: 142682 l32i a8, a6, 80 -400053d3: 2499 s32i.n a9, a4, 8 -400053d5: 0008e0 callx8 a8 -400053d8: 04ad mov.n a10, a4 -400053da: ffb3a5 call8 40004f14 <_XX_unk4f14> -400053dd: ffe7c6 j 40005380 <_XX_unk51ac+0x1d4> -400053e0: 0303a2 l8ui a10, a3, 3 -400053e3: 0203b2 l8ui a11, a3, 2 -400053e6: 11aa80 slli a10, a10, 8 -400053e9: 20aab0 or a10, a10, a11 -400053ec: 0216b2 l16ui a11, a6, 4 -400053ef: 014b25 call8 400068a0 <multofup> -400053f2: 0a7d mov.n a7, a10 -400053f4: 04ad mov.n a10, a4 -400053f6: f4b070 extui a11, a7, 0, 16 -400053f9: ff9425 call8 40004d3c <lldesc_build_chain+0xb0> -400053fc: 2a28 l32i.n a2, a10, 8 -400053fe: 0d0c movi.n a13, 0 -40005400: 2ad9 s32i.n a13, a10, 8 -40005402: 0abd mov.n a11, a10 -40005404: 0020c0 memw -40005407: 0a98 l32i.n a9, a10, 0 -40005409: c32b addi.n a12, a3, 2 -4000540b: 0216d2 l16ui a13, a6, 4 -4000540e: 000ce2 l8ui a14, a12, 0 -40005411: 010cc2 l8ui a12, a12, 1 -40005414: 82d7d0 mull a13, a7, a13 -40005417: 11cc80 slli a12, a12, 8 -4000541a: 20cce0 or a12, a12, a14 -4000541d: c0ccd0 sub a12, a12, a13 -40005420: 0020c0 memw -40005423: fa24d1 l32r a13, 40003cb4 <_c_0x00ffffff> -40005426: 0aa8 l32i.n a10, a10, 0 -40005428: 10aad0 and a10, a10, a13 -4000542b: 41aca0 srli a10, a10, 12 -4000542e: aaca add.n a10, a10, a12 -40005430: caba90 depbits a9, a10, 12, 12 -40005433: 04ad mov.n a10, a4 -40005435: 0020c0 memw -40005438: 152682 l32i a8, a6, 84 -4000543b: 0b99 s32i.n a9, a11, 0 -4000543d: 0008e0 callx8 a8 -40005440: ffcf06 j 40005380 <_XX_unk51ac+0x1d4> -40005443: 413600 srli a3, a0, 6 -40005446: 029800 andb b9, b8, b0 -40005449: 398c beqz.n a9, 40005450 <_XX_unk51ac+0x2a4> -4000544b: 092926 beqi a9, 2, 40005458 <_XX_unk51ac+0x2ac> -4000544e: f01d retw.n -40005450: 12a8 l32i.n a10, a2, 4 -40005452: ffde65 call8 40005238 <_XX_unk51ac+0x8c> -40005455: f01d retw.n -40005457: 12a800 andbc b10, b8, b0 -4000545a: ffebe5 call8 40005318 <_XX_unk51ac+0x16c> -4000545d: f01d retw.n -4000545f: 413600 srli a3, a0, 6 -40005462: a0a200 addx4 a10, a2, a0 -40005465: a0b200 addx4 a11, a2, a0 -40005468: 962505 call0 3ff9b6bc <_start-0x64944> -4000546b: ff .byte 0xff -4000546c: 0abd mov.n a11, a10 -4000546e: ffd5e5 call8 400051cc <_XX_unk51ac+0x20> -40005471: f01d retw.n -40005473: 4e0000 excw -40005476: 006001 l32r a0, 3ffc55f8 <_start-0x3aa08> - -40005478 <_c_0x60017e00>: -40005478: 017e00 slli a7, a14, 32 -4000547b: 413660 srli a3, a6, 6 -4000547e: fd3100 excw -40005481: ff .byte 0xff -40005482: 0020c0 memw -40005485: 942332 l32i a3, a3, 0x250 -40005488: 181c movi.n a8, 17 -4000548a: 0ff377 bbsi a3, 23, 4000549d <_c_0x60017e00+0x25> -4000548d: fffa41 l32r a4, 40005478 <_c_0x60017e00> -40005490: 0020c0 memw -40005493: a52442 l32i a4, a4, 0x294 -40005496: 020c movi.n a2, 0 -40005498: 01c487 bnall a4, a8, 4000549d <_c_0x60017e00+0x25> -4000549b: f01d retw.n -4000549d: 120c movi.n a2, 1 -4000549f: f01d retw.n -400054a1: 000000 ill - -400054a4 <_st_0x3fffdf70>: -400054a4: ffdf70 excw -400054a7: 3f .byte 0x3f -400054a8: 004136 entry a1, 32 -400054ab: fffe51 l32r a5, 400054a4 <_st_0x3fffdf70> -400054ae: b549 s32i.n a4, a5, 44 -400054b0: 6539 s32i.n a3, a5, 24 -400054b2: 5529 s32i.n a2, a5, 20 -400054b4: f01d retw.n - ... - -400054b8 <_c_0x6000ae00>: -400054b8: 00ae00 any8 b0, b8:b9:b10:b11:b12:b13:b14:b15 -400054bb: 000060 excw - -400054bc <_c_0xf0000000>: -400054bc: 000000 ill -400054bf: 0017f0 movsp a15, a7 - -400054c0 <_c_0x02320017>: -400054c0: 320017 bnone a0, a1, 400054f6 <_X_slc_init_attach+0xe> -400054c3: 666602 s32i a0, a6, 0x198 - -400054c4 <_c_0x11116666>: -400054c4: 116666 bnei a6, 6, 400054d9 <_c_0x11116666+0x15> -400054c7: bfff11 l32r a1, 3fff54c4 <_start-0xab3c> -400054ca: ff .byte 0xff -400054cb: ff .byte 0xff -400054cc: ff .byte 0xff -400054cd: fffc01 l32r a0, 400054c0 <_c_0x02320017> -400054d0: 00c800 excw -400054d3: dfb000 excw -400054d6: ff .byte 0xff -400054d7: 3f .byte 0x3f -400054d8: 030003 excw -400054db: fffc00 excw -400054de: fffc bnez.n a15, 40005521 <_X_slc_init_attach+0x39> -400054e0: 800040 add a0, a0, a4 - ... - -400054e4 <_c_0x01110013>: -400054e4: 110013 excw -400054e7: 813601 l32r a0, 3ffe59c0 <_start-0x1a640> - -400054e8 <_X_slc_init_attach>: -400054e8: 008136 entry a1, 64 -400054eb: 029d mov.n a9, a2 -400054ed: 0e2c movi.n a14, 32 -400054ef: ffed21 l32r a2, 400054a4 <_st_0x3fffdf70> -400054f2: 0f0c movi.n a15, 0 -400054f4: 92f9 s32i.n a15, a2, 36 -400054f6: 82f9 s32i.n a15, a2, 32 -400054f8: 72f9 s32i.n a15, a2, 28 -400054fa: b249 s32i.n a4, a2, 44 -400054fc: 6239 s32i.n a3, a2, 24 -400054fe: 056292 s32i a9, a2, 20 -40005501: ffeda1 l32r a10, 400054b8 <_c_0x6000ae00> -40005504: f78bb1 l32r a11, 40003330 <_c_0x3feffe00> -40005507: ffed91 l32r a9, 400054bc <_c_0xf0000000> -4000550a: 0020c0 memw -4000550d: 952bd2 l32i a13, a11, 0x254 -40005510: 20dde0 or a13, a13, a14 -40005513: 0020c0 memw -40005516: 956bd2 s32i a13, a11, 0x254 -40005519: dfafc2 movi a12, -33 -4000551c: 0020c0 memw -4000551f: 952b82 l32i a8, a11, 0x254 -40005522: 1088c0 and a8, a8, a12 -40005525: 0020c0 memw -40005528: 956b82 s32i a8, a11, 0x254 -4000552b: 0545b6 bltui a5, 4, 40005534 <_X_slc_init_attach+0x4c> -4000552e: fcc582 addi a8, a5, -4 -40005531: 11f816 beqz a8, 40005654 <_l_slc_boot_mode_4> -40005534: 0020c0 memw -40005537: 812ab2 l32i a11, a10, 0x204 -4000553a: ffe1c1 l32r a12, 400054c0 <_c_0x02320017> -4000553d: 10bb90 and a11, a11, a9 -40005540: 20bbc0 or a11, a11, a12 -40005543: 0020c0 memw -40005546: 816ab2 s32i a11, a10, 0x204 -40005549: ffdec1 l32r a12, 400054c4 <_c_0x11116666> -4000554c: 0020c0 memw -4000554f: 806ac2 s32i a12, a10, 0x200 -40005552: 0043a5 call8 4000598c <_X_slc_set_host_io_max_window> -40005555: 3c0c movi.n a12, 3 -40005557: ffc741 l32r a4, 40005474 <_XX_unk51ac+0x2c8> -4000555a: ffc731 l32r a3, 40005478 <_c_0x60017e00> -4000555d: 0020c0 memw -40005560: 8023b2 l32i a11, a3, 0x200 -40005563: 20bbc0 or a11, a11, a12 -40005566: 0020c0 memw -40005569: 8063b2 s32i a11, a3, 0x200 -4000556c: ca7c movi.n a10, -4 -4000556e: 0020c0 memw -40005571: 802392 l32i a9, a3, 0x200 -40005574: 1099a0 and a9, a9, a10 -40005577: 0020c0 memw -4000557a: 806392 s32i a9, a3, 0x200 -4000557d: 10a382 movi a8, 0x310 -40005580: 0020c0 memw -40005583: 8023f2 l32i a15, a3, 0x200 -40005586: 20ff80 or a15, a15, a8 -40005589: 0020c0 memw -4000558c: 8063f2 s32i a15, a3, 0x200 -4000558f: ffcee1 l32r a14, 400054c8 <_c_0x11116666+0x4> -40005592: 0020c0 memw -40005595: 8023d2 l32i a13, a3, 0x200 -40005598: 10dde0 and a13, a13, a14 -4000559b: 0020c0 memw -4000559e: 8063d2 s32i a13, a3, 0x200 -400055a1: 00a1c2 movi a12, 0x100 -400055a4: 0020c0 memw -400055a7: 9e24b2 l32i a11, a4, 0x278 -400055aa: 20bbc0 or a11, a11, a12 -400055ad: 0020c0 memw -400055b0: 9e64b2 s32i a11, a4, 0x278 -400055b3: ffc6a1 l32r a10, 400054cc <_c_0x11116666+0x8> -400055b6: ffc691 l32r a9, 400054d0 <_c_0x11116666+0xc> -400055b9: 0020c0 memw -400055bc: c02482 l32i a8, a4, 0x300 -400055bf: 1088a0 and a8, a8, a10 -400055c2: 208890 or a8, a8, a9 -400055c5: 0020c0 memw -400055c8: cb0c movi.n a11, 12 -400055ca: 10c1f2 addi a15, a1, 16 -400055cd: 14c1e2 addi a14, a1, 20 -400055d0: c06482 s32i a8, a4, 0x300 -400055d3: ffc0a1 l32r a10, 400054d4 <_c_0x11116666+0x10> -400055d6: 10a2d2 movi a13, 0x210 -400055d9: 10cac2 addi a12, a10, 16 -400055dc: 0052d2 s16i a13, a2, 0 -400055df: 11e9 s32i.n a14, a1, 4 -400055e1: 01f9 s32i.n a15, a1, 0 -400055e3: 10a2e2 movi a14, 0x210 -400055e6: 01a0f2 movi a15, 1 -400055e9: ff6a25 call8 40004c8c <lldesc_build_chain> -400055ec: ffbb81 l32r a8, 400054d8 <_c_0x11116666+0x14> -400055ef: 0020c0 memw -400055f2: 8023f2 l32i a15, a3, 0x200 -400055f5: 20ff80 or a15, a15, a8 -400055f8: 0020c0 memw -400055fb: 8063f2 s32i a15, a3, 0x200 -400055fe: ffb7e1 l32r a14, 400054dc <_c_0x11116666+0x18> -40005601: 0020c0 memw -40005604: 8023d2 l32i a13, a3, 0x200 -40005607: 10dde0 and a13, a13, a14 -4000560a: 0020c0 memw -4000560d: 8063d2 s32i a13, a3, 0x200 -40005610: 41a8 l32i.n a10, a1, 16 -40005612: 51b8 l32i.n a11, a1, 20 -40005614: 1c0c movi.n a12, 1 -40005616: 001a25 call8 400057b8 <_XX_unk57b8> -40005619: f9b9e1 l32r a14, 40003d00 <_c_0x00800000> -4000561c: fc7c movi.n a12, -1 -4000561e: 0020c0 memw -40005621: b864e2 s32i a14, a4, 0x2e0 -40005624: ffafd1 l32r a13, 400054e0 <_c_0x11116666+0x1c> -40005627: 0020c0 memw -4000562a: b464d2 s32i a13, a4, 0x2d0 -4000562d: 0020c0 memw -40005630: b264c2 s32i a12, a4, 0x2c8 -40005633: 0020c0 memw -40005636: 8463c2 s32i a12, a3, 0x210 -40005639: 00acb2 movi a11, 0xfffffc00 -4000563c: 0a1c movi.n a10, 16 -4000563e: 0020c0 memw -40005641: c62392 l32i a9, a3, 0x318 -40005644: 1099b0 and a9, a9, a11 -40005647: 2099a0 or a9, a9, a10 -4000564a: 0020c0 memw -4000564d: c66392 s32i a9, a3, 0x318 -40005650: f01d retw.n - ... - -40005654 <_l_slc_boot_mode_4>: -40005654: 0020c0 memw -40005657: 812af2 l32i a15, a10, 0x204 -4000565a: ffa281 l32r a8, 400054e4 <_c_0x01110013> -4000565d: 10ff90 and a15, a15, a9 -40005660: 20ff80 or a15, a15, a8 -40005663: 0020c0 memw -40005666: 816af2 s32i a15, a10, 0x204 -40005669: ffb706 j 40005549 <_X_slc_init_attach+0x61> -4000566c: ff .byte 0xff -4000566d: ff .byte 0xff -4000566e: cf .byte 0xcf -4000566f: ff .byte 0xff -40005670: 0058e0 excw -40005673: 840040 extui a0, a4, 0, 9 -40005676: 040a add.n a0, a4, a0 - -40005678 <_X_slc_enable>: -40005678: 004136 entry a1, 32 -4000567b: fffcc1 l32r a12, 4000566c <_l_slc_boot_mode_4+0x18> -4000567e: f72c91 l32r a9, 40003330 <_c_0x3feffe00> -40005681: ff7d21 l32r a2, 40005478 <_c_0x60017e00> -40005684: 0020c0 memw -40005687: 9822b2 l32i a11, a2, 0x260 -4000568a: 10bbc0 and a11, a11, a12 -4000568d: 0020c0 memw -40005690: 9862b2 s32i a11, a2, 0x260 -40005693: 20a0a2 movi a10, 32 -40005696: 0020c0 memw -40005699: 982282 l32i a8, a2, 0x260 -4000569c: 2088a0 or a8, a8, a10 -4000569f: 0020c0 memw -400056a2: 986282 s32i a8, a2, 0x260 -400056a5: 40a0f2 movi a15, 64 -400056a8: 0020c0 memw -400056ab: 9822e2 l32i a14, a2, 0x260 -400056ae: 20eef0 or a14, a14, a15 -400056b1: 0020c0 memw -400056b4: 9862e2 s32i a14, a2, 0x260 -400056b7: fd6c movi.n a13, -17 -400056b9: 0020c0 memw -400056bc: 9822c2 l32i a12, a2, 0x260 -400056bf: 10ccd0 and a12, a12, a13 -400056c2: 0020c0 memw -400056c5: 9862c2 s32i a12, a2, 0x260 -400056c8: f71bb1 l32r a11, 40003334 <_c_0xffff83ff> -400056cb: 00a4a2 movi a10, 0x400 -400056ce: 0020c0 memw -400056d1: 9c2982 l32i a8, a9, 0x270 -400056d4: 1088b0 and a8, a8, a11 -400056d7: 2088a0 or a8, a8, a10 -400056da: 0020c0 memw -400056dd: 1a0c movi.n a10, 1 -400056df: ffe4b1 l32r a11, 40005670 <_l_slc_boot_mode_4+0x1c> -400056e2: 00a0c2 movi a12, 0 -400056e5: 9c6982 s32i a8, a9, 0x270 -400056e8: fb9fe5 call8 400010e8 <_X_ets_isr_attach> -400056eb: ffe2d1 l32r a13, 40005674 <_l_slc_boot_mode_4+0x20> -400056ee: 0020c0 memw -400056f1: 8362d2 s32i a13, a2, 0x20c -400056f4: 2a0c movi.n a10, 2 -400056f6: fba0e5 call8 40001104 <_X_ets_isr_unmask> -400056f9: f01d retw.n - ... - -400056fc <_X_slc_select_tohost_gpio_mode>: -400056fc: 004136 entry a1, 32 -400056ff: ff6931 l32r a3, 400054a4 <_st_0x3fffdf70> -40005702: d329 s32i.n a2, a3, 52 -40005704: f01d retw.n - ... - -40005708 <_X_slc_select_tohost_gpio>: -40005708: 004136 entry a1, 32 -4000570b: 11b2f6 bgeui a2, 16, 40005720 <_X_slc_select_tohost_gpio+0x18> -4000570e: ff6541 l32r a4, 400054a4 <_st_0x3fffdf70> -40005711: 401200 ssl a2 -40005714: 130c movi.n a3, 1 -40005716: a13300 sll a3, a3 -40005719: 1c5432 s16i a3, a4, 56 -4000571c: f01d retw.n -4000571e: 910000 srl a0, a0 -40005721: 0cff61 l32r a6, 3ffc8b20 <_start-0x374e0> -40005724: 8208 l32i.n a0, a2, 32 -40005726: 1c59 s32i.n a5, a12, 4 -40005728: f01d retw.n -4000572a: 000000 ill -4000572d: 00c000 excw - -40005730 <_c_0xff300000>: -40005730: 300000 xor a0, a0, a0 -40005733: ff .byte 0xff - -40005734 <_XX_unk5734>: -40005734: 006136 entry a1, 48 -40005737: 026d mov.n a6, a2 -40005739: 040c movi.n a4, 0 -4000573b: 0020c0 memw -4000573e: 0149 s32i.n a4, a1, 0 -40005740: 06c216 beqz a2, 400057b0 <_XX_unk5734+0x7c> -40005743: 00a052 movi a5, 0 -40005746: f95b71 l32r a7, 40003cb4 <_c_0x00ffffff> -40005749: 108076 loop a0, 4000575d <_XX_unk5734+0x29> -4000574c: 0020c0 memw -4000574f: 0688 l32i.n a8, a6, 0 -40005751: 2668 l32i.n a6, a6, 8 -40005753: 108870 and a8, a8, a7 -40005756: 418c80 srli a8, a8, 12 -40005759: 585a add.n a5, a8, a5 -4000575b: 268c beqz.n a6, 40005761 <_XX_unk5734+0x2d> -4000575d: fffa06 j 40005749 <_XX_unk5734+0x15> -40005760: 20c000 or a12, a0, a0 -40005763: 615200 excw -40005766: 446100 extui a6, a0, 1, 5 -40005769: ff .byte 0xff -4000576a: f96571 l32r a7, 40003d00 <_c_0x00800000> -4000576d: 088076 loop a0, 40005779 <_XX_unk5734+0x45> -40005770: 0020c0 memw -40005773: b92692 l32i a9, a6, 0x2e4 -40005776: 020977 bnone a9, a7, 4000577c <_XX_unk5734+0x48> -40005779: fffc06 j 4000576d <_XX_unk5734+0x39> -4000577c: 0020c0 memw -4000577f: bd6622 s32i a2, a6, 0x2f4 -40005782: 0020c0 memw -40005785: be6632 s32i a3, a6, 0x2f8 -40005788: ffe9b1 l32r a11, 4000572c <_X_slc_select_tohost_gpio+0x24> -4000578b: f72fd1 l32r a13, 40003448 <_c_0x000fffff> -4000578e: 0020c0 memw -40005791: 01c8 l32i.n a12, a1, 0 -40005793: 10ccd0 and a12, a12, a13 -40005796: ffe6d1 l32r a13, 40005730 <_c_0xff300000> -40005799: 0020c0 memw -4000579c: b926a2 l32i a10, a6, 0x2e4 -4000579f: 10aad0 and a10, a10, a13 -400057a2: 20aac0 or a10, a10, a12 -400057a5: 20aab0 or a10, a10, a11 -400057a8: 0020c0 memw -400057ab: b966a2 s32i a10, a6, 0x2e4 -400057ae: f01d retw.n -400057b0: 050c movi.n a5, 0 -400057b2: ffeac6 j 40005761 <_XX_unk5734+0x2d> -400057b5: 000000 ill - -400057b8 <_XX_unk57b8>: -400057b8: 004136 entry a1, 32 -400057bb: ff2fb1 l32r a11, 40005478 <_c_0x60017e00> -400057be: f93ea1 l32r a10, 40003cb8 <_c_0x01000000> -400057c1: 088076 loop a0, 400057cd <_XX_unk57b8+0x15> -400057c4: 0020c0 memw -400057c7: b92b82 l32i a8, a11, 0x2e4 -400057ca: 0208a7 bnone a8, a10, 400057d0 <_XX_unk57b8+0x18> -400057cd: fffc06 j 400057c1 <_XX_unk57b8+0x9> -400057d0: 0020c0 memw -400057d3: bb6b22 s32i a2, a11, 0x2ec -400057d6: 0020c0 memw -400057d9: bc6b32 s32i a3, a11, 0x2f0 -400057dc: 0020c0 memw -400057df: b92b92 l32i a9, a11, 0x2e4 -400057e2: 2099a0 or a9, a9, a10 -400057e5: 0020c0 memw -400057e8: b96b92 s32i a9, a11, 0x2e4 -400057eb: f4a040 extui a10, a4, 0, 16 -400057ee: 001d65 call8 400059c4 <_X_slc_add_credits> -400057f1: f01d retw.n - ... - -400057f4 <_XX_unk57f4>: -400057f4: 004136 entry a1, 32 -400057f7: 00a082 movi a8, 0 -400057fa: ff1f61 l32r a6, 40005478 <_c_0x60017e00> -400057fd: 0020c0 memw -40005800: b92642 l32i a4, a6, 0x2e4 -40005803: 3974b7 bbci a4, 27, 40005840 <_XX_unk57f4+0x4c> -40005806: f951a1 l32r a10, 40003d4c <_c_0x02000000> -40005809: 0020c0 memw -4000580c: b92692 l32i a9, a6, 0x2e4 -4000580f: 2099a0 or a9, a9, a10 -40005812: 0020c0 memw -40005815: b96692 s32i a9, a6, 0x2e4 -40005818: 0020c0 memw -4000581b: c12672 l32i a7, a6, 0x304 -4000581e: 006272 s32i a7, a2, 0 -40005821: 0020c0 memw -40005824: f93721 l32r a2, 40003d00 <_c_0x00800000> -40005827: c22672 l32i a7, a6, 0x308 -4000582a: 006372 s32i a7, a3, 0 -4000582d: 088076 loop a0, 40005839 <_XX_unk57f4+0x45> -40005830: 0020c0 memw -40005833: b926b2 l32i a11, a6, 0x2e4 -40005836: 020b27 bnone a11, a2, 4000583c <_XX_unk57f4+0x48> -40005839: fffc06 j 4000582d <_XX_unk57f4+0x39> -4000583c: 2789 s32i.n a8, a7, 8 -4000583e: f01d retw.n -40005840: 0289 s32i.n a8, a2, 0 -40005842: 0389 s32i.n a8, a3, 0 -40005844: f01d retw.n - ... - -40005848 <_XX_unk5848>: -40005848: 004136 entry a1, 32 -4000584b: ff0b61 l32r a6, 40005478 <_c_0x60017e00> -4000584e: 0020c0 memw -40005851: b92642 l32i a4, a6, 0x2e4 -40005854: 7474c7 bbci a4, 28, 400058cc <_XX_unk5848+0x84> -40005857: f9dd91 l32r a9, 40003fcc <_c_0x04000000> -4000585a: 0020c0 memw -4000585d: b92682 l32i a8, a6, 0x2e4 -40005860: 208890 or a8, a8, a9 -40005863: 0020c0 memw -40005866: b96682 s32i a8, a6, 0x2e4 -40005869: 0020c0 memw -4000586c: bf2672 l32i a7, a6, 0x2fc -4000586f: 0279 s32i.n a7, a2, 0 -40005871: 0020c0 memw -40005874: f91171 l32r a7, 40003cb8 <_c_0x01000000> -40005877: c02682 l32i a8, a6, 0x300 -4000587a: 006382 s32i a8, a3, 0 -4000587d: 088076 loop a0, 40005889 <_XX_unk5848+0x41> -40005880: 0020c0 memw -40005883: b926a2 l32i a10, a6, 0x2e4 -40005886: 040a77 bnone a10, a7, 4000588e <_XX_unk5848+0x46> -40005889: fffc06 j 4000587d <_XX_unk5848+0x35> -4000588c: 0c0000 excw -4000588f: 286906 j 4000fa37 <__umoddi3+0x8bd3> -40005892: 002222 l32i a2, a2, 0 -40005895: f2ac beqz.n a2, 400058c8 <_XX_unk5848+0x80> -40005897: fcfa51 l32r a5, 40004c80 <_c_0xbfffffff> -4000589a: ebb931 l32r a3, 40000780 <_c_0x7fffffff> -4000589d: 118076 loop a0, 400058b2 <_XX_unk5848+0x6a> -400058a0: 0020c0 memw -400058a3: 02b8 l32i.n a11, a2, 0 -400058a5: 10bb30 and a11, a11, a3 -400058a8: 15beb0 extui a11, a11, 30, 2 -400058ab: 061b26 beqi a11, 1, 400058b5 <_XX_unk5848+0x6d> -400058ae: 2228 l32i.n a2, a2, 8 -400058b0: 429c beqz.n a2, 400058c8 <_XX_unk5848+0x80> -400058b2: fff9c6 j 4000589d <_XX_unk5848+0x55> -400058b5: 0020c0 memw -400058b8: 02c8 l32i.n a12, a2, 0 -400058ba: 10cc50 and a12, a12, a5 -400058bd: 20cc60 or a12, a12, a6 -400058c0: 0020c0 memw -400058c3: 02c9 s32i.n a12, a2, 0 -400058c5: fff946 j 400058ae <_XX_unk5848+0x66> -400058c8: 020c movi.n a2, 0 -400058ca: f01d retw.n -400058cc: f27c movi.n a2, -1 -400058ce: f01d retw.n -400058d0: ff .byte 0xff -400058d1: ff .byte 0xff -400058d2: fe .byte 0xfe -400058d3: ff .byte 0xff -400058d4: 020000 andb b0, b0, b0 -400058d7: 000004 excw -400058da: 000001 l32r a0, 3ffc58dc <_start-0x3a724> -400058dd: 000080 ret -400058e0: 004136 entry a1, 32 -400058e3: fffb71 l32r a7, 400058d0 <_XX_unk5848+0x88> -400058e6: fffb51 l32r a5, 400058d4 <_XX_unk5848+0x8c> -400058e9: fffb61 l32r a6, 400058d8 <_XX_unk5848+0x90> -400058ec: fee331 l32r a3, 40005478 <_c_0x60017e00> -400058ef: feed41 l32r a4, 400054a4 <_st_0x3fffdf70> -400058f2: 0020c0 memw -400058f5: 822322 l32i a2, a3, 0x208 -400058f8: 74b8 l32i.n a11, a4, 28 -400058fa: 07e216 beqz a2, 4000597c <_XX_unk5848+0x134> -400058fd: 4b8c beqz.n a11, 40005905 <_XX_unk5848+0xbd> -400058ff: 20a220 or a10, a2, a2 -40005902: 000be0 callx8 a11 -40005905: 0c0527 bnone a5, a2, 40005915 <_XX_unk5848+0xcd> -40005908: 0020c0 memw -4000590b: 846352 s32i a5, a3, 0x210 -4000590e: 5488 l32i.n a8, a4, 20 -40005910: b4a8 l32i.n a10, a4, 44 -40005912: 0008e0 callx8 a8 -40005915: 1062f7 bbci a2, 15, 40005929 <_XX_unk5848+0xe1> -40005918: 0020c0 memw -4000591b: fff091 l32r a9, 400058dc <_XX_unk5848+0x94> -4000591e: 846392 s32i a9, a3, 0x210 -40005921: 6488 l32i.n a8, a4, 24 -40005923: 0b24a2 l32i a10, a4, 44 -40005926: 0008e0 callx8 a8 -40005929: 1c7207 bbci a2, 16, 40005949 <_XX_unk5848+0x101> -4000592c: d498 l32i.n a9, a4, 52 -4000592e: 2a2926 beqi a9, 2, 4000595c <_XX_unk5848+0x114> -40005931: 373926 beqi a9, 3, 4000596c <_XX_unk5848+0x124> -40005934: 0020c0 memw -40005937: 8323a2 l32i a10, a3, 0x20c -4000593a: 10aa70 and a10, a10, a7 -4000593d: 0020c0 memw -40005940: 8363a2 s32i a10, a3, 0x20c -40005943: 0020c0 memw -40005946: 846362 s32i a6, a3, 0x210 -40005949: 2ff237 bbsi a2, 19, 4000597c <_XX_unk5848+0x134> -4000594c: 2ce2a7 bbsi a2, 10, 4000597c <_XX_unk5848+0x134> -4000594f: 84b8 l32i.n a11, a4, 32 -40005951: f9db16 beqz a11, 400058f2 <_XX_unk5848+0xaa> -40005954: 02ad mov.n a10, a2 -40005956: 000be0 callx8 a11 -40005959: ffe546 j 400058f2 <_XX_unk5848+0xaa> -4000595c: 1c14b2 l16ui a11, a4, 56 -4000595f: 0020c0 memw -40005962: edf3c1 l32r a12, 40001130 <_c_0x60003e00> -40005965: 836cb2 s32i a11, a12, 0x20c -40005968: fff206 j 40005934 <_XX_unk5848+0xec> -4000596b: 14d200 extui a13, a0, 2, 2 -4000596e: c01c movi.n a0, 28 -40005970: e10020 excw -40005973: ef .byte 0xef -40005974: d2ed excw -40005976: 6e .byte 0x6e -40005977: ee0682 l8ui a8, a6, 238 -4000597a: ff .byte 0xff -4000597b: 94b800 extui a11, a0, 8, 10 -4000597e: 3b8c beqz.n a11, 40005985 <_XX_unk5848+0x13d> -40005980: 0a0c movi.n a10, 0 -40005982: 000be0 callx8 a11 -40005985: f01d retw.n - ... - -40005988 <_c_0xfffff0c0>: -40005988: fff0c0 excw -4000598b: ff .byte 0xff - -4000598c <_X_slc_set_host_io_max_window>: -4000598c: 004136 entry a1, 32 -4000598f: feba31 l32r a3, 40005478 <_c_0x60017e00> -40005992: 0020c0 memw -40005995: fffc41 l32r a4, 40005988 <_c_0xfffff0c0> -40005998: 9d2322 l32i a2, a3, 0x274 -4000599b: 102240 and a2, a2, a4 -4000599e: 20a742 movi a4, 0x720 -400059a1: 202240 or a2, a2, a4 -400059a4: 0020c0 memw -400059a7: 9d6322 s32i a2, a3, 0x274 -400059aa: f01d retw.n - -400059ac <_X_slc_init_credit>: -400059ac: 004136 entry a1, 32 -400059af: ede381 l32r a8, 4000113c <_c_0x1000> -400059b2: feb191 l32r a9, 40005478 <_c_0x60017e00> -400059b5: 0020c0 memw -400059b8: 1a0c movi.n a10, 1 -400059ba: 956982 s32i a8, a9, 0x254 -400059bd: 000065 call8 400059c4 <_X_slc_add_credits> -400059c0: f01d retw.n - ... - -400059c4 <_X_slc_add_credits>: -400059c4: 004136 entry a1, 32 -400059c7: f52331 l32r a3, 40002e54 <_c_0x3fffdb00+0x4> -400059ca: feab41 l32r a4, 40005478 <_c_0x60017e00> -400059cd: 0ab230 depbits a3, a2, 0, 12 -400059d0: 0020c0 memw -400059d3: 956432 s32i a3, a4, 0x254 -400059d6: f01d retw.n - -400059d8 <_X_xtos_set_interrupt_handler_arg>: -400059d8: 004136 entry a1, 32 -400059db: 02e296 bltz a2, 40005a0d <_X_xtos_set_interrupt_handler_arg+0x35> -400059de: 2bc2e6 bgei a2, 32, 40005a0d <_X_xtos_set_interrupt_handler_arg+0x35> -400059e1: eb6851 l32r a5, 40000784 <_c_0x7fffffff+0x4> -400059e4: 1182d0 slli a8, a2, 3 -400059e7: 525a add.n a5, a2, a5 -400059e9: 000552 l8ui a5, a5, 0 -400059ec: eb5471 l32r a7, 4000073c <_c_0x80000000+0x4> -400059ef: 1a75f6 bgeui a5, 7, 40005a0d <_X_xtos_set_interrupt_handler_arg+0x35> -400059f2: c07780 sub a7, a7, a8 -400059f5: eb6481 l32r a8, 40000788 <_c_0x7fffffff+0x8> -400059f8: 3e2762 l32i a6, a7, 248 -400059fb: 23dc bnez.n a3, 40005a11 <_X_xtos_set_interrupt_handler_arg+0x39> -400059fd: 3e6782 s32i a8, a7, 248 -40005a00: 3f6722 s32i a2, a7, 252 -40005a03: c09680 sub a9, a6, a8 -40005a06: 020c movi.n a2, 0 -40005a08: 932690 movnez a2, a6, a9 -40005a0b: f01d retw.n -40005a0d: 020c movi.n a2, 0 -40005a0f: f01d retw.n -40005a11: 3e6732 s32i a3, a7, 248 -40005a14: 3f6742 s32i a4, a7, 252 -40005a17: c0a680 sub a10, a6, a8 -40005a1a: 020c movi.n a2, 0 -40005a1c: 9326a0 movnez a2, a6, a10 -40005a1f: f01d retw.n -40005a21: 000000 ill - -40005a24 <_X_xtos_set_interrupt_handler>: -40005a24: 004136 entry a1, 32 -40005a27: 03bd mov.n a11, a3 -40005a29: 02ad mov.n a10, a2 -40005a2b: 02cd mov.n a12, a2 -40005a2d: fffaa5 call8 400059d8 <_X_xtos_set_interrupt_handler_arg> -40005a30: 0a2d mov.n a2, a10 -40005a32: f01d retw.n - -40005a34 <_X_xtos_ints_on>: -40005a34: 002136 entry a1, 16 -40005a37: eb3f41 l32r a4, 40000734 <_c_0x3fffc210> -40005a3a: 006670 rsil a7, 6 -40005a3d: 0438 l32i.n a3, a4, 0 -40005a3f: 1468 l32i.n a6, a4, 4 -40005a41: 205320 or a5, a3, a2 -40005a44: 0459 s32i.n a5, a4, 0 -40005a46: 105560 and a5, a5, a6 -40005a49: 13e450 wsr.intenable a5 -40005a4c: 13e670 wsr.ps a7 -40005a4f: 002010 rsync -40005a52: 032d mov.n a2, a3 -40005a54: f01d retw.n - ... - -40005a58 <_X_xtos_ints_off>: -40005a58: 002136 entry a1, 16 -40005a5b: eb3641 l32r a4, 40000734 <_c_0x3fffc210> -40005a5e: 006670 rsil a7, 6 -40005a61: 0438 l32i.n a3, a4, 0 -40005a63: 1468 l32i.n a6, a4, 4 -40005a65: 205320 or a5, a3, a2 -40005a68: 305520 xor a5, a5, a2 -40005a6b: 0459 s32i.n a5, a4, 0 -40005a6d: 105560 and a5, a5, a6 -40005a70: 13e450 wsr.intenable a5 -40005a73: 13e670 wsr.ps a7 -40005a76: 002010 rsync -40005a79: 032d mov.n a2, a3 -40005a7b: f01d retw.n -40005a7d: 000000 ill - -40005a80 <_XX_xtos_exc_unk5a80>: -40005a80: 034820 rsr.windowbase a2 -40005a83: 221b addi.n a2, a2, 1 -40005a85: 400200 ssr a2 -40005a88: 034930 rsr.windowstart a3 -40005a8b: 912030 srl a2, a3 -40005a8e: a13300 sll a3, a3 -40005a91: 0bf3d6 bgez a3, 40005b54 <_XX_xtos_exc_unk5a80+0xd4> -40005a94: f53030 extui a3, a3, 16, 16 -40005a97: 202230 or a2, a2, a3 -40005a9a: 603020 neg a3, a2 -40005a9d: 103320 and a3, a3, a2 -40005aa0: 40f330 nsau a3, a3 -40005aa3: 401300 ssl a3 -40005aa6: 912020 srl a2, a2 -40005aa9: 134920 wsr.windowstart a2 -40005aac: 034820 rsr.windowbase a2 -40005aaf: 1fc222 addi a2, a2, 31 -40005ab2: c03230 sub a3, a2, a3 -40005ab5: 134830 wsr.windowbase a3 -40005ab8: 002010 rsync -40005abb: 034920 rsr.windowstart a2 -40005abe: 07a216 beqz a2, 40005b3c <_XX_xtos_exc_unk5a80+0xbc> -40005ac1: 08e207 bbsi a2, 0, 40005acd <_XX_xtos_exc_unk5a80+0x4d> -40005ac4: 19e217 bbsi a2, 1, 40005ae1 <_XX_xtos_exc_unk5a80+0x61> -40005ac7: 3ae227 bbsi a2, 2, 40005b05 <_XX_xtos_exc_unk5a80+0x85> -40005aca: 0022c6 j 40005b59 <_XX_xtos_exc_unk5a80+0xd9> -40005acd: f0c932 addi a3, a9, -16 -40005ad0: 0349 s32i.n a4, a3, 0 -40005ad2: 1359 s32i.n a5, a3, 4 -40005ad4: 2369 s32i.n a6, a3, 8 -40005ad6: 3379 s32i.n a7, a3, 12 -40005ad8: 416120 srli a6, a2, 1 -40005adb: 408010 rotw 1 -40005ade: fff706 j 40005abe <_XX_xtos_exc_unk5a80+0x3e> -40005ae1: f0cd32 addi a3, a13, -16 -40005ae4: 0349 s32i.n a4, a3, 0 -40005ae6: 1359 s32i.n a5, a3, 4 -40005ae8: 2369 s32i.n a6, a3, 8 -40005aea: 3379 s32i.n a7, a3, 12 -40005aec: f4c532 addi a3, a5, -12 -40005aef: 0338 l32i.n a3, a3, 0 -40005af1: e0c332 addi a3, a3, -32 -40005af4: 0389 s32i.n a8, a3, 0 -40005af6: 1399 s32i.n a9, a3, 4 -40005af8: 23a9 s32i.n a10, a3, 8 -40005afa: 33b9 s32i.n a11, a3, 12 -40005afc: 41a220 srli a10, a2, 2 -40005aff: 408020 rotw 2 -40005b02: ffee06 j 40005abe <_XX_xtos_exc_unk5a80+0x3e> -40005b05: 408010 rotw 1 -40005b08: f0cdd2 addi a13, a13, -16 -40005b0b: 0d09 s32i.n a0, a13, 0 -40005b0d: 1d19 s32i.n a1, a13, 4 -40005b0f: 2d29 s32i.n a2, a13, 8 -40005b11: 3d39 s32i.n a3, a13, 12 -40005b13: f4c132 addi a3, a1, -12 -40005b16: 0338 l32i.n a3, a3, 0 -40005b18: 10cdd2 addi a13, a13, 16 -40005b1b: d0c332 addi a3, a3, -48 -40005b1e: 0349 s32i.n a4, a3, 0 -40005b20: 1359 s32i.n a5, a3, 4 -40005b22: 2369 s32i.n a6, a3, 8 -40005b24: 3379 s32i.n a7, a3, 12 -40005b26: 4389 s32i.n a8, a3, 16 -40005b28: 5399 s32i.n a9, a3, 20 -40005b2a: 63a9 s32i.n a10, a3, 24 -40005b2c: 73b9 s32i.n a11, a3, 28 -40005b2e: 4080f0 rotw -1 -40005b31: 41e320 srli a14, a2, 3 -40005b34: 408030 rotw 3 -40005b37: ffe0c6 j 40005abe <_XX_xtos_exc_unk5a80+0x3e> -40005b3a: 100000 and a0, a0, a0 -40005b3d: 204080 or a4, a0, a8 -40005b40: 0348 l32i.n a4, a3, 0 -40005b42: 401200 ssl a2 -40005b45: 120c movi.n a2, 1 -40005b47: a12200 sll a2, a2 -40005b4a: 134920 wsr.windowstart a2 -40005b4d: 002010 rsync -40005b50: 020c movi.n a2, 0 -40005b52: f00d ret.n -40005b54: 120c movi.n a2, 1 -40005b56: f00d ret.n -40005b58: 22f000 orb b15, b0, b0 -40005b5b: c22211 l32r a1, 3fff63e4 <_start-0x9c1c> -40005b5e: 483001 l32r a0, 3ffd7c20 <_start-0x283e0> -40005b61: e2f703 excw -40005b64: 0b0a add.n a0, a11, a0 -40005b66: 22f033 excw -40005b69: 62f711 l32r a1, 3ffde748 <_start-0x218b8> -40005b6c: 3030f7 bltu a0, a15, 40005ba0 <_XX_xtos_exc_unk5b94+0xc> -40005b6f: 130034 excw -40005b72: 320040 orbc b0, b0, b4 -40005b75: 223011 l32r a1, 3ffce438 <_start-0x31bc8> -40005b78: 202081 l32r a8, 3ffcdbf8 <_start-0x32408> -40005b7b: 4920f4 mula.da.hl.ldinc m2, a0, m0, a15 -40005b7e: 033013 excw -40005b81: 022c03 excw -40005b84: c03230 sub a3, a2, a3 -40005b87: 134830 wsr.windowbase a3 -40005b8a: 002010 rsync -40005b8d: 220c movi.n a2, 2 -40005b8f: f00d ret.n -40005b91: 000000 ill - -40005b94 <_XX_xtos_exc_unk5b94>: -40005b94: 002136 entry a1, 16 -40005b97: eafd61 l32r a6, 4000078c <_c_0x7fffffff+0xc> -40005b9a: 03e650 rsr.ps a5 -40005b9d: 004d mov.n a4, a0 -40005b9f: 102560 and a2, a5, a6 -40005ba2: 223b addi.n a2, a2, 3 -40005ba4: 13e620 wsr.ps a2 -40005ba7: 002010 rsync -40005baa: ffed45 call0 40005a80 <_XX_xtos_exc_unk5a80> -40005bad: 040d mov.n a0, a4 -40005baf: 13e650 wsr.ps a5 -40005bb2: 002010 rsync -40005bb5: f01d retw.n - ... - -40005bb8 <strcmp>: -40005bb8: 002136 entry a1, 16 -40005bbb: 000282 l8ui a8, a2, 0 -40005bbe: 000392 l8ui a9, a3, 0 -40005bc1: 3a0c movi.n a10, 3 -40005bc3: 529897 bne a8, a9, 40005c19 <strcmp+0x61> -40005bc6: 20b230 or a11, a2, a3 -40005bc9: 530ba7 bnone a11, a10, 40005c20 <strcmp+0x68> -40005bcc: 30b230 xor a11, a2, a3 -40005bcf: 318ba7 bany a11, a10, 40005c04 <strcmp+0x4c> -40005bd2: 221b addi.n a2, a2, 1 -40005bd4: 0b2816 beqz a8, 40005c8a <strcmp+0xd2> -40005bd7: 331b addi.n a3, a3, 1 -40005bd9: 4302a7 bnone a2, a10, 40005c20 <strcmp+0x68> -40005bdc: 000282 l8ui a8, a2, 0 -40005bdf: 000392 l8ui a9, a3, 0 -40005be2: 221b addi.n a2, a2, 1 -40005be4: 319897 bne a8, a9, 40005c19 <strcmp+0x61> -40005be7: 09f816 beqz a8, 40005c8a <strcmp+0xd2> -40005bea: 331b addi.n a3, a3, 1 -40005bec: 3002a7 bnone a2, a10, 40005c20 <strcmp+0x68> -40005bef: 000282 l8ui a8, a2, 0 -40005bf2: 000392 l8ui a9, a3, 0 -40005bf5: 221b addi.n a2, a2, 1 -40005bf7: 1e9897 bne a8, a9, 40005c19 <strcmp+0x61> -40005bfa: 08c816 beqz a8, 40005c8a <strcmp+0xd2> -40005bfd: 331b addi.n a3, a3, 1 -40005bff: 000746 j 40005c20 <strcmp+0x68> -40005c02: 0c0000 excw -40005c05: 7608 l32i.n a0, a6, 28 -40005c07: 0f88 l32i.n a8, a15, 0 -40005c09: 000282 l8ui a8, a2, 0 -40005c0c: 000392 l8ui a9, a3, 0 -40005c0f: 221b addi.n a2, a2, 1 -40005c11: 049897 bne a8, a9, 40005c19 <strcmp+0x61> -40005c14: 331b addi.n a3, a3, 1 -40005c16: fff816 beqz a8, 40005c19 <strcmp+0x61> -40005c19: c02890 sub a2, a8, a9 -40005c1c: f01d retw.n -40005c1e: 410000 srli a0, a0, 0 -40005c21: eadc bnez.n a10, 40005c43 <strcmp+0x8b> -40005c23: eadf71 l32r a7, 400007a0 <_c_0x00ff0000+0x8> -40005c26: 238076 loop a0, 40005c4d <strcmp+0x95> -40005c29: 0288 l32i.n a8, a2, 0 -40005c2b: 0398 l32i.n a9, a3, 0 -40005c2d: 1158f0 slli a5, a8, 1 -40005c30: 5c9897 bne a8, a9, 40005c90 <strcmp+0xd8> -40005c33: 209850 or a9, a8, a5 -40005c36: 1ac977 bnall a9, a7, 40005c54 <strcmp+0x9c> -40005c39: 1288 l32i.n a8, a2, 4 -40005c3b: 1398 l32i.n a9, a3, 4 -40005c3d: 1158f0 slli a5, a8, 1 -40005c40: 4c9897 bne a8, a9, 40005c90 <strcmp+0xd8> -40005c43: 209850 or a9, a8, a5 -40005c46: 06c977 bnall a9, a7, 40005c50 <strcmp+0x98> -40005c49: 228b addi.n a2, a2, 8 -40005c4b: 338b addi.n a3, a3, 8 -40005c4d: fff546 j 40005c26 <strcmp+0x6e> -40005c50: 224b addi.n a2, a2, 4 -40005c52: 334b addi.n a3, a3, 4 -40005c54: 320847 bnone a8, a4, 40005c8a <strcmp+0xd2> -40005c57: eacf51 l32r a5, 40000794 <_c_0x7fffffff+0x14> -40005c5a: eacf61 l32r a6, 40000798 <_c_0x00ff0000> -40005c5d: 290857 bnone a8, a5, 40005c8a <strcmp+0xd2> -40005c60: eacf71 l32r a7, 4000079c <_c_0x00ff0000+0x4> -40005c63: 230867 bnone a8, a6, 40005c8a <strcmp+0xd2> -40005c66: 200877 bnone a8, a7, 40005c8a <strcmp+0xd2> -40005c69: 224b addi.n a2, a2, 4 -40005c6b: 334b addi.n a3, a3, 4 -40005c6d: 198076 loop a0, 40005c8a <strcmp+0xd2> -40005c70: 0288 l32i.n a8, a2, 0 -40005c72: 0398 l32i.n a9, a3, 0 -40005c74: 224b addi.n a2, a2, 4 -40005c76: 169897 bne a8, a9, 40005c90 <strcmp+0xd8> -40005c79: 0d0847 bnone a8, a4, 40005c8a <strcmp+0xd2> -40005c7c: 0a0857 bnone a8, a5, 40005c8a <strcmp+0xd2> -40005c7f: 070867 bnone a8, a6, 40005c8a <strcmp+0xd2> -40005c82: 040877 bnone a8, a7, 40005c8a <strcmp+0xd2> -40005c85: 334b addi.n a3, a3, 4 -40005c87: fff886 j 40005c6d <strcmp+0xb5> -40005c8a: 020c movi.n a2, 0 -40005c8c: f01d retw.n -40005c8e: 900000 addx2 a0, a0, a0 -40005c91: 3028 l32i.n a2, a0, 12 -40005c93: 218247 bany a2, a4, 40005cb8 <strcmp+0x100> -40005c96: eabf51 l32r a5, 40000794 <_c_0x7fffffff+0x14> -40005c99: ed0847 bnone a8, a4, 40005c8a <strcmp+0xd2> -40005c9c: 248257 bany a2, a5, 40005cc4 <strcmp+0x10c> -40005c9f: eabe61 l32r a6, 40000798 <_c_0x00ff0000> -40005ca2: e40857 bnone a8, a5, 40005c8a <strcmp+0xd2> -40005ca5: 278267 bany a2, a6, 40005cd0 <strcmp+0x118> -40005ca8: de0867 bnone a8, a6, 40005c8a <strcmp+0xd2> -40005cab: 75a880 extui a10, a8, 24, 8 -40005cae: 75b890 extui a11, a9, 24, 8 -40005cb1: c02ab0 sub a2, a10, a11 -40005cb4: f01d retw.n -40005cb6: 800000 add a0, a0, a0 -40005cb9: 9074a0 addx2 a7, a4, a10 -40005cbc: b074b0 addx8 a7, a4, a11 -40005cbf: c02a add.n a12, a0, a2 -40005cc1: f01d retw.n -40005cc3: a88000 excw -40005cc6: b89074 excw -40005cc9: 2ab074 excw -40005ccc: f01dc0 subx8 a1, a13, a12 -40005ccf: a08000 addx4 a8, a0, a0 -40005cd2: b09075 call12 3ffb65d8 <_start-0x49a28> -40005cd5: 2ab075 call12 400307dc <__bss_start+0x207dc> -40005cd8: f01dc0 subx8 a1, a13, a12 - ... - -40005cdc <strcpy>: -40005cdc: 002136 entry a1, 16 -40005cdf: 20a220 or a10, a2, a2 -40005ce2: ffa042 movi a4, 255 -40005ce5: eaab51 l32r a5, 40000794 <_c_0x7fffffff+0x14> -40005ce8: eaac61 l32r a6, 40000798 <_c_0x00ff0000> -40005ceb: eaac71 l32r a7, 4000079c <_c_0x00ff0000+0x4> -40005cee: 0be307 bbsi a3, 0, 40005cfd <strcpy+0x21> -40005cf1: 17e317 bbsi a3, 1, 40005d0c <strcpy+0x30> -40005cf4: 380c movi.n a8, 3 -40005cf6: 2a0a87 bnone a10, a8, 40005d24 <strcpy+0x48> -40005cf9: 0016c6 j 40005d58 <strcpy+0x7c> -40005cfc: 038200 excw -40005cff: 331b00 clamps a1, a11, 7 -40005d02: 004a82 s8i a8, a10, 0 -40005d05: 889c beqz.n a8, 40005d21 <strcpy+0x45> -40005d07: aa1b addi.n a10, a10, 1 -40005d09: e76317 bbci a3, 1, 40005cf4 <strcpy+0x18> -40005d0c: 000382 l8ui a8, a3, 0 -40005d0f: 004a82 s8i a8, a10, 0 -40005d12: b88c beqz.n a8, 40005d21 <strcpy+0x45> -40005d14: 010382 l8ui a8, a3, 1 -40005d17: 332b addi.n a3, a3, 2 -40005d19: 014a82 s8i a8, a10, 1 -40005d1c: aa2b addi.n a10, a10, 2 -40005d1e: fd2856 bnez a8, 40005cf4 <strcpy+0x18> -40005d21: f01d retw.n -40005d23: 080c00 excw -40005d26: 138876 loop a8, 40005d3d <strcpy+0x61> -40005d29: 0388 l32i.n a8, a3, 0 -40005d2b: 334b addi.n a3, a3, 4 -40005d2d: 0f0847 bnone a8, a4, 40005d40 <strcpy+0x64> -40005d30: 110857 bnone a8, a5, 40005d45 <strcpy+0x69> -40005d33: 150867 bnone a8, a6, 40005d4c <strcpy+0x70> -40005d36: 0a89 s32i.n a8, a10, 0 -40005d38: 010877 bnone a8, a7, 40005d3d <strcpy+0x61> -40005d3b: aa4b addi.n a10, a10, 4 -40005d3d: f01d retw.n -40005d3f: 4a8200 depbits a0, a2, 4, 9 -40005d42: f01d00 subx8 a1, a13, a0 -40005d45: 005a82 s16i a8, a10, 0 -40005d48: f01d retw.n -40005d4a: 820000 mull a0, a0, a0 -40005d4d: 005a add.n a0, a0, a5 -40005d4f: 080c movi.n a8, 0 -40005d51: 024a82 s8i a8, a10, 2 -40005d54: f01d retw.n -40005d56: 0c0000 excw -40005d59: 7608 l32i.n a0, a6, 28 -40005d5b: 0c88 l32i.n a8, a12, 0 -40005d5d: 000382 l8ui a8, a3, 0 -40005d60: 331b addi.n a3, a3, 1 -40005d62: 004a82 s8i a8, a10, 0 -40005d65: aa1b addi.n a10, a10, 1 -40005d67: fff816 beqz a8, 40005d6a <strcpy+0x8e> -40005d6a: f01d retw.n - -40005d6c <strlen>: -40005d6c: 002136 entry a1, 16 -40005d6f: fcc232 addi a3, a2, -4 -40005d72: ffa042 movi a4, 255 -40005d75: ea8751 l32r a5, 40000794 <_c_0x7fffffff+0x14> -40005d78: ea8861 l32r a6, 40000798 <_c_0x00ff0000> -40005d7b: ea8871 l32r a7, 4000079c <_c_0x00ff0000+0x4> -40005d7e: 06e207 bbsi a2, 0, 40005d88 <strlen+0x1c> -40005d81: 0de217 bbsi a2, 1, 40005d92 <strlen+0x26> -40005d84: 000706 j 40005da4 <strlen+0x38> -40005d87: 038200 excw -40005d8a: 331b04 excw -40005d8d: 88ac beqz.n a8, 40005db9 <strlen+0x4d> -40005d8f: 116317 bbci a3, 1, 40005da4 <strlen+0x38> -40005d92: 332b addi.n a3, a3, 2 -40005d94: 0388 l32i.n a8, a3, 0 -40005d96: 2e0867 bnone a8, a6, 40005dc8 <strlen+0x5c> -40005d99: 078877 bany a8, a7, 40005da4 <strlen+0x38> -40005d9c: 333b addi.n a3, a3, 3 -40005d9e: c02320 sub a2, a3, a2 -40005da1: f01d retw.n -40005da3: 080c00 excw -40005da6: 0f8876 loop a8, 40005db9 <strlen+0x4d> -40005da9: 1388 l32i.n a8, a3, 4 -40005dab: 334b addi.n a3, a3, 4 -40005dad: 0a0847 bnone a8, a4, 40005dbb <strlen+0x4f> -40005db0: 0c0857 bnone a8, a5, 40005dc0 <strlen+0x54> -40005db3: 110867 bnone a8, a6, 40005dc8 <strlen+0x5c> -40005db6: ff0877 bnone a8, a7, 40005db9 <strlen+0x4d> -40005db9: 333b addi.n a3, a3, 3 -40005dbb: c02320 sub a2, a3, a2 -40005dbe: f01d retw.n -40005dc0: 331b addi.n a3, a3, 1 -40005dc2: c02320 sub a2, a3, a2 -40005dc5: f01d retw.n -40005dc7: 332b00 clamps a2, a11, 7 -40005dca: c02320 sub a2, a3, a2 -40005dcd: f01d retw.n - ... - -40005dd0 <strncmp>: -40005dd0: 004136 entry a1, 32 -40005dd3: a4bc beqz.n a4, 40005e11 <strncmp+0x41> -40005dd5: 205320 or a5, a3, a2 -40005dd8: 145050 extui a5, a5, 0, 2 -40005ddb: 041516 beqz a5, 40005e20 <strncmp+0x50> -40005dde: 000272 l8ui a7, a2, 0 -40005de1: 000382 l8ui a8, a3, 0 -40005de4: 049d mov.n a9, a4 -40005de6: 440b addi.n a4, a4, -1 -40005de8: 09ac beqz.n a9, 40005e0c <strncmp+0x3c> -40005dea: 1e9787 bne a7, a8, 40005e0c <strncmp+0x3c> -40005ded: 168076 loop a0, 40005e07 <strncmp+0x37> -40005df0: 046d mov.n a6, a4 -40005df2: b49c beqz.n a4, 40005e11 <strncmp+0x41> -40005df4: 979c beqz.n a7, 40005e11 <strncmp+0x41> -40005df6: 440b addi.n a4, a4, -1 -40005df8: 331b addi.n a3, a3, 1 -40005dfa: 221b addi.n a2, a2, 1 -40005dfc: 569c beqz.n a6, 40005e15 <strncmp+0x45> -40005dfe: 000272 l8ui a7, a2, 0 -40005e01: 000382 l8ui a8, a3, 0 -40005e04: 049877 bne a8, a7, 40005e0c <strncmp+0x3c> -40005e07: fff886 j 40005ded <strncmp+0x1d> -40005e0a: 800000 add a0, a0, a0 -40005e0d: 1dc027 bnall a0, a2, 40005e2e <strncmp+0x5e> -40005e10: 020cf0 andb b0, b12, b15 -40005e13: f01d retw.n -40005e15: 000352 l8ui a5, a3, 0 -40005e18: 000222 l8ui a2, a2, 0 -40005e1b: c02250 sub a2, a2, a5 -40005e1e: f01d retw.n -40005e20: ba44b6 bltui a4, 4, 40005dde <strncmp+0xe> -40005e23: 0278 l32i.n a7, a2, 0 -40005e25: 002362 l32i a6, a3, 0 -40005e28: b29677 bne a6, a7, 40005dde <strncmp+0xe> -40005e2b: ea5e91 l32r a9, 400007a4 <_c_0x00ff0000+0xc> -40005e2e: ffafa2 movi a10, -1 -40005e31: ea5d81 l32r a8, 400007a8 <_c_0x00ff0000+0x10> -40005e34: fcc442 addi a4, a4, -4 -40005e37: fd6416 beqz a4, 40005e11 <strncmp+0x41> -40005e3a: 30c7a0 xor a12, a7, a10 -40005e3d: b78a add.n a11, a7, a8 -40005e3f: 10bbc0 and a11, a11, a12 -40005e42: cb89b7 bany a9, a11, 40005e11 <strncmp+0x41> -40005e45: 334b addi.n a3, a3, 4 -40005e47: 224b addi.n a2, a2, 4 -40005e49: 9144b6 bltui a4, 4, 40005dde <strncmp+0xe> -40005e4c: 0278 l32i.n a7, a2, 0 -40005e4e: 03d8 l32i.n a13, a3, 0 -40005e50: e01d77 beq a13, a7, 40005e34 <strncmp+0x64> -40005e53: ffe1c6 j 40005dde <strncmp+0xe> -40005e56: 820000 mull a0, a0, a0 -40005e59: 1b0003 excw -40005e5c: 4a8233 excw -40005e5f: 440b00 extui a0, a0, 11, 5 -40005e62: 74ac beqz.n a4, 40005e8d <strncmp+0xbd> -40005e64: aa1b addi.n a10, a10, 1 -40005e66: 048816 beqz a8, 40005eb2 <strncpy+0x22> -40005e69: 3d6317 bbci a3, 1, 40005eaa <strncpy+0x1a> -40005e6c: 000382 l8ui a8, a3, 0 -40005e6f: 440b addi.n a4, a4, -1 -40005e71: 004a82 s8i a8, a10, 0 -40005e74: 549c beqz.n a4, 40005e8d <strncmp+0xbd> -40005e76: aa1b addi.n a10, a10, 1 -40005e78: 68bc beqz.n a8, 40005eb2 <strncpy+0x22> -40005e7a: 010382 l8ui a8, a3, 1 -40005e7d: 332b addi.n a3, a3, 2 -40005e7f: 004a82 s8i a8, a10, 0 -40005e82: 440b addi.n a4, a4, -1 -40005e84: 548c beqz.n a4, 40005e8d <strncmp+0xbd> -40005e86: aa1b addi.n a10, a10, 1 -40005e88: e8dc bnez.n a8, 40005eaa <strncpy+0x1a> -40005e8a: 000906 j 40005eb2 <strncpy+0x22> -40005e8d: f01d retw.n - ... - -40005e90 <strncpy>: -40005e90: 002136 entry a1, 16 -40005e93: 02ad mov.n a10, a2 -40005e95: ff4416 beqz a4, 40005e8d <strncmp+0xbd> -40005e98: ffa0b2 movi a11, 255 -40005e9b: ea3e51 l32r a5, 40000794 <_c_0x7fffffff+0x14> -40005e9e: ea3e61 l32r a6, 40000798 <_c_0x00ff0000> -40005ea1: ea3e71 l32r a7, 4000079c <_c_0x00ff0000+0x4> -40005ea4: b0e307 bbsi a3, 0, 40005e58 <strncmp+0x88> -40005ea7: c1e317 bbsi a3, 1, 40005e6c <strncmp+0x9c> -40005eaa: 380c movi.n a8, 3 -40005eac: 540a87 bnone a10, a8, 40005f04 <strncpy+0x74> -40005eaf: 002746 j 40005f50 <strncpy+0xc0> -40005eb2: 090c movi.n a9, 0 -40005eb4: 28ea07 bbsi a10, 0, 40005ee0 <strncpy+0x50> -40005eb7: 32ea17 bbsi a10, 1, 40005eed <strncpy+0x5d> -40005eba: 1344a6 blti a4, 4, 40005ed1 <strncpy+0x41> -40005ebd: 218240 srai a8, a4, 2 -40005ec0: f03d nop.n -40005ec2: 038876 loop a8, 40005ec9 <strncpy+0x39> -40005ec5: 0a99 s32i.n a9, a10, 0 -40005ec7: aa4b addi.n a10, a10, 4 -40005ec9: 1188e0 slli a8, a8, 2 -40005ecc: c04480 sub a4, a4, a8 -40005ecf: 948c beqz.n a4, 40005edc <strncpy+0x4c> -40005ed1: 004a92 s8i a9, a10, 0 -40005ed4: 440b addi.n a4, a4, -1 -40005ed6: 01caa2 addi a10, a10, 1 -40005ed9: ff4456 bnez a4, 40005ed1 <strncpy+0x41> -40005edc: f01d retw.n -40005ede: 920000 excw -40005ee1: 004a add.n a0, a0, a4 -40005ee3: 440b addi.n a4, a4, -1 -40005ee5: ff3416 beqz a4, 40005edc <strncpy+0x4c> -40005ee8: aa1b addi.n a10, a10, 1 -40005eea: cc6a17 bbci a10, 1, 40005eba <strncpy+0x2a> -40005eed: 004a92 s8i a9, a10, 0 -40005ef0: 440b addi.n a4, a4, -1 -40005ef2: fe6416 beqz a4, 40005edc <strncpy+0x4c> -40005ef5: 014a92 s8i a9, a10, 1 -40005ef8: 440b addi.n a4, a4, -1 -40005efa: fde416 beqz a4, 40005edc <strncpy+0x4c> -40005efd: aa2b addi.n a10, a10, 2 -40005eff: ffedc6 j 40005eba <strncpy+0x2a> -40005f02: 0c0000 excw -40005f05: 7608 l32i.n a0, a6, 28 -40005f07: 1988 l32i.n a8, a9, 4 -40005f09: 4354a6 blti a4, 5, 40005f50 <strncpy+0xc0> -40005f0c: 0388 l32i.n a8, a3, 0 -40005f0e: 334b addi.n a3, a3, 4 -40005f10: 1408b7 bnone a8, a11, 40005f28 <strncpy+0x98> -40005f13: 1d0857 bnone a8, a5, 40005f34 <strncpy+0xa4> -40005f16: 260867 bnone a8, a6, 40005f40 <strncpy+0xb0> -40005f19: 0a89 s32i.n a8, a10, 0 -40005f1b: fcc442 addi a4, a4, -4 -40005f1e: aa4b addi.n a10, a10, 4 -40005f20: 8e0877 bnone a8, a7, 40005eb2 <strncpy+0x22> -40005f23: ffe2c6 j 40005eb2 <strncpy+0x22> -40005f26: 820000 mull a0, a0, a0 -40005f29: 004a add.n a0, a0, a4 -40005f2b: 440b addi.n a4, a4, -1 -40005f2d: aa1b addi.n a10, a10, 1 -40005f2f: ffdfc6 j 40005eb2 <strncpy+0x22> -40005f32: 820000 mull a0, a0, a0 -40005f35: 005a add.n a0, a0, a5 -40005f37: fec442 addi a4, a4, -2 -40005f3a: aa2b addi.n a10, a10, 2 -40005f3c: ffdc86 j 40005eb2 <strncpy+0x22> -40005f3f: 5a8200 depbits a0, a2, 5, 9 -40005f42: 080c00 excw -40005f45: 024a82 s8i a8, a10, 2 -40005f48: fdc442 addi a4, a4, -3 -40005f4b: aa3b addi.n a10, a10, 3 -40005f4d: ffd846 j 40005eb2 <strncpy+0x22> -40005f50: 080c movi.n a8, 0 -40005f52: 108876 loop a8, 40005f66 <strncpy+0xd6> -40005f55: 000382 l8ui a8, a3, 0 -40005f58: 331b addi.n a3, a3, 1 -40005f5a: 004a82 s8i a8, a10, 0 -40005f5d: 440b addi.n a4, a4, -1 -40005f5f: 648c beqz.n a4, 40005f69 <strncpy+0xd9> -40005f61: aa1b addi.n a10, a10, 1 -40005f63: fff816 beqz a8, 40005f66 <strncpy+0xd6> -40005f66: ffd206 j 40005eb2 <strncpy+0x22> -40005f69: f01d retw.n - ... - -40005f6c <strstr>: -40005f6c: 090136 entry a1, 0x480 -40005f6f: 50c172 addi a7, a1, 80 -40005f72: 025d mov.n a5, a2 -40005f74: 038d mov.n a8, a3 -40005f76: 20c220 or a12, a2, a2 -40005f79: 0003b2 l8ui a11, a3, 0 -40005f7c: 0002e2 l8ui a14, a2, 0 -40005f7f: 209bb0 or a9, a11, a11 -40005f82: eebc beqz.n a14, 40005fc4 <strstr+0x58> -40005f84: cbac beqz.n a11, 40005fb4 <strstr+0x48> -40005f86: 01a0a2 movi a10, 1 -40005f89: 228076 loop a0, 40005faf <strstr+0x43> -40005f8c: cc1b addi.n a12, a12, 1 -40005f8e: 1d0c movi.n a13, 1 -40005f90: 74f0e0 extui a15, a14, 0, 8 -40005f93: 040c movi.n a4, 0 -40005f95: 74e090 extui a14, a9, 0, 8 -40005f98: c0eef0 sub a14, a14, a15 -40005f9b: 834de0 moveqz a4, a13, a14 -40005f9e: 10aa40 and a10, a10, a4 -40005fa1: 000ce2 l8ui a14, a12, 0 -40005fa4: 481b addi.n a4, a8, 1 -40005fa6: 048d mov.n a8, a4 -40005fa8: ce8c beqz.n a14, 40005fb8 <strstr+0x4c> -40005faa: 000492 l8ui a9, a4, 0 -40005fad: 198c beqz.n a9, 40005fb2 <strstr+0x46> -40005faf: fff586 j 40005f89 <strstr+0x1d> -40005fb2: 4a9c beqz.n a10, 40005fca <strstr+0x5e> -40005fb4: 052d mov.n a2, a5 -40005fb6: f01d retw.n -40005fb8: 000482 l8ui a8, a4, 0 -40005fbb: ff3816 beqz a8, 40005fb2 <strstr+0x46> -40005fbe: 020c movi.n a2, 0 -40005fc0: f01d retw.n -40005fc2: 560000 excw -40005fc5: ff6b addi.n a15, a15, 6 -40005fc7: fffa46 j 40005fb4 <strstr+0x48> -40005fca: 01c5a2 addi a10, a5, 1 -40005fcd: 005aa5 call8 40006578 <strstr+0x60c> -40005fd0: 202aa0 or a2, a10, a10 -40005fd3: 271a16 beqz a10, 40006248 <strstr+0x2dc> -40005fd6: c04430 sub a4, a4, a3 -40005fd9: ffc492 addi a9, a4, -1 -40005fdc: 268916 beqz a9, 40006248 <strstr+0x2dc> -40005fdf: 845a add.n a8, a4, a5 -40005fe1: 0538a7 bltu a8, a10, 40005fea <strstr+0x7e> -40005fe4: c088a0 sub a8, a8, a10 -40005fe7: 000046 j 40005fec <strstr+0x80> -40005fea: 180c movi.n a8, 1 -40005fec: 18c4f6 bgeui a4, 32, 40006008 <strstr+0x9c> -40005fef: 085d mov.n a5, a8 -40005ff1: 0224f6 bgeui a4, 2, 40005ff7 <strstr+0x8b> -40005ff4: 002f06 j 400060b4 <strstr+0x148> -40005ff7: 190c movi.n a9, 1 -40005ff9: 180c movi.n a8, 1 -40005ffb: 1f0c movi.n a15, 1 -40005ffd: 0a0c movi.n a10, 0 -40005fff: f67c movi.n a6, -1 -40006001: 5159 s32i.n a5, a1, 20 -40006003: 0008c6 j 4000602a <strstr+0xbe> -40006006: 820000 mull a0, a0, a0 -40006009: f61061 l32r a6, 4000384c <_X_recv_packet+0x10> -4000600c: 860224 excw -4000600f: 0c0067 bnone a0, a6, 4000601f <strstr+0xb3> -40006012: 0c19 s32i.n a1, a12, 0 -40006014: 0c18 l32i.n a1, a12, 0 -40006016: 1f .byte 0x1f -40006017: 0a0c movi.n a10, 0 -40006019: f67c movi.n a6, -1 -4000601b: 0042c6 j 4000612a <strstr+0x1be> -4000601e: 09ad mov.n a10, a9 -40006020: c0f960 sub a15, a9, a6 -40006023: 180c movi.n a8, 1 -40006025: 98aa add.n a9, a8, a10 -40006027: 2db947 bgeu a9, a4, 40006058 <strstr+0xec> -4000602a: b86a add.n a11, a8, a6 -4000602c: c93a add.n a12, a9, a3 -4000602e: 000cc2 l8ui a12, a12, 0 -40006031: b3ba add.n a11, a3, a11 -40006033: 000bb2 l8ui a11, a11, 0 -40006036: e43cb7 bltu a12, a11, 4000601e <strstr+0xb2> -40006039: 0f9cb7 bne a12, a11, 4000604c <strstr+0xe0> -4000603c: 0418f7 beq a8, a15, 40006044 <strstr+0xd8> -4000603f: 881b addi.n a8, a8, 1 -40006041: fff806 j 40006025 <strstr+0xb9> -40006044: afaa add.n a10, a15, a10 -40006046: 180c movi.n a8, 1 -40006048: fff646 j 40006025 <strstr+0xb9> -4000604b: 180c00 excw -4000604e: 0a6d mov.n a6, a10 -40006050: 1f0c movi.n a15, 1 -40006052: aa1b addi.n a10, a10, 1 -40006054: fff346 j 40006025 <strstr+0xb9> -40006057: 190c00 excw -4000605a: f57c movi.n a5, -1 -4000605c: 180c movi.n a8, 1 -4000605e: 11f9 s32i.n a15, a1, 4 -40006060: 0a0c movi.n a10, 0 -40006062: 1f0c movi.n a15, 1 -40006064: 000346 j 40006075 <strstr+0x109> -40006067: ad0000 excw -4000606a: 5009 s32i.n a0, a0, 20 -4000606c: c0f9 s32i.n a15, a0, 48 -4000606e: 180c movi.n a8, 1 -40006070: 98aa add.n a9, a8, a10 -40006072: 2eb947 bgeu a9, a4, 400060a4 <strstr+0x138> -40006075: b58a add.n a11, a5, a8 -40006077: c93a add.n a12, a9, a3 -40006079: 000cc2 l8ui a12, a12, 0 -4000607c: b3ba add.n a11, a3, a11 -4000607e: 000bb2 l8ui a11, a11, 0 -40006081: e43bc7 bltu a11, a12, 40006069 <strstr+0xfd> -40006084: 109cb7 bne a12, a11, 40006098 <strstr+0x12c> -40006087: 0518f7 beq a8, a15, 40006090 <strstr+0x124> -4000608a: 881b addi.n a8, a8, 1 -4000608c: fff806 j 40006070 <strstr+0x104> -4000608f: afaa00 excw -40006092: 180c movi.n a8, 1 -40006094: fff606 j 40006070 <strstr+0x104> -40006097: 180c00 excw -4000609a: 0a5d mov.n a5, a10 -4000609c: 1f0c movi.n a15, 1 -4000609e: aa1b addi.n a10, a10, 1 -400060a0: fff306 j 40006070 <strstr+0x104> -400060a3: 961b00 excw -400060a6: c51b addi.n a12, a5, 1 -400060a8: 5158 l32i.n a5, a1, 20 -400060aa: 0abc97 bgeu a12, a9, 400060b8 <strstr+0x14c> -400060ad: 1168 l32i.n a6, a1, 4 -400060af: 09cd mov.n a12, a9 -400060b1: 000146 j 400060ba <strstr+0x14e> -400060b4: 0c0c movi.n a12, 0 -400060b6: 1f0c movi.n a15, 1 -400060b8: 0f6d mov.n a6, a15 -400060ba: 81c9 s32i.n a12, a1, 32 -400060bc: 03ad mov.n a10, a3 -400060be: b36a add.n a11, a3, a6 -400060c0: 0082a5 call8 400068ec <memcmp> -400060c3: 5159 s32i.n a5, a1, 20 -400060c5: 213a16 beqz a10, 400062dc <strstr+0x370> -400060c8: 81e8 l32i.n a14, a1, 32 -400060ca: 6e0b addi.n a6, a14, -1 -400060cc: c0f4e0 sub a15, a4, a14 -400060cf: 6169 s32i.n a6, a1, 24 -400060d1: 00a062 movi a6, 0 -400060d4: 73eef0 maxu a14, a14, a15 -400060d7: 21e9 s32i.n a14, a1, 8 -400060d9: a25a add.n a10, a2, a5 -400060db: c46a add.n a12, a4, a6 -400060dd: 00a0b2 movi a11, 0 -400060e0: 0761c2 s32i a12, a1, 28 -400060e3: c0cc50 sub a12, a12, a5 -400060e6: 0041a5 call8 40006500 <strstr+0x594> -400060e9: 15da56 bnez a10, 4000624a <strstr+0x2de> -400060ec: 71d8 l32i.n a13, a1, 28 -400060ee: 81e8 l32i.n a14, a1, 32 -400060f0: 0d5d mov.n a5, a13 -400060f2: 154d16 beqz a13, 4000624a <strstr+0x2de> -400060f5: 0e8d mov.n a8, a14 -400060f7: 11be47 bgeu a14, a4, 4000610c <strstr+0x1a0> -400060fa: fe6a add.n a15, a14, a6 -400060fc: 9e3a add.n a9, a14, a3 -400060fe: 000992 l8ui a9, a9, 0 -40006101: f2fa add.n a15, a2, a15 -40006103: 000ff2 l8ui a15, a15, 0 -40006106: c0ff90 sub a15, a15, a9 -40006109: 154f16 beqz a15, 40006261 <strstr+0x2f5> -4000610c: 023847 bltu a8, a4, 40006112 <strstr+0x1a6> -4000610f: 0054c6 j 40006266 <strstr+0x2fa> -40006112: 81a8 l32i.n a10, a1, 32 -40006114: c0a8a0 sub a10, a8, a10 -40006117: aa1b addi.n a10, a10, 1 -40006119: 66aa add.n a6, a6, a10 -4000611b: ffee86 j 400060d9 <strstr+0x16d> -4000611e: 09ad mov.n a10, a9 -40006120: c0f960 sub a15, a9, a6 -40006123: 180c movi.n a8, 1 -40006125: 98aa add.n a9, a8, a10 -40006127: 2db947 bgeu a9, a4, 40006158 <strstr+0x1ec> -4000612a: b86a add.n a11, a8, a6 -4000612c: c93a add.n a12, a9, a3 -4000612e: 000cc2 l8ui a12, a12, 0 -40006131: b3ba add.n a11, a3, a11 -40006133: 000bb2 l8ui a11, a11, 0 -40006136: e43cb7 bltu a12, a11, 4000611e <strstr+0x1b2> -40006139: 0f9cb7 bne a12, a11, 4000614c <strstr+0x1e0> -4000613c: 0418f7 beq a8, a15, 40006144 <strstr+0x1d8> -4000613f: 881b addi.n a8, a8, 1 -40006141: fff806 j 40006125 <strstr+0x1b9> -40006144: afaa add.n a10, a15, a10 -40006146: 180c movi.n a8, 1 -40006148: fff646 j 40006125 <strstr+0x1b9> -4000614b: 180c00 excw -4000614e: 0a6d mov.n a6, a10 -40006150: 1f0c movi.n a15, 1 -40006152: aa1b addi.n a10, a10, 1 -40006154: fff346 j 40006125 <strstr+0x1b9> -40006157: 190c00 excw -4000615a: f57c movi.n a5, -1 -4000615c: 180c movi.n a8, 1 -4000615e: f1f9 s32i.n a15, a1, 60 -40006160: 0a0c movi.n a10, 0 -40006162: 1f0c movi.n a15, 1 -40006164: 000346 j 40006175 <strstr+0x209> -40006167: ad0000 excw -4000616a: 5009 s32i.n a0, a0, 20 -4000616c: c0f9 s32i.n a15, a0, 48 -4000616e: 180c movi.n a8, 1 -40006170: 98aa add.n a9, a8, a10 -40006172: 2eb947 bgeu a9, a4, 400061a4 <strstr+0x238> -40006175: b58a add.n a11, a5, a8 -40006177: c93a add.n a12, a9, a3 -40006179: 000cc2 l8ui a12, a12, 0 -4000617c: b3ba add.n a11, a3, a11 -4000617e: 000bb2 l8ui a11, a11, 0 -40006181: e43bc7 bltu a11, a12, 40006169 <strstr+0x1fd> -40006184: 109cb7 bne a12, a11, 40006198 <strstr+0x22c> -40006187: 0518f7 beq a8, a15, 40006190 <strstr+0x224> -4000618a: 881b addi.n a8, a8, 1 -4000618c: fff806 j 40006170 <strstr+0x204> -4000618f: afaa00 excw -40006192: 180c movi.n a8, 1 -40006194: fff606 j 40006170 <strstr+0x204> -40006197: 180c00 excw -4000619a: 0a5d mov.n a5, a10 -4000619c: 1f0c movi.n a15, 1 -4000619e: aa1b addi.n a10, a10, 1 -400061a0: fff306 j 40006170 <strstr+0x204> -400061a3: 961b00 excw -400061a6: c51b addi.n a12, a5, 1 -400061a8: 08bc97 bgeu a12, a9, 400061b4 <strstr+0x248> -400061ab: 09ed mov.n a14, a9 -400061ad: 0001c6 j 400061b8 <strstr+0x24c> -400061b0: 0c0c movi.n a12, 0 -400061b2: 1f0c movi.n a15, 1 -400061b4: 0ced mov.n a14, a12 -400061b6: f1f9 s32i.n a15, a1, 60 -400061b8: 0a2c movi.n a10, 32 -400061ba: 10c762 addi a6, a7, 16 -400061bd: 068d mov.n a8, a6 -400061bf: 12aa76 loopgtz a10, 400061d5 <strstr+0x269> -400061c2: 0849 s32i.n a4, a8, 0 -400061c4: 1849 s32i.n a4, a8, 4 -400061c6: 2849 s32i.n a4, a8, 8 -400061c8: 3849 s32i.n a4, a8, 12 -400061ca: 4849 s32i.n a4, a8, 16 -400061cc: 5849 s32i.n a4, a8, 20 -400061ce: 6849 s32i.n a4, a8, 24 -400061d0: 7849 s32i.n a4, a8, 28 -400061d2: 20c882 addi a8, a8, 32 -400061d5: 080c movi.n a8, 0 -400061d7: a40b addi.n a10, a4, -1 -400061d9: e1a9 s32i.n a10, a1, 56 -400061db: 10a476 loopgtz a4, 400061ef <strstr+0x283> -400061de: 938a add.n a9, a3, a8 -400061e0: 000992 l8ui a9, a9, 0 -400061e3: 01c882 addi a8, a8, 1 -400061e6: a09960 addx4 a9, a9, a6 -400061e9: 0069a2 s32i a10, a9, 0 -400061ec: ffcaa2 addi a10, a10, -1 -400061ef: 0ecd mov.n a12, a14 -400061f1: d1e9 s32i.n a14, a1, 52 -400061f3: f1b8 l32i.n a11, a1, 60 -400061f5: 03ad mov.n a10, a3 -400061f7: b3ba add.n a11, a3, a11 -400061f9: 006f25 call8 400068ec <memcmp> -400061fc: 174a16 beqz a10, 40006374 <strstr+0x408> -400061ff: d1d8 l32i.n a13, a1, 52 -40006201: 050c movi.n a5, 0 -40006203: c0e4d0 sub a14, a4, a13 -40006206: 73ede0 maxu a14, a13, a14 -40006209: a1e9 s32i.n a14, a1, 40 -4000620b: dd0b addi.n a13, a13, -1 -4000620d: b1d9 s32i.n a13, a1, 44 -4000620f: 000686 j 4000622d <strstr+0x2c1> -40006212: c1f8 l32i.n a15, a1, 48 -40006214: 1061f2 s32i a15, a1, 64 -40006217: 9fac beqz.n a15, 40006244 <strstr+0x2d8> -40006219: 8092f0 add a9, a2, a15 -4000621c: ffd992 addmi a9, a9, 0xffffff00 -4000621f: ff0992 l8ui a9, a9, 255 -40006222: a09960 addx4 a9, a9, a6 -40006225: 0998 l32i.n a9, a9, 0 -40006227: 07a916 beqz a9, 400062a5 <strstr+0x339> -4000622a: 805950 add a5, a9, a5 -4000622d: 00a0b2 movi a11, 0 -40006230: 1021d2 l32i a13, a1, 64 -40006233: 80c450 add a12, a4, a5 -40006236: 0c61c2 s32i a12, a1, 48 -40006239: a2da add.n a10, a2, a13 -4000623b: c0ccd0 sub a12, a12, a13 -4000623e: 002c25 call8 40006500 <strstr+0x594> -40006241: fcda16 beqz a10, 40006212 <strstr+0x2a6> -40006244: 020c movi.n a2, 0 -40006246: f01d retw.n -40006248: f01d retw.n -4000624a: 020c movi.n a2, 0 -4000624c: f01d retw.n -4000624e: e86a add.n a14, a8, a6 -40006250: f38a add.n a15, a3, a8 -40006252: 000ff2 l8ui a15, a15, 0 -40006255: 80e2e0 add a14, a2, a14 -40006258: 000ee2 l8ui a14, a14, 0 -4000625b: c0eef0 sub a14, a14, a15 -4000625e: eaae56 bnez a14, 4000610c <strstr+0x1a0> -40006261: 881b addi.n a8, a8, 1 -40006263: e73847 bltu a8, a4, 4000624e <strstr+0x2e2> -40006266: 8198 l32i.n a9, a1, 32 -40006268: 6188 l32i.n a8, a1, 24 -4000626a: 69ac beqz.n a9, 40006294 <strstr+0x328> -4000626c: a86a add.n a10, a8, a6 -4000626e: b83a add.n a11, a8, a3 -40006270: 000bb2 l8ui a11, a11, 0 -40006273: 80a2a0 add a10, a2, a10 -40006276: 000aa2 l8ui a10, a10, 0 -40006279: 179ab7 bne a10, a11, 40006294 <strstr+0x328> -4000627c: 126162 s32i a6, a1, 72 -4000627f: 880b addi.n a8, a8, -1 -40006281: 4f0826 beqi a8, -1, 400062d4 <strstr+0x368> -40006284: c86a add.n a12, a8, a6 -40006286: d38a add.n a13, a3, a8 -40006288: 000dd2 l8ui a13, a13, 0 -4000628b: 80c2c0 add a12, a2, a12 -4000628e: 000cc2 l8ui a12, a12, 0 -40006291: e71cd7 beq a12, a13, 4000627c <strstr+0x310> -40006294: 126162 s32i a6, a1, 72 -40006297: 390826 beqi a8, -1, 400062d4 <strstr+0x368> -4000629a: 21e8 l32i.n a14, a1, 8 -4000629c: ee1b addi.n a14, a14, 1 -4000629e: 66ea add.n a6, a6, a14 -400062a0: ff8d46 j 400060d9 <strstr+0x16d> -400062a3: f80000 excw -400062a6: e198d1 l32r a13, 3fffe908 <_start-0x16f8> -400062a9: 0f8d mov.n a8, a15 -400062ab: 11bf97 bgeu a15, a9, 400062c0 <strstr+0x354> -400062ae: af5a add.n a10, a15, a5 -400062b0: bf3a add.n a11, a15, a3 -400062b2: 000bb2 l8ui a11, a11, 0 -400062b5: a2aa add.n a10, a2, a10 -400062b7: 000aa2 l8ui a10, a10, 0 -400062ba: c0aab0 sub a10, a10, a11 -400062bd: 145a16 beqz a10, 40006406 <strstr+0x49a> -400062c0: e1c8 l32i.n a12, a1, 56 -400062c2: 0238c7 bltu a8, a12, 400062c8 <strstr+0x35c> -400062c5: 005106 j 4000640d <strstr+0x4a1> -400062c8: d1d8 l32i.n a13, a1, 52 -400062ca: c0d8d0 sub a13, a8, a13 -400062cd: dd1b addi.n a13, a13, 1 -400062cf: 55da add.n a5, a5, a13 -400062d1: ffd606 j 4000622d <strstr+0x2c1> -400062d4: 1221e2 l32i a14, a1, 72 -400062d7: 22ea add.n a2, a2, a14 -400062d9: f01d retw.n -400062db: 714900 excw -400062de: 090c movi.n a9, 0 -400062e0: 8158 l32i.n a5, a1, 32 -400062e2: c0f460 sub a15, a4, a6 -400062e5: 31f9 s32i.n a15, a1, 12 -400062e7: 550b addi.n a5, a5, -1 -400062e9: 6159 s32i.n a5, a1, 24 -400062eb: 050c movi.n a5, 0 -400062ed: 00a0b2 movi a11, 0 -400062f0: 116192 s32i a9, a1, 68 -400062f3: 0521d2 l32i a13, a1, 20 -400062f6: 0721c2 l32i a12, a1, 28 -400062f9: a2da add.n a10, a2, a13 -400062fb: c0ccd0 sub a12, a12, a13 -400062fe: 002025 call8 40006500 <strstr+0x594> -40006301: 112192 l32i a9, a1, 68 -40006304: f42a56 bnez a10, 4000624a <strstr+0x2de> -40006307: 71e8 l32i.n a14, a1, 28 -40006309: 51e9 s32i.n a14, a1, 20 -4000630b: f3be16 beqz a14, 4000624a <strstr+0x2de> -4000630e: 8188 l32i.n a8, a1, 32 -40006310: 738890 maxu a8, a8, a9 -40006313: 2ab847 bgeu a8, a4, 40006341 <strstr+0x3d5> -40006316: a85a add.n a10, a8, a5 -40006318: b83a add.n a11, a8, a3 -4000631a: 000bb2 l8ui a11, a11, 0 -4000631d: a2aa add.n a10, a2, a10 -4000631f: 000aa2 l8ui a10, a10, 0 -40006322: c0aab0 sub a10, a10, a11 -40006325: 3a9c beqz.n a10, 4000633c <strstr+0x3d0> -40006327: 004746 j 40006448 <strstr+0x4dc> -4000632a: c85a add.n a12, a8, a5 -4000632c: d38a add.n a13, a3, a8 -4000632e: 000dd2 l8ui a13, a13, 0 -40006331: c2ca add.n a12, a2, a12 -40006333: 000cc2 l8ui a12, a12, 0 -40006336: c0ccd0 sub a12, a12, a13 -40006339: 10bc56 bnez a12, 40006448 <strstr+0x4dc> -4000633c: 881b addi.n a8, a8, 1 -4000633e: e83847 bltu a8, a4, 4000632a <strstr+0x3be> -40006341: 81e8 l32i.n a14, a1, 32 -40006343: 6188 l32i.n a8, a1, 24 -40006345: 11b9e7 bgeu a9, a14, 4000635a <strstr+0x3ee> -40006348: f85a add.n a15, a8, a5 -4000634a: a83a add.n a10, a8, a3 -4000634c: 000aa2 l8ui a10, a10, 0 -4000634f: f2fa add.n a15, a2, a15 -40006351: 000ff2 l8ui a15, a15, 0 -40006354: c0ffa0 sub a15, a15, a10 -40006357: 117f16 beqz a15, 40006472 <strstr+0x506> -4000635a: 81a8 l32i.n a10, a1, 32 -4000635c: 126152 s32i a5, a1, 72 -4000635f: b91b addi.n a11, a9, 1 -40006361: 02bab7 bgeu a10, a11, 40006367 <strstr+0x3fb> -40006364: ffdb06 j 400062d4 <strstr+0x368> -40006367: 556a add.n a5, a5, a6 -40006369: 71c8 l32i.n a12, a1, 28 -4000636b: 3198 l32i.n a9, a1, 12 -4000636d: cc6a add.n a12, a12, a6 -4000636f: 71c9 s32i.n a12, a1, 28 -40006371: ffde06 j 400062ed <strstr+0x381> -40006374: c149 s32i.n a4, a1, 48 -40006376: 050c movi.n a5, 0 -40006378: d1f8 l32i.n a15, a1, 52 -4000637a: f1e8 l32i.n a14, a1, 60 -4000637c: 0d0c movi.n a13, 0 -4000637e: 91d9 s32i.n a13, a1, 36 -40006380: c0e4e0 sub a14, a4, a14 -40006383: ff0b addi.n a15, a15, -1 -40006385: b1f9 s32i.n a15, a1, 44 -40006387: 41e9 s32i.n a14, a1, 16 -40006389: 000546 j 400063a2 <strstr+0x436> -4000638c: 919800 excw -4000638f: 598c beqz.n a9, 40006398 <strstr+0x42c> -40006391: f1a8 l32i.n a10, a1, 60 -40006393: 01b8a7 bgeu a8, a10, 40006398 <strstr+0x42c> -40006396: 4188 l32i.n a8, a1, 16 -40006398: 585a add.n a5, a8, a5 -4000639a: 0c0c movi.n a12, 0 -4000639c: 91c9 s32i.n a12, a1, 36 -4000639e: b45a add.n a11, a4, a5 -400063a0: c1b9 s32i.n a11, a1, 48 -400063a2: 00a0b2 movi a11, 0 -400063a5: 1021d2 l32i a13, a1, 64 -400063a8: 0c21c2 l32i a12, a1, 48 -400063ab: 80a2d0 add a10, a2, a13 -400063ae: c0ccd0 sub a12, a12, a13 -400063b1: 0014e5 call8 40006500 <strstr+0x594> -400063b4: e8ca56 bnez a10, 40006244 <strstr+0x2d8> -400063b7: c1e8 l32i.n a14, a1, 48 -400063b9: 1061e2 s32i a14, a1, 64 -400063bc: e84e16 beqz a14, 40006244 <strstr+0x2d8> -400063bf: 82ea add.n a8, a2, a14 -400063c1: ffd882 addmi a8, a8, 0xffffff00 -400063c4: ff0882 l8ui a8, a8, 255 -400063c7: a08860 addx4 a8, a8, a6 -400063ca: 0888 l32i.n a8, a8, 0 -400063cc: fbd856 bnez a8, 4000638d <strstr+0x421> -400063cf: 9198 l32i.n a9, a1, 36 -400063d1: d188 l32i.n a8, a1, 52 -400063d3: 738890 maxu a8, a8, a9 -400063d6: e198 l32i.n a9, a1, 56 -400063d8: 023897 bltu a8, a9, 400063de <strstr+0x472> -400063db: 002d46 j 40006494 <strstr+0x528> -400063de: a85a add.n a10, a8, a5 -400063e0: b83a add.n a11, a8, a3 -400063e2: 000bb2 l8ui a11, a11, 0 -400063e5: a2aa add.n a10, a2, a10 -400063e7: 000aa2 l8ui a10, a10, 0 -400063ea: c0aab0 sub a10, a10, a11 -400063ed: 09ca16 beqz a10, 4000648d <strstr+0x521> -400063f0: 003586 j 400064ca <strstr+0x55e> -400063f3: c58a00 extui a8, a0, 26, 13 -400063f6: d38a add.n a13, a3, a8 -400063f8: 000dd2 l8ui a13, a13, 0 -400063fb: c2ca add.n a12, a2, a12 -400063fd: 000cc2 l8ui a12, a12, 0 -40006400: c0ccd0 sub a12, a12, a13 -40006403: eb9c56 bnez a12, 400062c0 <strstr+0x354> -40006406: e1e8 l32i.n a14, a1, 56 -40006408: 881b addi.n a8, a8, 1 -4000640a: e638e7 bltu a8, a14, 400063f4 <strstr+0x488> -4000640d: d1f8 l32i.n a15, a1, 52 -4000640f: b188 l32i.n a8, a1, 44 -40006411: 3fac beqz.n a15, 40006438 <strstr+0x4cc> -40006413: 985a add.n a9, a8, a5 -40006415: a83a add.n a10, a8, a3 -40006417: 000aa2 l8ui a10, a10, 0 -4000641a: 929a add.n a9, a2, a9 -4000641c: 000992 l8ui a9, a9, 0 -4000641f: 1599a7 bne a9, a10, 40006438 <strstr+0x4cc> -40006422: 880b addi.n a8, a8, -1 -40006424: b81b addi.n a11, a8, 1 -40006426: 09cb16 beqz a11, 400064c6 <strstr+0x55a> -40006429: c58a add.n a12, a5, a8 -4000642b: d38a add.n a13, a3, a8 -4000642d: 000dd2 l8ui a13, a13, 0 -40006430: c2ca add.n a12, a2, a12 -40006432: 000cc2 l8ui a12, a12, 0 -40006435: e91cd7 beq a12, a13, 40006422 <strstr+0x4b6> -40006438: 020866 bnei a8, -1, 4000643e <strstr+0x4d2> -4000643b: 0021c6 j 400064c6 <strstr+0x55a> -4000643e: a1e8 l32i.n a14, a1, 40 -40006440: ee1b addi.n a14, a14, 1 -40006442: 55ea add.n a5, a5, a14 -40006444: ff7946 j 4000622d <strstr+0x2c1> -40006447: 384700 excw -4000644a: bc8602 excw -4000644d: ff .byte 0xff -4000644e: 8198 l32i.n a9, a1, 32 -40006450: c09890 sub a9, a8, a9 -40006453: 991b addi.n a9, a9, 1 -40006455: 559a add.n a5, a5, a9 -40006457: 090c movi.n a9, 0 -40006459: f45a add.n a15, a4, a5 -4000645b: 71f9 s32i.n a15, a1, 28 -4000645d: ffa306 j 400062ed <strstr+0x381> -40006460: b85a add.n a11, a8, a5 -40006462: c38a add.n a12, a3, a8 -40006464: 000cc2 l8ui a12, a12, 0 -40006467: b2ba add.n a11, a2, a11 -40006469: 000bb2 l8ui a11, a11, 0 -4000646c: 021bc7 beq a11, a12, 40006472 <strstr+0x506> -4000646f: ffba46 j 4000635c <strstr+0x3f0> -40006472: 08ad mov.n a10, a8 -40006474: 880b addi.n a8, a8, -1 -40006476: e639a7 bltu a9, a10, 40006460 <strstr+0x4f4> -40006479: ffb7c6 j 4000635c <strstr+0x3f0> -4000647c: 8a0000 depbits a0, a0, 8, 1 -4000647f: e38ad5 call4 3ffe9d2c <_start-0x162d4> -40006482: 000ee2 l8ui a14, a14, 0 -40006485: d2da add.n a13, a2, a13 -40006487: 000dd2 l8ui a13, a13, 0 -4000648a: 3c9de7 bne a13, a14, 400064ca <strstr+0x55e> -4000648d: e1f8 l32i.n a15, a1, 56 -4000648f: 881b addi.n a8, a8, 1 -40006491: e938f7 bltu a8, a15, 4000647e <strstr+0x512> -40006494: d1a8 l32i.n a10, a1, 52 -40006496: 9198 l32i.n a9, a1, 36 -40006498: b188 l32i.n a8, a1, 44 -4000649a: 0eb9a7 bgeu a9, a10, 400064ac <strstr+0x540> -4000649d: b85a add.n a11, a8, a5 -4000649f: c83a add.n a12, a8, a3 -400064a1: 000cc2 l8ui a12, a12, 0 -400064a4: b2ba add.n a11, a2, a11 -400064a6: 000bb2 l8ui a11, a11, 0 -400064a9: 471bc7 beq a11, a12, 400064f4 <strstr+0x588> -400064ac: d198 l32i.n a9, a1, 52 -400064ae: 91d8 l32i.n a13, a1, 36 -400064b0: dd1b addi.n a13, a13, 1 -400064b2: 1039d7 bltu a9, a13, 400064c6 <strstr+0x55a> -400064b5: c1f8 l32i.n a15, a1, 48 -400064b7: f188 l32i.n a8, a1, 60 -400064b9: 41e8 l32i.n a14, a1, 16 -400064bb: 91e9 s32i.n a14, a1, 36 -400064bd: 558a add.n a5, a5, a8 -400064bf: ff8a add.n a15, a15, a8 -400064c1: c1f9 s32i.n a15, a1, 48 -400064c3: ffb6c6 j 400063a2 <strstr+0x436> -400064c6: 225a add.n a2, a2, a5 -400064c8: f01d retw.n -400064ca: e198 l32i.n a9, a1, 56 -400064cc: c4b897 bgeu a8, a9, 40006494 <strstr+0x528> -400064cf: d1c8 l32i.n a12, a1, 52 -400064d1: 0b0c movi.n a11, 0 -400064d3: 91b9 s32i.n a11, a1, 36 -400064d5: c0c8c0 sub a12, a8, a12 -400064d8: cc1b addi.n a12, a12, 1 -400064da: 55ca add.n a5, a5, a12 -400064dc: a45a add.n a10, a4, a5 -400064de: c1a9 s32i.n a10, a1, 48 -400064e0: ffaf86 j 400063a2 <strstr+0x436> -400064e3: 8a0000 depbits a0, a0, 8, 1 -400064e6: e38ad5 call4 3ffe9d94 <_start-0x1626c> -400064e9: 000ee2 l8ui a14, a14, 0 -400064ec: d2da add.n a13, a2, a13 -400064ee: 000dd2 l8ui a13, a13, 0 -400064f1: b99de7 bne a13, a14, 400064ae <strstr+0x542> -400064f4: 089d mov.n a9, a8 -400064f6: 91f8 l32i.n a15, a1, 36 -400064f8: 880b addi.n a8, a8, -1 -400064fa: e73f97 bltu a15, a9, 400064e5 <strstr+0x579> -400064fd: ffeb46 j 400064ae <strstr+0x542> -40006500: 004136 entry a1, 32 -40006503: 03a052 movi a5, 3 -40006506: 1e0527 bnone a5, a2, 40006528 <strstr+0x5bc> -40006509: 747030 extui a7, a3, 0, 8 -4000650c: f03d nop.n -4000650e: 118076 loop a0, 40006523 <strstr+0x5b7> -40006511: 440b addi.n a4, a4, -1 -40006513: 5d0426 beqi a4, -1, 40006574 <strstr+0x608> -40006516: 000262 l8ui a6, a2, 0 -40006519: 551677 beq a6, a7, 40006572 <strstr+0x606> -4000651c: 221b addi.n a2, a2, 1 -4000651e: 148020 extui a8, a2, 0, 2 -40006521: 388c beqz.n a8, 40006528 <strstr+0x5bc> -40006523: fff946 j 4000650c <strstr+0x5a0> -40006526: b60000 excw -40006529: 812b44 excw -4000652c: 9e .byte 0x9e -4000652d: 7ce8 l32i.n a14, a12, 28 -4000652f: 71fa add.n a7, a1, a15 -40006531: 9e .byte 0x9e -40006532: 40e8 l32i.n a14, a0, 16 -40006534: 3041b2 s8i a11, a1, 48 -40006537: 907490 addx2 a7, a4, a9 -4000653a: 908a73 excw -4000653d: 0bf9 s32i.n a15, a11, 0 -4000653f: 149b76 loopnez a11, 40006557 <strstr+0x5eb> -40006542: 02c8 l32i.n a12, a2, 0 -40006544: 30cc90 xor a12, a12, a9 -40006547: 30dca0 xor a13, a12, a10 -4000654a: cc7a add.n a12, a12, a7 -4000654c: 10ccd0 and a12, a12, a13 -4000654f: 048c87 bany a12, a8, 40006557 <strstr+0x5eb> -40006552: fcc442 addi a4, a4, -4 -40006555: 224b addi.n a2, a2, 4 -40006557: 046d mov.n a6, a4 -40006559: 440b addi.n a4, a4, -1 -4000655b: 150426 beqi a4, -1, 40006574 <strstr+0x608> -4000655e: 747030 extui a7, a3, 0, 8 -40006561: 099676 loopnez a6, 4000656e <strstr+0x602> -40006564: 0002d2 l8ui a13, a2, 0 -40006567: 440b addi.n a4, a4, -1 -40006569: 051d77 beq a13, a7, 40006572 <strstr+0x606> -4000656c: 221b addi.n a2, a2, 1 -4000656e: 020c movi.n a2, 0 -40006570: f01d retw.n -40006572: f01d retw.n -40006574: 020c movi.n a2, 0 -40006576: f01d retw.n -40006578: 004136 entry a1, 32 -4000657b: e88b81 l32r a8, 400007a8 <_c_0x00ff0000+0x10> -4000657e: ffaf92 movi a9, -1 -40006581: e88871 l32r a7, 400007a4 <_c_0x00ff0000+0xc> -40006584: 746030 extui a6, a3, 0, 8 -40006587: 03a032 movi a3, 3 -4000658a: 08f616 beqz a6, 4000661d <strstr+0x6b1> -4000658d: 180327 bnone a3, a2, 400065a9 <strstr+0x63d> -40006590: f03d nop.n -40006592: 0f8076 loop a0, 400065a5 <strstr+0x639> -40006595: 000232 l8ui a3, a2, 0 -40006598: 0c8316 beqz a3, 40006664 <strstr+0x6f8> -4000659b: 791637 beq a6, a3, 40006618 <strstr+0x6ac> -4000659e: 221b addi.n a2, a2, 1 -400065a0: 144020 extui a4, a2, 0, 2 -400065a3: 248c beqz.n a4, 400065a9 <strstr+0x63d> -400065a5: fff9c6 j 40006590 <strstr+0x624> -400065a8: 063d00 excw -400065ab: 850c movi.n a5, 8 -400065ad: 0e8076 loop a0, 400065bf <strstr+0x653> -400065b0: 401500 ssl a5 -400065b3: 1155f0 slli a5, a5, 1 -400065b6: a1a300 sll a10, a3 -400065b9: 2033a0 or a3, a3, a10 -400065bc: 02c5f6 bgeui a5, 32, 400065c2 <strstr+0x656> -400065bf: fffa86 j 400065ad <strstr+0x641> -400065c2: 02a8 l32i.n a10, a2, 0 -400065c4: 30ca90 xor a12, a10, a9 -400065c7: ba8a add.n a11, a10, a8 -400065c9: 10bbc0 and a11, a11, a12 -400065cc: 2d8b77 bany a11, a7, 400065fd <strstr+0x691> -400065cf: 30da30 xor a13, a10, a3 -400065d2: 30ed90 xor a14, a13, a9 -400065d5: dd8a add.n a13, a13, a8 -400065d7: 10dde0 and a13, a13, a14 -400065da: 100d77 bnone a13, a7, 400065ee <strstr+0x682> -400065dd: 000706 j 400065fd <strstr+0x691> -400065e0: 30ea30 xor a14, a10, a3 -400065e3: 30fe90 xor a15, a14, a9 -400065e6: ee8a add.n a14, a14, a8 -400065e8: 10eef0 and a14, a14, a15 -400065eb: 0e8e77 bany a14, a7, 400065fd <strstr+0x691> -400065ee: 12a8 l32i.n a10, a2, 4 -400065f0: 224b addi.n a2, a2, 4 -400065f2: 304a90 xor a4, a10, a9 -400065f5: fa8a add.n a15, a10, a8 -400065f7: 10ff40 and a15, a15, a4 -400065fa: e20f77 bnone a15, a7, 400065e0 <strstr+0x674> -400065fd: 000232 l8ui a3, a2, 0 -40006600: 139c beqz.n a3, 40006615 <strstr+0x6a9> -40006602: 121637 beq a6, a3, 40006618 <strstr+0x6ac> -40006605: 098076 loop a0, 40006612 <strstr+0x6a6> -40006608: 010232 l8ui a3, a2, 1 -4000660b: 221b addi.n a2, a2, 1 -4000660d: 438c beqz.n a3, 40006615 <strstr+0x6a9> -4000660f: 051637 beq a6, a3, 40006618 <strstr+0x6ac> -40006612: fffbc6 j 40006605 <strstr+0x699> -40006615: 4b9637 bne a6, a3, 40006664 <strstr+0x6f8> -40006618: f01d retw.n -4000661a: 000000 ill -4000661d: 0d0327 bnone a3, a2, 4000662e <strstr+0x6c2> -40006620: 0002a2 l8ui a10, a2, 0 -40006623: ff1a16 beqz a10, 40006618 <strstr+0x6ac> -40006626: 221b addi.n a2, a2, 1 -40006628: 14b020 extui a11, a2, 0, 2 -4000662b: ff1b56 bnez a11, 40006620 <strstr+0x6b4> -4000662e: 02c8 l32i.n a12, a2, 0 -40006630: f03d nop.n -40006632: 30dc90 xor a13, a12, a9 -40006635: cc8a add.n a12, a12, a8 -40006637: 10ccd0 and a12, a12, a13 -4000663a: 0e8c77 bany a12, a7, 4000664c <strstr+0x6e0> -4000663d: 12d8 l32i.n a13, a2, 4 -4000663f: 224b addi.n a2, a2, 4 -40006641: 30ed90 xor a14, a13, a9 -40006644: dd8a add.n a13, a13, a8 -40006646: 10dde0 and a13, a13, a14 -40006649: f00d77 bnone a13, a7, 4000663d <strstr+0x6d1> -4000664c: 0002e2 l8ui a14, a2, 0 -4000664f: 0020f0 nop -40006652: fc2e16 beqz a14, 40006618 <strstr+0x6ac> -40006655: 078076 loop a0, 40006660 <strstr+0x6f4> -40006658: 0102f2 l8ui a15, a2, 1 -4000665b: 221b addi.n a2, a2, 1 -4000665d: fb7f16 beqz a15, 40006618 <strstr+0x6ac> -40006660: fffc46 j 40006655 <strstr+0x6e9> -40006663: 020c00 andb b0, b12, b0 -40006666: f01d retw.n -40006668: 002136 entry a1, 16 -4000666b: f01d retw.n -4000666d: 000000 ill - -40006670 <_xtos_set_intlevel>: -40006670: 002136 entry a1, 16 -40006673: 03e630 rsr.ps a3 -40006676: 047c movi.n a4, -16 -40006678: 342020 extui a2, a2, 0, 4 -4000667b: 104430 and a4, a4, a3 -4000667e: 204420 or a4, a4, a2 -40006681: 13e640 wsr.ps a4 -40006684: 342030 extui a2, a3, 0, 4 -40006687: 002010 rsync -4000668a: f01d retw.n -4000668c: 002136 entry a1, 16 -4000668f: 343020 extui a3, a2, 0, 4 -40006692: 03e620 rsr.ps a2 -40006695: 047c movi.n a4, -16 -40006697: 345020 extui a5, a2, 0, 4 -4000669a: c05350 sub a5, a3, a5 -4000669d: 104420 and a4, a4, a2 -400066a0: 204430 or a4, a4, a3 -400066a3: a34250 movltz a4, a2, a5 -400066a6: 13e640 wsr.ps a4 -400066a9: 002010 rsync -400066ac: f01d retw.n -400066ae: 360000 excw -400066b1: f00021 l32r a2, 400026b4 <_X_ets_unk225c+0x458> -400066b4: 1d0041 l32r a4, 3ffcdab4 <_start-0x3254c> -400066b7: 4128f0 srli a2, a15, 8 -400066ba: 5138 l32i.n a3, a1, 20 -400066bc: 01d112 addmi a1, a1, 0x100 -400066bf: 004110 break 1, 1 -400066c2: 003000 rfe -400066c5: 000000 ill -400066c8: 3b6522 s32i a2, a5, 236 -400066cb: 1528 l32i.n a2, a5, 4 -400066cd: 0538 l32i.n a3, a5, 0 -400066cf: 13e620 wsr.ps a2 -400066d2: 4528 l32i.n a2, a5, 16 -400066d4: 6548 l32i.n a4, a5, 24 -400066d6: 002010 rsync -400066d9: 13b130 wsr.epc1 a3 -400066dc: 5538 l32i.n a3, a5, 20 -400066de: 7558 l32i.n a5, a5, 28 -400066e0: 003000 rfe -400066e3: 213600 srai a3, a0, 6 -400066e6: ea2000 depbits a0, a0, 14, 3 -400066e9: f01d03 excw -400066ec: 002136 entry a1, 16 -400066ef: 52cc bnez.n a2, 400066f8 <_xtos_set_intlevel+0x88> -400066f1: 13f030 wsr.ccompare0 a3 -400066f4: 0003c6 j 40006707 <_xtos_set_intlevel+0x97> -400066f7: 22f600 orb b15, b6, b0 -400066fa: f13005 call0 3fff79fc <_start-0x8604> -400066fd: 014613 excw -40006700: 32f600 orbc b15, b6, b0 -40006703: f23005 call0 3fff8a04 <_start-0x75fc> -40006706: 200013 excw -40006709: f01d00 subx8 a1, a13, a0 -4000670c: 002136 entry a1, 16 -4000670f: 52cc bnez.n a2, 40006718 <_xtos_set_intlevel+0xa8> -40006711: 03f020 rsr.ccompare0 a2 -40006714: f01d retw.n -40006716: f60000 excw -40006719: 200422 l8ui a2, a4, 32 -4000671c: 1d03f1 l32r a15, 3ffcdb28 <_start-0x324d8> -4000671f: 32f6f0 orbc b15, b6, b15 -40006722: f22004 excw -40006725: f01d03 excw -40006728: 020c movi.n a2, 0 -4000672a: f01d retw.n -4000672c: 004136 entry a1, 32 -4000672f: 035d mov.n a5, a3 -40006731: 023d mov.n a3, a2 -40006733: 052d mov.n a2, a5 -40006735: 000706 j 40006755 <_xtos_set_intlevel+0xe5> -40006738: 05ad mov.n a10, a5 -4000673a: 03bd mov.n a11, a3 -4000673c: 4c0c movi.n a12, 4 -4000673e: c06c60 sub a6, a12, a6 -40006741: 06cd mov.n a12, a6 -40006743: 000765 call8 400067b8 <_xtos_set_intlevel+0x148> -40006746: 556a add.n a5, a5, a6 -40006748: 336a add.n a3, a3, a6 -4000674a: c04460 sub a4, a4, a6 -4000674d: 000346 j 4000675e <_xtos_set_intlevel+0xee> -40006750: 004136 entry a1, 32 -40006753: 025d mov.n a5, a2 -40006755: 6244b6 bltui a4, 4, 400067bb <_xtos_set_intlevel+0x14b> -40006758: 146020 extui a6, a2, 0, 2 -4000675b: fd9656 bnez a6, 40006738 <_xtos_set_intlevel+0xc8> -4000675e: 417440 srli a7, a4, 4 -40006761: 14b030 extui a11, a3, 0, 2 -40006764: 09cb56 bnez a11, 40006804 <_xtos_set_intlevel+0x194> -40006767: 159776 loopnez a7, 40006780 <_xtos_set_intlevel+0x110> -4000676a: 0368 l32i.n a6, a3, 0 -4000676c: 1378 l32i.n a7, a3, 4 -4000676e: 0569 s32i.n a6, a5, 0 -40006770: 2368 l32i.n a6, a3, 8 -40006772: 1579 s32i.n a7, a5, 4 -40006774: 3378 l32i.n a7, a3, 12 -40006776: 2569 s32i.n a6, a5, 8 -40006778: 10c332 addi a3, a3, 16 -4000677b: 3579 s32i.n a7, a5, 12 -4000677d: 10c552 addi a5, a5, 16 -40006780: 0d6437 bbci a4, 3, 40006791 <_xtos_set_intlevel+0x121> -40006783: 0368 l32i.n a6, a3, 0 -40006785: 1378 l32i.n a7, a3, 4 -40006787: 338b addi.n a3, a3, 8 -40006789: 0569 s32i.n a6, a5, 0 -4000678b: 016572 s32i a7, a5, 4 -4000678e: 08c552 addi a5, a5, 8 -40006791: 076427 bbci a4, 2, 4000679c <_xtos_set_intlevel+0x12c> -40006794: 0368 l32i.n a6, a3, 0 -40006796: 334b addi.n a3, a3, 4 -40006798: 0569 s32i.n a6, a5, 0 -4000679a: 554b addi.n a5, a5, 4 -4000679c: 144040 extui a4, a4, 0, 2 -4000679f: 349c beqz.n a4, 400067b6 <_xtos_set_intlevel+0x146> -400067a1: 0368 l32i.n a6, a3, 0 -400067a3: 0578 l32i.n a7, a5, 0 -400067a5: 402400 ssa8l a4 -400067a8: a16600 sll a6, a6 -400067ab: 917070 srl a7, a7 -400067ae: 403400 ssa8b a4 -400067b1: 817760 src a7, a7, a6 -400067b4: 0579 s32i.n a7, a5, 0 -400067b6: f01d retw.n -400067b8: 002136 entry a1, 16 -400067bb: 041416 beqz a4, 40006800 <_xtos_set_intlevel+0x190> -400067be: c57c movi.n a5, -4 -400067c0: 105350 and a5, a3, a5 -400067c3: 0568 l32i.n a6, a5, 0 -400067c5: 1578 l32i.n a7, a5, 4 -400067c7: 402300 ssa8l a3 -400067ca: 813760 src a3, a7, a6 -400067cd: 14a020 extui a10, a2, 0, 2 -400067d0: c052a0 sub a5, a2, a10 -400067d3: 0588 l32i.n a8, a5, 0 -400067d5: 6a4a add.n a6, a10, a4 -400067d7: 402200 ssa8l a2 -400067da: a1a800 sll a10, a8 -400067dd: 0b46b6 bltui a6, 4, 400067ec <_xtos_set_intlevel+0x17c> -400067e0: 1588 l32i.n a8, a5, 4 -400067e2: 403200 ssa8b a2 -400067e5: 81a3a0 src a10, a3, a10 -400067e8: 05a9 s32i.n a10, a5, 0 -400067ea: 554b addi.n a5, a5, 4 -400067ec: 402400 ssa8l a4 -400067ef: 8133a0 src a3, a3, a10 -400067f2: 402600 ssa8l a6 -400067f5: 918080 srl a8, a8 -400067f8: 403600 ssa8b a6 -400067fb: 818830 src a8, a8, a3 -400067fe: 0589 s32i.n a8, a5, 0 -40006800: f01d retw.n -40006802: 000000 ill -40006805: 304023 excw -40006808: b014b0 addx8 a1, a4, a11 -4000680b: 68c033 excw -4000680e: 977603 excw -40006811: 137821 l32r a2, 3ffcb5f4 <_start-0x34a0c> -40006814: 2388 l32i.n a8, a3, 8 -40006816: 816760 src a6, a7, a6 -40006819: 0569 s32i.n a6, a5, 0 -4000681b: 3398 l32i.n a9, a3, 12 -4000681d: 817870 src a7, a8, a7 -40006820: 1579 s32i.n a7, a5, 4 -40006822: 4368 l32i.n a6, a3, 16 -40006824: 818980 src a8, a9, a8 -40006827: 2589 s32i.n a8, a5, 8 -40006829: 10c332 addi a3, a3, 16 -4000682c: 819690 src a9, a6, a9 -4000682f: 3599 s32i.n a9, a5, 12 -40006831: 10c552 addi a5, a5, 16 -40006834: 146437 bbci a4, 3, 4000684c <_xtos_set_intlevel+0x1dc> -40006837: 1378 l32i.n a7, a3, 4 -40006839: 2388 l32i.n a8, a3, 8 -4000683b: 816760 src a6, a7, a6 -4000683e: 0569 s32i.n a6, a5, 0 -40006840: 338b addi.n a3, a3, 8 -40006842: 817870 src a7, a8, a7 -40006845: 1579 s32i.n a7, a5, 4 -40006847: 558b addi.n a5, a5, 8 -40006849: 206880 or a6, a8, a8 -4000684c: 0c6427 bbci a4, 2, 4000685c <_xtos_set_intlevel+0x1ec> -4000684f: 1378 l32i.n a7, a3, 4 -40006851: 334b addi.n a3, a3, 4 -40006853: 816760 src a6, a7, a6 -40006856: 0569 s32i.n a6, a5, 0 -40006858: 554b addi.n a5, a5, 4 -4000685a: 076d mov.n a6, a7 -4000685c: 1378 l32i.n a7, a3, 4 -4000685e: 0538 l32i.n a3, a5, 0 -40006860: 816760 src a6, a7, a6 -40006863: 402400 ssa8l a4 -40006866: a16600 sll a6, a6 -40006869: 913030 srl a3, a3 -4000686c: 403400 ssa8b a4 -4000686f: 813360 src a3, a3, a6 -40006872: 0539 s32i.n a3, a5, 0 -40006874: f01d retw.n -40006876: 360000 excw -40006879: 200021 l32r a2, 3ffce87c <_start-0x31784> -4000687c: 1d03e2 l8ui a14, a3, 29 -4000687f: 2136f0 srai a3, a15, 6 -40006882: e32000 excw -40006885: f01d13 excw - -40006888 <__divsi3>: -40006888: 002136 entry a1, 16 -4000688b: d22230 quos a2, a2, a3 -4000688e: f01d retw.n - -40006890 <roundup2>: -40006890: 004136 entry a1, 32 -40006893: 604030 neg a4, a3 -40006896: 223a add.n a2, a2, a3 -40006898: 220b addi.n a2, a2, -1 -4000689a: 102240 and a2, a2, a4 -4000689d: f01d retw.n - ... - -400068a0 <multofup>: -400068a0: 004136 entry a1, 32 -400068a3: 223a add.n a2, a2, a3 -400068a5: 220b addi.n a2, a2, -1 -400068a7: c22230 quou a2, a2, a3 -400068aa: f01d retw.n -400068ac: 004136 entry a1, 32 -400068af: 430b addi.n a4, a3, -1 -400068b1: 320426 beqi a4, -1, 400068e7 <multofup+0x47> -400068b4: 206330 or a6, a3, a3 -400068b7: 248030 extui a8, a3, 0, 3 -400068ba: 00a032 movi a3, 0 -400068bd: 049876 loopnez a8, 400068c5 <multofup+0x25> -400068c0: 004232 s8i a3, a2, 0 -400068c3: 221b addi.n a2, a2, 1 -400068c5: 414360 srli a4, a6, 3 -400068c8: f03d nop.n -400068ca: 199476 loopnez a4, 400068e7 <multofup+0x47> -400068cd: 004232 s8i a3, a2, 0 -400068d0: 014232 s8i a3, a2, 1 -400068d3: 024232 s8i a3, a2, 2 -400068d6: 034232 s8i a3, a2, 3 -400068d9: 044232 s8i a3, a2, 4 -400068dc: 054232 s8i a3, a2, 5 -400068df: 064232 s8i a3, a2, 6 -400068e2: 074232 s8i a3, a2, 7 -400068e5: 228b addi.n a2, a2, 8 -400068e7: f01d retw.n -400068e9: 000000 ill - -400068ec <memcmp>: -400068ec: 004136 entry a1, 32 -400068ef: 1b44b6 bltui a4, 4, 4000690e <memcmp+0x22> -400068f2: 205320 or a5, a3, a2 -400068f5: 145050 extui a5, a5, 0, 2 -400068f8: 25dc bnez.n a5, 4000690e <memcmp+0x22> -400068fa: 418240 srli a8, a4, 2 -400068fd: 0d9876 loopnez a8, 4000690e <memcmp+0x22> -40006900: 03a8 l32i.n a10, a3, 0 -40006902: 0298 l32i.n a9, a2, 0 -40006904: 0699a7 bne a9, a10, 4000690e <memcmp+0x22> -40006907: 224b addi.n a2, a2, 4 -40006909: 334b addi.n a3, a3, 4 -4000690b: fcc442 addi a4, a4, -4 -4000690e: 046d mov.n a6, a4 -40006910: 440b addi.n a4, a4, -1 -40006912: 110426 beqi a4, -1, 40006927 <memcmp+0x3b> -40006915: 0e9676 loopnez a6, 40006927 <memcmp+0x3b> -40006918: 000372 l8ui a7, a3, 0 -4000691b: 000282 l8ui a8, a2, 0 -4000691e: 221b addi.n a2, a2, 1 -40006920: 089877 bne a8, a7, 4000692c <memcmp+0x40> -40006923: 440b addi.n a4, a4, -1 -40006925: 331b addi.n a3, a3, 1 -40006927: 020c movi.n a2, 0 -40006929: f01d retw.n -4000692b: 287000 excw -4000692e: f01dc0 subx8 a1, a13, a12 -40006931: 000000 ill -40006934: 947600 extui a7, a0, 6, 10 -40006937: 6209 s32i.n a0, a2, 24 -40006939: 1b0003 excw -4000693c: 456233 excw -4000693f: 551b00 extui a1, a0, 27, 6 -40006942: f01d retw.n -40006944: ed74b6 bltui a4, 7, 40006935 <memcmp+0x49> -40006947: 000362 l8ui a6, a3, 0 -4000694a: 331b addi.n a3, a3, 1 -4000694c: ffc442 addi a4, a4, -1 -4000694f: 004562 s8i a6, a5, 0 -40006952: 01c552 addi a5, a5, 1 -40006955: 276517 bbci a5, 1, 40006980 <memcpy+0xc> -40006958: d964b6 bltui a4, 6, 40006935 <memcmp+0x49> -4000695b: 000362 l8ui a6, a3, 0 -4000695e: 010372 l8ui a7, a3, 1 -40006961: 332b addi.n a3, a3, 2 -40006963: fec442 addi a4, a4, -2 -40006966: 004562 s8i a6, a5, 0 -40006969: 014572 s8i a7, a5, 1 -4000696c: 552b addi.n a5, a5, 2 -4000696e: 000386 j 40006980 <memcpy+0xc> -40006971: 000000 ill - -40006974 <memcpy>: -40006974: 002136 entry a1, 16 -40006977: 205220 or a5, a2, a2 -4000697a: c6e207 bbsi a2, 0, 40006944 <memcmp+0x58> -4000697d: d7e217 bbsi a2, 1, 40006958 <memcmp+0x6c> -40006980: 417440 srli a7, a4, 4 -40006983: 018320 slli a8, a3, 30 -40006986: 05a856 bnez a8, 400069e4 <memcpy+0x70> -40006989: 159776 loopnez a7, 400069a2 <memcpy+0x2e> -4000698c: 0368 l32i.n a6, a3, 0 -4000698e: 1378 l32i.n a7, a3, 4 -40006990: 0569 s32i.n a6, a5, 0 -40006992: 2368 l32i.n a6, a3, 8 -40006994: 1579 s32i.n a7, a5, 4 -40006996: 3378 l32i.n a7, a3, 12 -40006998: 2569 s32i.n a6, a5, 8 -4000699a: 10c332 addi a3, a3, 16 -4000699d: 3579 s32i.n a7, a5, 12 -4000699f: 10c552 addi a5, a5, 16 -400069a2: 0b6437 bbci a4, 3, 400069b1 <memcpy+0x3d> -400069a5: 0368 l32i.n a6, a3, 0 -400069a7: 1378 l32i.n a7, a3, 4 -400069a9: 338b addi.n a3, a3, 8 -400069ab: 0569 s32i.n a6, a5, 0 -400069ad: 1579 s32i.n a7, a5, 4 -400069af: 558b addi.n a5, a5, 8 -400069b1: 07e427 bbsi a4, 2, 400069bc <memcpy+0x48> -400069b4: 14e417 bbsi a4, 1, 400069cc <memcpy+0x58> -400069b7: 21e407 bbsi a4, 0, 400069dc <memcpy+0x68> -400069ba: f01d retw.n -400069bc: 0368 l32i.n a6, a3, 0 -400069be: 334b addi.n a3, a3, 4 -400069c0: 0569 s32i.n a6, a5, 0 -400069c2: 554b addi.n a5, a5, 4 -400069c4: 04e417 bbsi a4, 1, 400069cc <memcpy+0x58> -400069c7: 11e407 bbsi a4, 0, 400069dc <memcpy+0x68> -400069ca: f01d retw.n -400069cc: 001362 l16ui a6, a3, 0 -400069cf: 332b addi.n a3, a3, 2 -400069d1: 005562 s16i a6, a5, 0 -400069d4: 552b addi.n a5, a5, 2 -400069d6: 02e407 bbsi a4, 0, 400069dc <memcpy+0x68> -400069d9: f01d retw.n -400069db: 036200 excw -400069de: 456200 extui a6, a0, 18, 5 -400069e1: f01d00 subx8 a1, a13, a0 -400069e4: ffa416 beqz a4, 400069e2 <memcpy+0x6e> -400069e7: 402300 ssa8l a3 -400069ea: 15be80 extui a11, a8, 30, 2 -400069ed: c033b0 sub a3, a3, a11 -400069f0: 0368 l32i.n a6, a3, 0 -400069f2: 219776 loopnez a7, 40006a17 <memcpy+0xa3> -400069f5: 1378 l32i.n a7, a3, 4 -400069f7: 2388 l32i.n a8, a3, 8 -400069f9: 816760 src a6, a7, a6 -400069fc: 0569 s32i.n a6, a5, 0 -400069fe: 3398 l32i.n a9, a3, 12 -40006a00: 817870 src a7, a8, a7 -40006a03: 1579 s32i.n a7, a5, 4 -40006a05: 4368 l32i.n a6, a3, 16 -40006a07: 818980 src a8, a9, a8 -40006a0a: 2589 s32i.n a8, a5, 8 -40006a0c: 10c332 addi a3, a3, 16 -40006a0f: 819690 src a9, a6, a9 -40006a12: 3599 s32i.n a9, a5, 12 -40006a14: 10c552 addi a5, a5, 16 -40006a17: 156437 bbci a4, 3, 40006a30 <memcpy+0xbc> -40006a1a: 1378 l32i.n a7, a3, 4 -40006a1c: 2388 l32i.n a8, a3, 8 -40006a1e: 816760 src a6, a7, a6 -40006a21: 0569 s32i.n a6, a5, 0 -40006a23: 338b addi.n a3, a3, 8 -40006a25: 817870 src a7, a8, a7 -40006a28: 1579 s32i.n a7, a5, 4 -40006a2a: 08c552 addi a5, a5, 8 -40006a2d: 206880 or a6, a8, a8 -40006a30: 0c6427 bbci a4, 2, 40006a40 <memcpy+0xcc> -40006a33: 1378 l32i.n a7, a3, 4 -40006a35: 334b addi.n a3, a3, 4 -40006a37: 816760 src a6, a7, a6 -40006a3a: 0569 s32i.n a6, a5, 0 -40006a3c: 554b addi.n a5, a5, 4 -40006a3e: 076d mov.n a6, a7 -40006a40: 33ba add.n a3, a3, a11 -40006a42: 06e417 bbsi a4, 1, 40006a4c <memcpy+0xd8> -40006a45: 18e407 bbsi a4, 0, 40006a61 <memcpy+0xed> -40006a48: f01d retw.n -40006a4a: 620000 excw -40006a4d: 720003 excw -40006a50: 2b0103 excw -40006a53: 456233 excw -40006a56: 457200 extui a7, a0, 18, 5 -40006a59: 552b01 l32r a0, 3ffdbf08 <_start-0x240f8> -40006a5c: 01e407 bbsi a4, 0, 40006a61 <memcpy+0xed> -40006a5f: f01d retw.n -40006a61: 000362 l8ui a6, a3, 0 -40006a64: 004562 s8i a6, a5, 0 -40006a67: f01d retw.n -40006a69: 000000 ill - -40006a6c <memmove>: -40006a6c: 004136 entry a1, 32 -40006a6f: 049d mov.n a9, a4 -40006a71: 028d mov.n a8, a2 -40006a73: 04ad mov.n a10, a4 -40006a75: 032d mov.n a2, a3 -40006a77: 087d mov.n a7, a8 -40006a79: 1bb387 bgeu a3, a8, 40006a98 <memmove+0x2c> -40006a7c: 343a add.n a3, a4, a3 -40006a7e: 16b837 bgeu a8, a3, 40006a98 <memmove+0x2c> -40006a81: 748a add.n a7, a4, a8 -40006a83: 131416 beqz a4, 40006bb8 <memmove+0x14c> -40006a86: 099476 loopnez a4, 40006a93 <memmove+0x27> -40006a89: 770b addi.n a7, a7, -1 -40006a8b: 330b addi.n a3, a3, -1 -40006a8d: 000342 l8ui a4, a3, 0 -40006a90: 004742 s8i a4, a7, 0 -40006a93: 082d mov.n a2, a8 -40006a95: f01d retw.n -40006a97: b9f600 excw -40006a9a: 320602 l8ui a0, a6, 50 -40006a9d: b28000 mulsh a8, a0, a0 -40006aa0: b0b020 addx8 a11, a0, a2 -40006aa3: fb5614 excw -40006aa6: 7d0b addi.n a7, a13, -1 -40006aa8: 9008 l32i.n a0, a0, 36 -40006aaa: 9014c4 excw -40006aad: 4d4164 excw -40006ab0: 9c7606 j 3ffedc8c <_start-0x12374> -40006ab3: 025815 call4 40009034 <__umoddi3+0x21d0> -40006ab6: 0759 s32i.n a5, a7, 0 -40006ab8: 12f8 l32i.n a15, a2, 4 -40006aba: 17f9 s32i.n a15, a7, 4 -40006abc: 22e8 l32i.n a14, a2, 8 -40006abe: 27e9 s32i.n a14, a7, 8 -40006ac0: 32d8 l32i.n a13, a2, 12 -40006ac2: 37d9 s32i.n a13, a7, 12 -40006ac4: 10c222 addi a2, a2, 16 -40006ac7: 10c772 addi a7, a7, 16 -40006aca: 413240 srli a3, a4, 2 -40006acd: 459376 loopnez a3, 40006b16 <memmove+0xaa> -40006ad0: 0238 l32i.n a3, a2, 0 -40006ad2: 0739 s32i.n a3, a7, 0 -40006ad4: 1238 l32i.n a3, a2, 4 -40006ad6: 1739 s32i.n a3, a7, 4 -40006ad8: 2238 l32i.n a3, a2, 8 -40006ada: 2739 s32i.n a3, a7, 8 -40006adc: 3238 l32i.n a3, a2, 12 -40006ade: 3739 s32i.n a3, a7, 12 -40006ae0: 4238 l32i.n a3, a2, 16 -40006ae2: 4739 s32i.n a3, a7, 16 -40006ae4: 5238 l32i.n a3, a2, 20 -40006ae6: 5739 s32i.n a3, a7, 20 -40006ae8: 6238 l32i.n a3, a2, 24 -40006aea: 6739 s32i.n a3, a7, 24 -40006aec: 7238 l32i.n a3, a2, 28 -40006aee: 7739 s32i.n a3, a7, 28 -40006af0: 8238 l32i.n a3, a2, 32 -40006af2: 8739 s32i.n a3, a7, 32 -40006af4: 9238 l32i.n a3, a2, 36 -40006af6: 9739 s32i.n a3, a7, 36 -40006af8: a238 l32i.n a3, a2, 40 -40006afa: a739 s32i.n a3, a7, 40 -40006afc: b238 l32i.n a3, a2, 44 -40006afe: b739 s32i.n a3, a7, 44 -40006b00: c238 l32i.n a3, a2, 48 -40006b02: c739 s32i.n a3, a7, 48 -40006b04: d238 l32i.n a3, a2, 52 -40006b06: d739 s32i.n a3, a7, 52 -40006b08: e238 l32i.n a3, a2, 56 -40006b0a: e739 s32i.n a3, a7, 56 -40006b0c: f238 l32i.n a3, a2, 60 -40006b0e: f739 s32i.n a3, a7, 60 -40006b10: 40c222 addi a2, a2, 64 -40006b13: 40c772 addi a7, a7, 64 -40006b16: 1166c0 slli a6, a6, 4 -40006b19: c06960 sub a6, a9, a6 -40006b1c: 06ad mov.n a10, a6 -40006b1e: 4546b6 bltui a6, 4, 40006b67 <memmove+0xfb> -40006b21: 24b260 extui a11, a6, 2, 3 -40006b24: 419260 srli a9, a6, 2 -40006b27: 204990 or a4, a9, a9 -40006b2a: 413340 srli a3, a4, 3 -40006b2d: 079b76 loopnez a11, 40006b38 <memmove+0xcc> -40006b30: 02c8 l32i.n a12, a2, 0 -40006b32: 07c9 s32i.n a12, a7, 0 -40006b34: 224b addi.n a2, a2, 4 -40006b36: 774b addi.n a7, a7, 4 -40006b38: 11a9e0 slli a10, a9, 2 -40006b3b: 259376 loopnez a3, 40006b64 <memmove+0xf8> -40006b3e: 0238 l32i.n a3, a2, 0 -40006b40: 0739 s32i.n a3, a7, 0 -40006b42: 1238 l32i.n a3, a2, 4 -40006b44: 1739 s32i.n a3, a7, 4 -40006b46: 2238 l32i.n a3, a2, 8 -40006b48: 2739 s32i.n a3, a7, 8 -40006b4a: 3238 l32i.n a3, a2, 12 -40006b4c: 3739 s32i.n a3, a7, 12 -40006b4e: 4238 l32i.n a3, a2, 16 -40006b50: 4739 s32i.n a3, a7, 16 -40006b52: 5238 l32i.n a3, a2, 20 -40006b54: 5739 s32i.n a3, a7, 20 -40006b56: 6238 l32i.n a3, a2, 24 -40006b58: 6739 s32i.n a3, a7, 24 -40006b5a: 7238 l32i.n a3, a2, 28 -40006b5c: 7739 s32i.n a3, a7, 28 -40006b5e: 20c222 addi a2, a2, 32 -40006b61: 20c772 addi a7, a7, 32 -40006b64: c0a6a0 sub a10, a6, a10 -40006b67: ba0b addi.n a11, a10, -1 -40006b69: 4b0b26 beqi a11, -1, 40006bb8 <memmove+0x14c> -40006b6c: 4133a0 srli a3, a10, 3 -40006b6f: 24c0a0 extui a12, a10, 0, 3 -40006b72: 099c76 loopnez a12, 40006b7f <memmove+0x113> -40006b75: 0002d2 l8ui a13, a2, 0 -40006b78: 0047d2 s8i a13, a7, 0 -40006b7b: 221b addi.n a2, a2, 1 -40006b7d: 771b addi.n a7, a7, 1 -40006b7f: f03d nop.n -40006b81: 339376 loopnez a3, 40006bb8 <memmove+0x14c> -40006b84: 000232 l8ui a3, a2, 0 -40006b87: 004732 s8i a3, a7, 0 -40006b8a: 010232 l8ui a3, a2, 1 -40006b8d: 014732 s8i a3, a7, 1 -40006b90: 020232 l8ui a3, a2, 2 -40006b93: 024732 s8i a3, a7, 2 -40006b96: 030232 l8ui a3, a2, 3 -40006b99: 034732 s8i a3, a7, 3 -40006b9c: 040232 l8ui a3, a2, 4 -40006b9f: 044732 s8i a3, a7, 4 -40006ba2: 050232 l8ui a3, a2, 5 -40006ba5: 054732 s8i a3, a7, 5 -40006ba8: 060232 l8ui a3, a2, 6 -40006bab: 064732 s8i a3, a7, 6 -40006bae: 070232 l8ui a3, a2, 7 -40006bb1: 074732 s8i a3, a7, 7 -40006bb4: 228b addi.n a2, a2, 8 -40006bb6: 778b addi.n a7, a7, 8 -40006bb8: 082d mov.n a2, a8 -40006bba: f01d retw.n -40006bbc: 947600 extui a7, a0, 6, 10 -40006bbf: 453204 excw -40006bc2: 551b00 extui a1, a0, 27, 6 -40006bc5: f01d retw.n -40006bc7: 84b600 extui a11, a0, 6, 9 -40006bca: 4532f1 l32r a15, 3ffd8094 <_start-0x27f6c> -40006bcd: 551b00 extui a1, a0, 27, 6 -40006bd0: 440b addi.n a4, a4, -1 -40006bd2: 286517 bbci a5, 1, 40006bfe <memset+0x1a> -40006bd5: e484b6 bltui a4, 8, 40006bbd <memmove+0x151> -40006bd8: 005532 s16i a3, a5, 0 -40006bdb: 552b addi.n a5, a5, 2 -40006bdd: fec442 addi a4, a4, -2 -40006be0: 000686 j 40006bfe <memset+0x1a> - ... - -40006be4 <memset>: -40006be4: 002136 entry a1, 16 -40006be7: 743030 extui a3, a3, 0, 8 -40006bea: 117380 slli a7, a3, 8 -40006bed: 203370 or a3, a3, a7 -40006bf0: 117300 slli a7, a3, 16 -40006bf3: 203370 or a3, a3, a7 -40006bf6: 025d mov.n a5, a2 -40006bf8: cce207 bbsi a2, 0, 40006bc8 <memmove+0x15c> -40006bfb: d6e217 bbsi a2, 1, 40006bd5 <memmove+0x169> -40006bfe: 417440 srli a7, a4, 4 -40006c01: 0a9776 loopnez a7, 40006c0f <memset+0x2b> -40006c04: 0539 s32i.n a3, a5, 0 -40006c06: 1539 s32i.n a3, a5, 4 -40006c08: 2539 s32i.n a3, a5, 8 -40006c0a: 3539 s32i.n a3, a5, 12 -40006c0c: 10c552 addi a5, a5, 16 -40006c0f: 066437 bbci a4, 3, 40006c19 <memset+0x35> -40006c12: 0539 s32i.n a3, a5, 0 -40006c14: 1539 s32i.n a3, a5, 4 -40006c16: 08c552 addi a5, a5, 8 -40006c19: 036427 bbci a4, 2, 40006c20 <memset+0x3c> -40006c1c: 0539 s32i.n a3, a5, 0 -40006c1e: 554b addi.n a5, a5, 4 -40006c20: 046417 bbci a4, 1, 40006c28 <memset+0x44> -40006c23: 005532 s16i a3, a5, 0 -40006c26: 552b addi.n a5, a5, 2 -40006c28: 026407 bbci a4, 0, 40006c2e <memset+0x4a> -40006c2b: 004532 s8i a3, a5, 0 -40006c2e: f01d retw.n - -40006c30 <__udivdi3>: -40006c30: 008136 entry a1, 64 -40006c33: 02ad mov.n a10, a2 -40006c35: 038d mov.n a8, a3 -40006c37: 0b2c movi.n a11, 32 -40006c39: 049d mov.n a9, a4 -40006c3b: 0a2516 beqz a5, 40006ce1 <__udivdi3+0xb1> -40006c3e: 07b357 bgeu a3, a5, 40006c49 <__udivdi3+0x19> -40006c41: 020c movi.n a2, 0 -40006c43: 030c movi.n a3, 0 -40006c45: f01d retw.n -40006c47: 900000 addx2 a0, a0, a0 -40006c4a: 1640f5 call12 4001d058 <__bss_start+0xd058> -40006c4d: 1e89 s32i.n a8, a14, 4 -40006c4f: c02b90 sub a2, a11, a9 -40006c52: 400200 ssr a2 -40006c55: 91f030 srl a15, a3 -40006c58: 401900 ssl a9 -40006c5b: 81c3a0 src a12, a3, a10 -40006c5e: 81b540 src a11, a5, a4 -40006c61: f480b0 extui a8, a11, 0, 16 -40006c64: f5d0b0 extui a13, a11, 16, 16 -40006c67: 404010 ssai 16 -40006c6a: c2efd0 quou a14, a15, a13 -40006c6d: 0e5d mov.n a5, a14 -40006c6f: 8238e0 mull a3, a8, a14 -40006c72: e2ffd0 remu a15, a15, a13 -40006c75: 81ffc0 src a15, a15, a12 -40006c78: 0f2d mov.n a2, a15 -40006c7a: 0ebf37 bgeu a15, a3, 40006c8c <__udivdi3+0x5c> -40006c7d: 5e0b addi.n a5, a14, -1 -40006c7f: 2bfa add.n a2, a11, a15 -40006c81: 0732b7 bltu a2, a11, 40006c8c <__udivdi3+0x5c> -40006c84: 04b237 bgeu a2, a3, 40006c8c <__udivdi3+0x5c> -40006c87: fece52 addi a5, a14, -2 -40006c8a: 2b2a add.n a2, a11, a2 -40006c8c: 115500 slli a5, a5, 16 -40006c8f: c03230 sub a3, a2, a3 -40006c92: 401900 ssl a9 -40006c95: a14400 sll a4, a4 -40006c98: c2e3d0 quou a14, a3, a13 -40006c9b: 0e2d mov.n a2, a14 -40006c9d: 8288e0 mull a8, a8, a14 -40006ca0: e233d0 remu a3, a3, a13 -40006ca3: 0bf3c0 depbits a12, a3, 16, 16 -40006ca6: 0c3d mov.n a3, a12 -40006ca8: 11bc87 bgeu a12, a8, 40006cbd <__udivdi3+0x8d> -40006cab: ffce22 addi a2, a14, -1 -40006cae: 803bc0 add a3, a11, a12 -40006cb1: 0833b7 bltu a3, a11, 40006cbd <__udivdi3+0x8d> -40006cb4: 05b387 bgeu a3, a8, 40006cbd <__udivdi3+0x8d> -40006cb7: 803b30 add a3, a11, a3 -40006cba: fece22 addi a2, a14, -2 -40006cbd: 202250 or a2, a2, a5 -40006cc0: 825240 mull a5, a2, a4 -40006cc3: a24240 muluh a4, a2, a4 -40006cc6: c03380 sub a3, a3, a8 -40006cc9: 0b3347 bltu a3, a4, 40006cd8 <__udivdi3+0xa8> -40006ccc: c06340 sub a6, a3, a4 -40006ccf: 083656 bnez a6, 40006d56 <__udivdi3+0x126> -40006cd2: a17a00 sll a7, a10 -40006cd5: 7db757 bgeu a7, a5, 40006d56 <__udivdi3+0x126> -40006cd8: 220b addi.n a2, a2, -1 -40006cda: 030c movi.n a3, 0 -40006cdc: f01d retw.n -40006cde: 000000 ill -40006ce1: 75b347 bgeu a3, a4, 40006d5a <__udivdi3+0x12a> -40006ce4: 40f450 nsau a5, a4 -40006ce7: a58c beqz.n a5, 40006cf5 <__udivdi3+0xc5> -40006ce9: 401500 ssl a5 -40006cec: a19400 sll a9, a4 -40006cef: 813320 src a3, a3, a2 -40006cf2: a12200 sll a2, a2 -40006cf5: f44090 extui a4, a9, 0, 16 -40006cf8: 404010 ssai 16 -40006cfb: f55090 extui a5, a9, 16, 16 -40006cfe: e2c350 remu a12, a3, a5 -40006d01: c2b350 quou a11, a3, a5 -40006d04: 0bad mov.n a10, a11 -40006d06: 81cc20 src a12, a12, a2 -40006d09: 8284b0 mull a8, a4, a11 -40006d0c: 0c3d mov.n a3, a12 -40006d0e: 0ebc87 bgeu a12, a8, 40006d20 <__udivdi3+0xf0> -40006d11: ab0b addi.n a10, a11, -1 -40006d13: 3c9a add.n a3, a12, a9 -40006d15: 073397 bltu a3, a9, 40006d20 <__udivdi3+0xf0> -40006d18: 04b387 bgeu a3, a8, 40006d20 <__udivdi3+0xf0> -40006d1b: fecba2 addi a10, a11, -2 -40006d1e: 393a add.n a3, a9, a3 -40006d20: c0d380 sub a13, a3, a8 -40006d23: c28d50 quou a8, a13, a5 -40006d26: 083d mov.n a3, a8 -40006d28: 824480 mull a4, a4, a8 -40006d2b: e2dd50 remu a13, a13, a5 -40006d2e: 0bfd20 depbits a2, a13, 16, 16 -40006d31: 17b247 bgeu a2, a4, 40006d4c <__udivdi3+0x11c> -40006d34: 380b addi.n a3, a8, -1 -40006d36: 229a add.n a2, a2, a9 -40006d38: 103297 bltu a2, a9, 40006d4c <__udivdi3+0x11c> -40006d3b: 0db247 bgeu a2, a4, 40006d4c <__udivdi3+0x11c> -40006d3e: 112a00 slli a2, a10, 16 -40006d41: fec832 addi a3, a8, -2 -40006d44: 202320 or a2, a3, a2 -40006d47: 030c movi.n a3, 0 -40006d49: f01d retw.n -40006d4b: 2a0000 depbits a0, a0, 2, 1 -40006d4e: 232011 l32r a1, 3ffcf9d0 <_start-0x30630> -40006d51: 030c20 rsr.scompare1 a2 -40006d54: f01d retw.n -40006d56: 030c movi.n a3, 0 -40006d58: f01d retw.n -40006d5a: 34cc bnez.n a4, 40006d61 <__udivdi3+0x131> -40006d5c: 190c movi.n a9, 1 -40006d5e: c29940 quou a9, a9, a4 -40006d61: 40f940 nsau a4, a9 -40006d64: 0ec416 beqz a4, 40006e54 <__udivdi3+0x224> -40006d67: 401400 ssl a4 -40006d6a: c06b40 sub a6, a11, a4 -40006d6d: a19900 sll a9, a9 -40006d70: 400600 ssr a6 -40006d73: 91d080 srl a13, a8 -40006d76: 401400 ssl a4 -40006d79: a15800 sll a5, a8 -40006d7c: 400600 ssr a6 -40006d7f: 9130a0 srl a3, a10 -40006d82: 401400 ssl a4 -40006d85: 203350 or a3, a3, a5 -40006d88: f44090 extui a4, a9, 0, 16 -40006d8b: a12a00 sll a2, a10 -40006d8e: f55090 extui a5, a9, 16, 16 -40006d91: 404010 ssai 16 -40006d94: c2cd50 quou a12, a13, a5 -40006d97: 0cbd mov.n a11, a12 -40006d99: e2dd50 remu a13, a13, a5 -40006d9c: 81dd30 src a13, a13, a3 -40006d9f: 82a4c0 mull a10, a4, a12 -40006da2: 0d8d mov.n a8, a13 -40006da4: 10bda7 bgeu a13, a10, 40006db8 <__udivdi3+0x188> -40006da7: ffccb2 addi a11, a12, -1 -40006daa: 808d90 add a8, a13, a9 -40006dad: 073897 bltu a8, a9, 40006db8 <__udivdi3+0x188> -40006db0: 04b8a7 bgeu a8, a10, 40006db8 <__udivdi3+0x188> -40006db3: feccb2 addi a11, a12, -2 -40006db6: 898a add.n a8, a9, a8 -40006db8: c0d8a0 sub a13, a8, a10 -40006dbb: e2ed50 remu a14, a13, a5 -40006dbe: 0bfe30 depbits a3, a14, 16, 16 -40006dc1: c2dd50 quou a13, a13, a5 -40006dc4: 0dad mov.n a10, a13 -40006dc6: 82c4d0 mull a12, a4, a13 -40006dc9: 038d mov.n a8, a3 -40006dcb: 0eb3c7 bgeu a3, a12, 40006ddd <__udivdi3+0x1ad> -40006dce: ad0b addi.n a10, a13, -1 -40006dd0: 839a add.n a8, a3, a9 -40006dd2: 073897 bltu a8, a9, 40006ddd <__udivdi3+0x1ad> -40006dd5: 04b8c7 bgeu a8, a12, 40006ddd <__udivdi3+0x1ad> -40006dd8: fecda2 addi a10, a13, -2 -40006ddb: 898a add.n a8, a9, a8 -40006ddd: c038c0 sub a3, a8, a12 -40006de0: 11bb00 slli a11, a11, 16 -40006de3: 20bab0 or a11, a10, a11 -40006de6: 404010 ssai 16 -40006de9: e2d350 remu a13, a3, a5 -40006dec: c2c350 quou a12, a3, a5 -40006def: 8284c0 mull a8, a4, a12 -40006df2: 0c3d mov.n a3, a12 -40006df4: 81dd20 src a13, a13, a2 -40006df7: 0dad mov.n a10, a13 -40006df9: 0fbd87 bgeu a13, a8, 40006e0c <__udivdi3+0x1dc> -40006dfc: 3c0b addi.n a3, a12, -1 -40006dfe: ad9a add.n a10, a13, a9 -40006e00: 083a97 bltu a10, a9, 40006e0c <__udivdi3+0x1dc> -40006e03: 05ba87 bgeu a10, a8, 40006e0c <__udivdi3+0x1dc> -40006e06: fecc32 addi a3, a12, -2 -40006e09: 80a9a0 add a10, a9, a10 -40006e0c: c0ea80 sub a14, a10, a8 -40006e0f: c28e50 quou a8, a14, a5 -40006e12: e2ee50 remu a14, a14, a5 -40006e15: 0bfe20 depbits a2, a14, 16, 16 -40006e18: 825480 mull a5, a4, a8 -40006e1b: 084d mov.n a4, a8 -40006e1d: 23b257 bgeu a2, a5, 40006e44 <__udivdi3+0x214> -40006e20: 480b addi.n a4, a8, -1 -40006e22: 229a add.n a2, a2, a9 -40006e24: 1c3297 bltu a2, a9, 40006e44 <__udivdi3+0x214> -40006e27: 19b257 bgeu a2, a5, 40006e44 <__udivdi3+0x214> -40006e2a: 113300 slli a3, a3, 16 -40006e2d: fec822 addi a2, a8, -2 -40006e30: 202230 or a2, a2, a3 -40006e33: 0b3d mov.n a3, a11 -40006e35: f01d retw.n -40006e37: 353700 extui a3, a0, 23, 4 -40006e3a: 324702 s8i a0, a7, 50 -40006e3d: 0f .byte 0xf -40006e3e: 120c movi.n a2, 1 -40006e40: 030c movi.n a3, 0 -40006e42: f01d retw.n -40006e44: 112300 slli a2, a3, 16 -40006e47: 202420 or a2, a4, a2 -40006e4a: 0b3d mov.n a3, a11 -40006e4c: f01d retw.n -40006e4e: 020c movi.n a2, 0 -40006e50: 030c movi.n a3, 0 -40006e52: f01d retw.n -40006e54: c03890 sub a3, a8, a9 -40006e57: f55090 extui a5, a9, 16, 16 -40006e5a: f44090 extui a4, a9, 0, 16 -40006e5d: 1b0c movi.n a11, 1 -40006e5f: ffe0c6 j 40006de6 <__udivdi3+0x1b6> - ... - -40006e64 <__umoddi3>: -40006e64: 00a136 entry a1, 80 -40006e67: 029d mov.n a9, a2 -40006e69: 03ad mov.n a10, a3 -40006e6b: 0b2c movi.n a11, 32 -40006e6d: 048d mov.n a8, a4 -40006e6f: 0d2516 beqz a5, 40006f45 <__umoddi3+0xe1> -40006e72: 02b357 bgeu a3, a5, 40006e78 <__umoddi3+0x14> -40006e75: 0031c6 j 40006f40 <__umoddi3+0xdc> -40006e78: 40f580 nsau a8, a5 -40006e7b: 151816 beqz a8, 40006fd0 <__umoddi3+0x16c> -40006e7e: c0eb80 sub a14, a11, a8 -40006e81: 400e00 ssr a14 -40006e84: 916030 srl a6, a3 -40006e87: 401800 ssl a8 -40006e8a: 81c320 src a12, a3, a2 -40006e8d: 815540 src a5, a5, a4 -40006e90: f4b050 extui a11, a5, 0, 16 -40006e93: f5d050 extui a13, a5, 16, 16 -40006e96: 404010 ssai 16 -40006e99: c2f6d0 quou a15, a6, a13 -40006e9c: 0f9d mov.n a9, a15 -40006e9e: 82abf0 mull a10, a11, a15 -40006ea1: e266d0 remu a6, a6, a13 -40006ea4: 8166c0 src a6, a6, a12 -40006ea7: 063d mov.n a3, a6 -40006ea9: 0fb6a7 bgeu a6, a10, 40006ebc <__umoddi3+0x58> -40006eac: 9f0b addi.n a9, a15, -1 -40006eae: 356a add.n a3, a5, a6 -40006eb0: 083357 bltu a3, a5, 40006ebc <__umoddi3+0x58> -40006eb3: 05b3a7 bgeu a3, a10, 40006ebc <__umoddi3+0x58> -40006eb6: fecf92 addi a9, a15, -2 -40006eb9: 803530 add a3, a5, a3 -40006ebc: 401800 ssl a8 -40006ebf: 119900 slli a9, a9, 16 -40006ec2: c063a0 sub a6, a3, a10 -40006ec5: c2f6d0 quou a15, a6, a13 -40006ec8: 0fad mov.n a10, a15 -40006eca: 82bbf0 mull a11, a11, a15 -40006ecd: e266d0 remu a6, a6, a13 -40006ed0: 0bf6c0 depbits a12, a6, 16, 16 -40006ed3: 0c3d mov.n a3, a12 -40006ed5: 0fbcb7 bgeu a12, a11, 40006ee8 <__umoddi3+0x84> -40006ed8: af0b addi.n a10, a15, -1 -40006eda: 35ca add.n a3, a5, a12 -40006edc: 083357 bltu a3, a5, 40006ee8 <__umoddi3+0x84> -40006edf: 05b3b7 bgeu a3, a11, 40006ee8 <__umoddi3+0x84> -40006ee2: fecfa2 addi a10, a15, -2 -40006ee5: 803530 add a3, a5, a3 -40006ee8: c033b0 sub a3, a3, a11 -40006eeb: 209a90 or a9, a10, a9 -40006eee: a1b400 sll a11, a4 -40006ef1: 8249b0 mull a4, a9, a11 -40006ef4: a299b0 muluh a9, a9, a11 -40006ef7: c0b4b0 sub a11, a4, a11 -40006efa: 09ad mov.n a10, a9 -40006efc: 0d3397 bltu a3, a9, 40006f0d <__umoddi3+0xa9> -40006eff: a12200 sll a2, a2 -40006f02: 199397 bne a3, a9, 40006f1f <__umoddi3+0xbb> -40006f05: 16b247 bgeu a2, a4, 40006f1f <__umoddi3+0xbb> -40006f08: 000106 j 40006f10 <__umoddi3+0xac> -40006f0b: 000000 ill -40006f0e: 0ca122 movi a2, 0x10c -40006f11: 5019 s32i.n a1, a0, 20 -40006f13: c0ca add.n a12, a0, a12 -40006f15: 0134b7 bltu a4, a11, 40006f1a <__umoddi3+0xb6> -40006f18: 090c movi.n a9, 0 -40006f1a: 0b4d mov.n a4, a11 -40006f1c: c09c90 sub a9, a12, a9 -40006f1f: c03390 sub a3, a3, a9 -40006f22: c04240 sub a4, a2, a4 -40006f25: 02b247 bgeu a2, a4, 40006f2b <__umoddi3+0xc7> -40006f28: 002346 j 40006fb9 <__umoddi3+0x155> -40006f2b: 401e00 ssl a14 -40006f2e: a16300 sll a6, a3 -40006f31: 400800 ssr a8 -40006f34: 913030 srl a3, a3 -40006f37: 912040 srl a2, a4 -40006f3a: 202260 or a2, a2, a6 -40006f3d: f01d retw.n -40006f3f: f01d00 subx8 a1, a13, a0 -40006f42: 000000 ill -40006f45: 023347 bltu a3, a4, 40006f4b <__umoddi3+0xe7> -40006f48: 002986 j 40006ff2 <__umoddi3+0x18e> -40006f4b: 40f450 nsau a5, a4 -40006f4e: a58c beqz.n a5, 40006f5c <__umoddi3+0xf8> -40006f50: 401500 ssl a5 -40006f53: a18400 sll a8, a4 -40006f56: 813320 src a3, a3, a2 -40006f59: a19200 sll a9, a2 -40006f5c: f42080 extui a2, a8, 0, 16 -40006f5f: 404010 ssai 16 -40006f62: f54080 extui a4, a8, 16, 16 -40006f65: c27340 quou a7, a3, a4 -40006f68: e2b340 remu a11, a3, a4 -40006f6b: 81bb90 src a11, a11, a9 -40006f6e: 823270 mull a3, a2, a7 -40006f71: 0bad mov.n a10, a11 -40006f73: 09bb37 bgeu a11, a3, 40006f80 <__umoddi3+0x11c> -40006f76: ab8a add.n a10, a11, a8 -40006f78: 043a87 bltu a10, a8, 40006f80 <__umoddi3+0x11c> -40006f7b: 01ba37 bgeu a10, a3, 40006f80 <__umoddi3+0x11c> -40006f7e: a8aa add.n a10, a8, a10 -40006f80: c06a30 sub a6, a10, a3 -40006f83: e2c640 remu a12, a6, a4 -40006f86: 0bfc90 depbits a9, a12, 16, 16 -40006f89: c24640 quou a4, a6, a4 -40006f8c: 824240 mull a4, a2, a4 -40006f8f: 093d mov.n a3, a9 -40006f91: 17b947 bgeu a9, a4, 40006fac <__umoddi3+0x148> -40006f94: 398a add.n a3, a9, a8 -40006f96: 123387 bltu a3, a8, 40006fac <__umoddi3+0x148> -40006f99: 0fb347 bgeu a3, a4, 40006fac <__umoddi3+0x148> -40006f9c: 400500 ssr a5 -40006f9f: 383a add.n a3, a8, a3 -40006fa1: c02340 sub a2, a3, a4 -40006fa4: 912020 srl a2, a2 -40006fa7: 030c movi.n a3, 0 -40006fa9: f01d retw.n -40006fab: 234000 sext a4, a0, 7 -40006fae: 0500c0 extui a0, a12, 16, 1 -40006fb1: 030c40 rsr.scompare1 a4 -40006fb4: 912020 srl a2, a2 -40006fb7: f01d retw.n -40006fb9: 401e00 ssl a14 -40006fbc: 330b addi.n a3, a3, -1 -40006fbe: a16300 sll a6, a3 -40006fc1: 400800 ssr a8 -40006fc4: 913030 srl a3, a3 -40006fc7: 912040 srl a2, a4 -40006fca: 202260 or a2, a2, a6 -40006fcd: f01d retw.n -40006fcf: 353700 extui a3, a0, 23, 4 -40006fd2: b24705 call0 3ffb9444 <_start-0x46bbc> -40006fd5: 3ac602 addi a0, a6, 58 -40006fd8: 424000 xorb b4, b0, b0 -40006fdb: 3247c0 orbc b4, b7, b12 -40006fde: 2d08 l32i.n a0, a13, 8 -40006fe0: 6a5004 excw -40006fe3: 063dc0 excw -40006fe6: f01d retw.n -40006fe8: 042d mov.n a2, a4 -40006fea: c06a50 sub a6, a10, a5 -40006fed: 360b addi.n a3, a6, -1 -40006fef: f01d retw.n -40006ff1: 34cc00 extui a12, a0, 12, 4 -40006ff4: 180c movi.n a8, 1 -40006ff6: c28840 quou a8, a8, a4 -40006ff9: 40f850 nsau a5, a8 -40006ffc: 0c8516 beqz a5, 400070c8 <__umoddi3+0x264> -40006fff: 401500 ssl a5 -40007002: c06b50 sub a6, a11, a5 -40007005: a18800 sll a8, a8 -40007008: 400600 ssr a6 -4000700b: 91c0a0 srl a12, a10 -4000700e: 401500 ssl a5 -40007011: a14a00 sll a4, a10 -40007014: 400600 ssr a6 -40007017: 913020 srl a3, a2 -4000701a: 203340 or a3, a3, a4 -4000701d: 401500 ssl a5 -40007020: a19200 sll a9, a2 -40007023: f54080 extui a4, a8, 16, 16 -40007026: f42080 extui a2, a8, 0, 16 -40007029: c2bc40 quou a11, a12, a4 -4000702c: 404010 ssai 16 -4000702f: e2cc40 remu a12, a12, a4 -40007032: 81cc30 src a12, a12, a3 -40007035: 82b2b0 mull a11, a2, a11 -40007038: 0cad mov.n a10, a12 -4000703a: 0abcb7 bgeu a12, a11, 40007048 <__umoddi3+0x1e4> -4000703d: 80ac80 add a10, a12, a8 -40007040: 043a87 bltu a10, a8, 40007048 <__umoddi3+0x1e4> -40007043: 01bab7 bgeu a10, a11, 40007048 <__umoddi3+0x1e4> -40007046: a8aa add.n a10, a8, a10 -40007048: c0bab0 sub a11, a10, a11 -4000704b: e2cb40 remu a12, a11, a4 -4000704e: 0bfc30 depbits a3, a12, 16, 16 -40007051: c2bb40 quou a11, a11, a4 -40007054: 82b2b0 mull a11, a2, a11 -40007057: 20a330 or a10, a3, a3 -4000705a: 0bb3b7 bgeu a3, a11, 40007069 <__umoddi3+0x205> -4000705d: 80a380 add a10, a3, a8 -40007060: 053a87 bltu a10, a8, 40007069 <__umoddi3+0x205> -40007063: 02bab7 bgeu a10, a11, 40007069 <__umoddi3+0x205> -40007066: 80a8a0 add a10, a8, a10 -40007069: c03ab0 sub a3, a10, a11 -4000706c: e2b340 remu a11, a3, a4 -4000706f: 404010 ssai 16 -40007072: c23340 quou a3, a3, a4 -40007075: 81bb90 src a11, a11, a9 -40007078: 823230 mull a3, a2, a3 -4000707b: 0bad mov.n a10, a11 -4000707d: 0bbb37 bgeu a11, a3, 4000708c <__umoddi3+0x228> -40007080: 80ab80 add a10, a11, a8 -40007083: 053a87 bltu a10, a8, 4000708c <__umoddi3+0x228> -40007086: 02ba37 bgeu a10, a3, 4000708c <__umoddi3+0x228> -40007089: 80a8a0 add a10, a8, a10 -4000708c: c07a30 sub a7, a10, a3 -4000708f: e26740 remu a6, a7, a4 -40007092: 0bf690 depbits a9, a6, 16, 16 -40007095: c24740 quou a4, a7, a4 -40007098: 824240 mull a4, a2, a4 -4000709b: 093d mov.n a3, a9 -4000709d: 17b947 bgeu a9, a4, 400070b8 <__umoddi3+0x254> -400070a0: 398a add.n a3, a9, a8 -400070a2: 123387 bltu a3, a8, 400070b8 <__umoddi3+0x254> -400070a5: 0fb347 bgeu a3, a4, 400070b8 <__umoddi3+0x254> -400070a8: 400500 ssr a5 -400070ab: 383a add.n a3, a8, a3 -400070ad: c02340 sub a2, a3, a4 -400070b0: 912020 srl a2, a2 -400070b3: 030c movi.n a3, 0 -400070b5: f01d retw.n -400070b7: 234000 sext a4, a0, 7 -400070ba: 0500c0 extui a0, a12, 16, 1 -400070bd: 030c40 rsr.scompare1 a4 -400070c0: 912020 srl a2, a2 -400070c3: f01d retw.n -400070c5: f01d retw.n -400070c7: 3a8000 depbits a0, a0, 3, 9 -400070ca: 4080c0 rotw -4 -400070cd: 2080f5 call12 400278dc <__bss_start+0x178dc> -400070d0: e5c6f4 excw -400070d3: ff .byte 0xff -400070d4: ffc000 excw -400070d7: 3f .byte 0x3f -400070d8: ffc864 excw -400070db: 3f .byte 0x3f -400070dc: 007104 excw -400070df: c87040 excw -400070e2: ff .byte 0xff -400070e3: 3f .byte 0x3f -400070e4: ffcd40 excw -400070e7: 3f .byte 0x3f -400070e8: 007974 excw -400070eb: cd4040 excw -400070ee: ff .byte 0xff -400070ef: 3f .byte 0x3f -400070f0: ffcd44 excw -400070f3: 3f .byte 0x3f -400070f4: 007e44 excw -400070f7: 000040 excw - ... -4000710a: b80000 excw -4000710d: 400066 bnei a0, -1, 40007151 <__umoddi3+0x2ed> -40007110: 0818 l32i.n a1, a8, 0 -40007112: b84000 excw -40007115: 400066 bnei a0, -1, 40007159 <__umoddi3+0x2f5> -40007118: 66b8 l32i.n a11, a6, 24 -4000711a: 9c4000 excw -4000711d: 0008 l32i.n a0, a0, 0 -4000711f: 001040 movsp a4, a0 -40007122: b84000 excw -40007125: 400066 bnei a0, -1, 40007169 <__umoddi3+0x305> -40007128: 66b8 l32i.n a11, a6, 24 -4000712a: b84000 excw -4000712d: 400066 bnei a0, -1, 40007171 <__umoddi3+0x30d> -40007130: 66b8 l32i.n a11, a6, 24 -40007132: b84000 excw -40007135: 400066 bnei a0, -1, 40007179 <__umoddi3+0x315> -40007138: 66b8 l32i.n a11, a6, 24 -4000713a: 304000 xor a4, a0, a0 -4000713d: 0e .byte 0xe -4000713e: 304000 xor a4, a0, a0 -40007141: 0e .byte 0xe -40007142: 304000 xor a4, a0, a0 -40007145: 0e .byte 0xe -40007146: 304000 xor a4, a0, a0 -40007149: 0e .byte 0xe -4000714a: b84000 excw -4000714d: 400066 bnei a0, -1, 40007191 <__umoddi3+0x32d> -40007150: 66b8 l32i.n a11, a6, 24 -40007152: b84000 excw -40007155: 400066 bnei a0, -1, 40007199 <__umoddi3+0x335> -40007158: 66b8 l32i.n a11, a6, 24 -4000715a: b84000 excw -4000715d: 400066 bnei a0, -1, 400071a1 <__umoddi3+0x33d> -40007160: 66b8 l32i.n a11, a6, 24 -40007162: b84000 excw -40007165: 400066 bnei a0, -1, 400071a9 <__umoddi3+0x345> -40007168: 66b8 l32i.n a11, a6, 24 -4000716a: b84000 excw -4000716d: 400066 bnei a0, -1, 400071b1 <__umoddi3+0x34d> -40007170: 66b8 l32i.n a11, a6, 24 -40007172: b84000 excw -40007175: 400066 bnei a0, -1, 400071b9 <__umoddi3+0x355> -40007178: 66b8 l32i.n a11, a6, 24 -4000717a: b84000 excw -4000717d: 400066 bnei a0, -1, 400071c1 <__umoddi3+0x35d> -40007180: 66b8 l32i.n a11, a6, 24 -40007182: b84000 excw -40007185: 400066 bnei a0, -1, 400071c9 <__umoddi3+0x365> -40007188: 66b8 l32i.n a11, a6, 24 -4000718a: b84000 excw -4000718d: 400066 bnei a0, -1, 400071d1 <__umoddi3+0x36d> -40007190: 66b8 l32i.n a11, a6, 24 -40007192: b84000 excw -40007195: 400066 bnei a0, -1, 400071d9 <__umoddi3+0x375> -40007198: 66b8 l32i.n a11, a6, 24 -4000719a: b84000 excw -4000719d: 400066 bnei a0, -1, 400071e1 <__umoddi3+0x37d> -400071a0: 66b8 l32i.n a11, a6, 24 -400071a2: b84000 excw -400071a5: 400066 bnei a0, -1, 400071e9 <__umoddi3+0x385> -400071a8: 66b8 l32i.n a11, a6, 24 -400071aa: b84000 excw -400071ad: 400066 bnei a0, -1, 400071f1 <__umoddi3+0x38d> -400071b0: 66b8 l32i.n a11, a6, 24 -400071b2: b84000 excw -400071b5: 400066 bnei a0, -1, 400071f9 <__umoddi3+0x395> -400071b8: 66b8 l32i.n a11, a6, 24 -400071ba: b84000 excw -400071bd: 400066 bnei a0, -1, 40007201 <__umoddi3+0x39d> -400071c0: 66b8 l32i.n a11, a6, 24 -400071c2: b84000 excw -400071c5: 400066 bnei a0, -1, 40007209 <__umoddi3+0x3a5> -400071c8: 66b8 l32i.n a11, a6, 24 -400071ca: b84000 excw -400071cd: 400066 bnei a0, -1, 40007211 <__umoddi3+0x3ad> -400071d0: 66b8 l32i.n a11, a6, 24 -400071d2: b84000 excw -400071d5: 400066 bnei a0, -1, 40007219 <__umoddi3+0x3b5> -400071d8: 66b8 l32i.n a11, a6, 24 -400071da: b84000 excw -400071dd: 400066 bnei a0, -1, 40007221 <__umoddi3+0x3bd> -400071e0: 66b8 l32i.n a11, a6, 24 -400071e2: b84000 excw -400071e5: 400066 bnei a0, -1, 40007229 <__umoddi3+0x3c5> -400071e8: 66b8 l32i.n a11, a6, 24 -400071ea: b84000 excw -400071ed: 400066 bnei a0, -1, 40007231 <__umoddi3+0x3cd> -400071f0: 66b8 l32i.n a11, a6, 24 -400071f2: b84000 excw -400071f5: 400066 bnei a0, -1, 40007239 <__umoddi3+0x3d5> -400071f8: 66b8 l32i.n a11, a6, 24 -400071fa: b84000 excw -400071fd: 400066 bnei a0, -1, 40007241 <__umoddi3+0x3dd> -40007200: 66b8 l32i.n a11, a6, 24 -40007202: b84000 excw -40007205: 400066 bnei a0, -1, 40007249 <__umoddi3+0x3e5> -40007208: 66b8 l32i.n a11, a6, 24 -4000720a: 684000 excw -4000720d: 400066 bnei a0, -1, 40007251 <__umoddi3+0x3ed> -40007210: 6668 l32i.n a6, a6, 24 -40007212: 684000 excw -40007215: 400066 bnei a0, -1, 40007259 <__umoddi3+0x3f5> -40007218: 6668 l32i.n a6, a6, 24 -4000721a: 684000 excw -4000721d: 400066 bnei a0, -1, 40007261 <__umoddi3+0x3fd> -40007220: 6668 l32i.n a6, a6, 24 -40007222: 684000 excw -40007225: 400066 bnei a0, -1, 40007269 <__umoddi3+0x405> -40007228: 6668 l32i.n a6, a6, 24 -4000722a: 684000 excw -4000722d: 400066 bnei a0, -1, 40007271 <__umoddi3+0x40d> -40007230: 6668 l32i.n a6, a6, 24 -40007232: 684000 excw -40007235: 400066 bnei a0, -1, 40007279 <__umoddi3+0x415> -40007238: 6668 l32i.n a6, a6, 24 -4000723a: 684000 excw -4000723d: 400066 bnei a0, -1, 40007281 <__umoddi3+0x41d> -40007240: 6668 l32i.n a6, a6, 24 -40007242: 684000 excw -40007245: 400066 bnei a0, -1, 40007289 <__umoddi3+0x425> -40007248: 6668 l32i.n a6, a6, 24 -4000724a: 684000 excw -4000724d: 400066 bnei a0, -1, 40007291 <__umoddi3+0x42d> -40007250: 6668 l32i.n a6, a6, 24 -40007252: 684000 excw -40007255: 400066 bnei a0, -1, 40007299 <__umoddi3+0x435> -40007258: 6668 l32i.n a6, a6, 24 -4000725a: 684000 excw -4000725d: 400066 bnei a0, -1, 400072a1 <__umoddi3+0x43d> -40007260: 6668 l32i.n a6, a6, 24 -40007262: 684000 excw -40007265: 400066 bnei a0, -1, 400072a9 <__umoddi3+0x445> -40007268: 6668 l32i.n a6, a6, 24 -4000726a: 684000 excw -4000726d: 400066 bnei a0, -1, 400072b1 <__umoddi3+0x44d> -40007270: 6668 l32i.n a6, a6, 24 -40007272: 684000 excw -40007275: 400066 bnei a0, -1, 400072b9 <__umoddi3+0x455> -40007278: 6668 l32i.n a6, a6, 24 -4000727a: 684000 excw -4000727d: 400066 bnei a0, -1, 400072c1 <__umoddi3+0x45d> -40007280: 6668 l32i.n a6, a6, 24 -40007282: 684000 excw -40007285: 400066 bnei a0, -1, 400072c9 <__umoddi3+0x465> -40007288: 6668 l32i.n a6, a6, 24 -4000728a: 684000 excw -4000728d: 400066 bnei a0, -1, 400072d1 <__umoddi3+0x46d> -40007290: 6668 l32i.n a6, a6, 24 -40007292: 684000 excw -40007295: 400066 bnei a0, -1, 400072d9 <__umoddi3+0x475> -40007298: 6668 l32i.n a6, a6, 24 -4000729a: 684000 excw -4000729d: 400066 bnei a0, -1, 400072e1 <__umoddi3+0x47d> -400072a0: 6668 l32i.n a6, a6, 24 -400072a2: 684000 excw -400072a5: 400066 bnei a0, -1, 400072e9 <__umoddi3+0x485> -400072a8: 6668 l32i.n a6, a6, 24 -400072aa: 684000 excw -400072ad: 400066 bnei a0, -1, 400072f1 <__umoddi3+0x48d> -400072b0: 6668 l32i.n a6, a6, 24 -400072b2: 684000 excw -400072b5: 400066 bnei a0, -1, 400072f9 <__umoddi3+0x495> -400072b8: 6668 l32i.n a6, a6, 24 -400072ba: 684000 excw -400072bd: 400066 bnei a0, -1, 40007301 <__umoddi3+0x49d> -400072c0: 6668 l32i.n a6, a6, 24 -400072c2: 684000 excw -400072c5: 400066 bnei a0, -1, 40007309 <__umoddi3+0x4a5> -400072c8: 6668 l32i.n a6, a6, 24 -400072ca: 684000 excw -400072cd: 400066 bnei a0, -1, 40007311 <__umoddi3+0x4ad> -400072d0: 6668 l32i.n a6, a6, 24 -400072d2: 684000 excw -400072d5: 400066 bnei a0, -1, 40007319 <__umoddi3+0x4b5> -400072d8: 6668 l32i.n a6, a6, 24 -400072da: 684000 excw -400072dd: 400066 bnei a0, -1, 40007321 <__umoddi3+0x4bd> -400072e0: 6668 l32i.n a6, a6, 24 -400072e2: 684000 excw -400072e5: 400066 bnei a0, -1, 40007329 <__umoddi3+0x4c5> -400072e8: 6668 l32i.n a6, a6, 24 -400072ea: 684000 excw -400072ed: 400066 bnei a0, -1, 40007331 <__umoddi3+0x4cd> -400072f0: 6668 l32i.n a6, a6, 24 -400072f2: 684000 excw -400072f5: 400066 bnei a0, -1, 40007339 <__umoddi3+0x4d5> -400072f8: 6668 l32i.n a6, a6, 24 -400072fa: 684000 excw -400072fd: 400066 bnei a0, -1, 40007341 <__umoddi3+0x4dd> -40007300: 6668 l32i.n a6, a6, 24 -40007302: 684000 excw -40007305: 400066 bnei a0, -1, 40007349 <__umoddi3+0x4e5> -40007308: 6668 l32i.n a6, a6, 24 -4000730a: 004000 break 0, 0 - ... -40007315: 000000 ill -40007318: ff .byte 0xff -40007319: ff .byte 0xff -4000731a: ff .byte 0xff -4000731b: ff .byte 0xff -4000731c: 0066b0 rsil a11, 6 -4000731f: 001f40 movsp a4, a15 -40007322: b00000 addx8 a0, a0, a0 -40007325: 400066 bnei a0, -1, 40007369 <__umoddi3+0x505> -40007328: 1e .byte 0x1e -40007329: 000000 ill -4000732c: 0066b0 rsil a11, 6 -4000732f: 001d40 movsp a4, a13 -40007332: b00000 addx8 a0, a0, a0 -40007335: 400066 bnei a0, -1, 40007379 <__umoddi3+0x515> -40007338: 001c movi.n a0, 16 -4000733a: b00000 addx8 a0, a0, a0 -4000733d: 400066 bnei a0, -1, 40007381 <__umoddi3+0x51d> -40007340: 001b addi.n a0, a0, 1 -40007342: b00000 addx8 a0, a0, a0 -40007345: 400066 bnei a0, -1, 40007389 <__umoddi3+0x525> -40007348: 001a add.n a0, a0, a1 -4000734a: b00000 addx8 a0, a0, a0 -4000734d: 400066 bnei a0, -1, 40007391 <__umoddi3+0x52d> -40007350: 0019 s32i.n a1, a0, 0 -40007352: b00000 addx8 a0, a0, a0 -40007355: 400066 bnei a0, -1, 40007399 <__umoddi3+0x535> -40007358: 0018 l32i.n a1, a0, 0 -4000735a: b00000 addx8 a0, a0, a0 -4000735d: 400066 bnei a0, -1, 400073a1 <__umoddi3+0x53d> -40007360: 000017 bnone a0, a1, 40007364 <__umoddi3+0x500> -40007363: 66b000 excw -40007366: 164000 excw -40007369: 000000 ill -4000736c: 0066b0 rsil a11, 6 -4000736f: 001540 movsp a4, a5 -40007372: b00000 addx8 a0, a0, a0 -40007375: 400066 bnei a0, -1, 400073b9 <__umoddi3+0x555> -40007378: 000014 excw -4000737b: 66b000 excw -4000737e: 134000 excw -40007381: 000000 ill -40007384: 0066b0 rsil a11, 6 -40007387: 001240 movsp a4, a2 -4000738a: b00000 addx8 a0, a0, a0 -4000738d: 400066 bnei a0, -1, 400073d1 <__umoddi3+0x56d> -40007390: 000011 l32r a1, 3ffc7390 <_start-0x38c70> -40007393: 66b000 excw -40007396: 104000 and a4, a0, a0 -40007399: 000000 ill -4000739c: 0066b0 rsil a11, 6 -4000739f: 000f40 excw -400073a2: b00000 addx8 a0, a0, a0 -400073a5: 400066 bnei a0, -1, 400073e9 <__umoddi3+0x585> -400073a8: 0e .byte 0xe -400073a9: 000000 ill -400073ac: 0066b0 rsil a11, 6 -400073af: 000d40 excw -400073b2: b00000 addx8 a0, a0, a0 -400073b5: 400066 bnei a0, -1, 400073f9 <__umoddi3+0x595> -400073b8: 000c movi.n a0, 0 -400073ba: b00000 addx8 a0, a0, a0 -400073bd: 400066 bnei a0, -1, 40007401 <__umoddi3+0x59d> -400073c0: 000b addi.n a0, a0, -1 -400073c2: b00000 addx8 a0, a0, a0 -400073c5: 400066 bnei a0, -1, 40007409 <__umoddi3+0x5a5> -400073c8: 000a add.n a0, a0, a0 -400073ca: b00000 addx8 a0, a0, a0 -400073cd: 400066 bnei a0, -1, 40007411 <__umoddi3+0x5ad> -400073d0: 0009 s32i.n a0, a0, 0 -400073d2: b00000 addx8 a0, a0, a0 -400073d5: 400066 bnei a0, -1, 40007419 <__umoddi3+0x5b5> -400073d8: 0008 l32i.n a0, a0, 0 -400073da: b00000 addx8 a0, a0, a0 -400073dd: 400066 bnei a0, -1, 40007421 <__umoddi3+0x5bd> -400073e0: 000007 bnone a0, a0, 400073e4 <__umoddi3+0x580> -400073e3: 66b000 excw -400073e6: 064000 excw -400073e9: 000000 ill -400073ec: 0066b0 rsil a11, 6 -400073ef: 000540 excw -400073f2: b00000 addx8 a0, a0, a0 -400073f5: 400066 bnei a0, -1, 40007439 <__umoddi3+0x5d5> -400073f8: 000004 excw -400073fb: 66b000 excw -400073fe: 034000 excw -40007401: 000000 ill -40007404: 0066b0 rsil a11, 6 -40007407: 000240 excw -4000740a: b00000 addx8 a0, a0, a0 -4000740d: 400066 bnei a0, -1, 40007451 <__umoddi3+0x5ed> -40007410: 000001 l32r a0, 3ffc7410 <_start-0x38bf0> -40007413: 66b000 excw -40007416: 004000 break 0, 0 -40007419: 000000 ill -4000741c: 81c000 src a12, a0, a0 -4000741f: ff .byte 0xff -40007420: 000000 ill -40007423: c00080 sub a0, a0, a8 -40007426: 00ff81 l32r a8, 3ffc7824 <_start-0x387dc> -40007429: 400000 ssr a0 -4000742c: 81c000 src a12, a0, a0 -4000742f: ff .byte 0xff -40007430: 000000 ill -40007433: c00020 sub a0, a0, a2 -40007436: 00ff81 l32r a8, 3ffc7834 <_start-0x387cc> -40007439: 100000 and a0, a0, a0 -4000743c: 81c000 src a12, a0, a0 -4000743f: ff .byte 0xff -40007440: 000000 ill -40007443: 0008 l32i.n a0, a0, 0 -40007445: ff81c0 excw -40007448: 000000 ill -4000744b: c00004 excw -4000744e: 00ff81 l32r a8, 3ffc784c <_start-0x387b4> -40007451: 020000 andb b0, b0, b0 -40007454: 81c000 src a12, a0, a0 -40007457: ff .byte 0xff -40007458: 000000 ill -4000745b: c00001 l32r a0, 3fff745c <_start-0x8ba4> -4000745e: 00ff81 l32r a8, 3ffc785c <_start-0x387a4> -40007461: 008000 any4 b0, b0:b1:b2:b3 -40007464: 81c000 src a12, a0, a0 -40007467: ff .byte 0xff -40007468: 400000 ssr a0 -4000746b: c00000 sub a0, a0, a0 -4000746e: 00ffc1 l32r a12, 3ffc786c <_start-0x38794> -40007471: 002000 isync -40007474: e1c000 excw -40007477: ff .byte 0xff -40007478: 100000 and a0, a0, a0 -4000747b: c00000 sub a0, a0, a0 -4000747e: 00fff1 l32r a15, 3ffc787c <_start-0x38784> -40007481: 000800 excw -40007484: f9c000 excw -40007487: ff .byte 0xff -40007488: 040000 extui a0, a0, 0, 1 -4000748b: c00000 sub a0, a0, a0 -4000748e: fffd excw -40007490: 020000 andb b0, b0, b0 -40007493: c00000 sub a0, a0, a0 -40007496: ff .byte 0xff -40007497: ff .byte 0xff -40007498: 010000 slli a0, a0, 32 -4000749b: c00000 sub a0, a0, a0 -4000749e: ff .byte 0xff -4000749f: ff .byte 0xff -400074a0: 008000 any4 b0, b0:b1:b2:b3 -400074a3: c00000 sub a0, a0, a0 -400074a6: ff .byte 0xff -400074a7: ff .byte 0xff -400074a8: 004000 break 0, 0 -400074ab: c00000 sub a0, a0, a0 -400074ae: ff .byte 0xff -400074af: ff .byte 0xff -400074b0: 002000 isync -400074b3: e00000 subx4 a0, a0, a0 -400074b6: ff .byte 0xff -400074b7: ff .byte 0xff -400074b8: 001000 movsp a0, a0 -400074bb: f00000 subx8 a0, a0, a0 -400074be: ff .byte 0xff -400074bf: ff .byte 0xff -400074c0: 000800 excw -400074c3: f80000 excw -400074c6: ff .byte 0xff -400074c7: ff .byte 0xff -400074c8: 000400 excw -400074cb: fc0000 excw -400074ce: ff .byte 0xff -400074cf: ff .byte 0xff -400074d0: 000200 excw -400074d3: fe0000 excw -400074d6: ff .byte 0xff -400074d7: ff .byte 0xff -400074d8: 000100 excw -400074db: ff0000 excw -400074de: ff .byte 0xff -400074df: ff .byte 0xff -400074e0: 000080 ret -400074e3: ff8000 excw -400074e6: ff .byte 0xff -400074e7: ff .byte 0xff -400074e8: 000040 excw -400074eb: ffc000 excw -400074ee: ff .byte 0xff -400074ef: ff .byte 0xff -400074f0: 000020 excw -400074f3: ffe000 excw -400074f6: ff .byte 0xff -400074f7: ff .byte 0xff -400074f8: 000010 excw -400074fb: fff000 excw -400074fe: ff .byte 0xff -400074ff: ff .byte 0xff -40007500: 0008 l32i.n a0, a0, 0 -40007502: f80000 excw -40007505: ff .byte 0xff -40007506: ff .byte 0xff -40007507: ff .byte 0xff -40007508: 000004 excw -4000750b: fffc00 excw -4000750e: ff .byte 0xff -4000750f: ff .byte 0xff -40007510: 000002 l8ui a0, a0, 0 -40007513: fffe00 excw -40007516: ff .byte 0xff -40007517: ff .byte 0xff -40007518: 000001 l32r a0, 3ffc7518 <_start-0x38ae8> -4000751b: 000000 ill -4000751e: 040000 extui a0, a0, 0, 1 -40007521: 3fffc7 bbsi a15, 28, 40007564 <__umoddi3+0x700> -40007524: c76c movi.n a7, -20 -40007526: ff .byte 0xff -40007527: 3f .byte 0x3f -40007528: ffc7d4 excw -4000752b: 3f .byte 0x3f - ... -40007550: ffca50 excw -40007553: 3f .byte 0x3f - ... -400075c4: 000001 l32r a0, 3ffc75c4 <_start-0x38a3c> -400075c7: 000000 ill -400075ca: 0e0000 read_impwire a0 -400075cd: abcd33 excw -400075d0: 6d1234 excw -400075d3: deece6 bgei a12, 128, 400075b5 <__umoddi3+0x751> -400075d6: 0b0005 call0 400125d8 <__bss_start+0x25d8> - ... -40007941: 000000 ill -40007944: c418 l32i.n a1, a4, 48 -40007946: ff .byte 0xff -40007947: 3f .byte 0x3f -40007948: 000d mov.n a0, a0 -4000794a: 4c0000 excw -4000794d: ffc8 l32i.n a12, a15, 60 -4000794f: 3f .byte 0x3f -40007950: ef .byte 0xef -40007951: 001540 movsp a4, a5 -40007954: 200000 or a0, a0, a0 -40007957: 000000 ill -4000795a: 000001 l32r a0, 3ffc795c <_start-0x386a4> -4000795d: 000010 excw -40007960: 000100 excw -40007963: ffff00 excw - ... -40007972: 180000 excw -40007975: 3fffc4 excw - ... -40007984: 737465 call8 4007b0cc <__bss_start+0x6b0cc> -40007987: 5f .byte 0x5f -40007988: 706e75 call12 40078070 <__bss_start+0x68070> -4000798b: 6b6361 l32r a6, 3ffe2718 <_start-0x1d8e8> -4000798e: 5f .byte 0x5f -4000798f: 616c66 bnei a12, 6, 400079f4 <__umoddi3+0xb90> -40007992: 5f6873 excw -40007995: 646f63 excw -40007998: 000065 call8 400079a0 <__umoddi3+0xb3c> - ... -400079a3: 26b300 excw -400079a6: 684000 excw -400079a9: 400024 excw -400079ac: 2468 l32i.n a6, a4, 8 -400079ae: 684000 excw -400079b1: 400024 excw -400079b4: 2468 l32i.n a6, a4, 8 -400079b6: 684000 excw -400079b9: 400024 excw -400079bc: 2468 l32i.n a6, a4, 8 -400079be: 684000 excw -400079c1: 400024 excw -400079c4: 2468 l32i.n a6, a4, 8 -400079c6: 684000 excw -400079c9: 400024 excw -400079cc: 2468 l32i.n a6, a4, 8 -400079ce: 684000 excw -400079d1: 400024 excw -400079d4: 2468 l32i.n a6, a4, 8 -400079d6: 684000 excw -400079d9: 400024 excw -400079dc: 2468 l32i.n a6, a4, 8 -400079de: 684000 excw -400079e1: 400024 excw -400079e4: 2468 l32i.n a6, a4, 8 -400079e6: 684000 excw -400079e9: 400024 excw -400079ec: 2468 l32i.n a6, a4, 8 -400079ee: 684000 excw -400079f1: 400024 excw -400079f4: 2468 l32i.n a6, a4, 8 -400079f6: 684000 excw -400079f9: 400024 excw -400079fc: 2468 l32i.n a6, a4, 8 -400079fe: 684000 excw -40007a01: 400024 excw -40007a04: 2468 l32i.n a6, a4, 8 -40007a06: 684000 excw -40007a09: 400024 excw -40007a0c: 2468 l32i.n a6, a4, 8 -40007a0e: 684000 excw -40007a11: 400024 excw -40007a14: 2468 l32i.n a6, a4, 8 -40007a16: 684000 excw -40007a19: 400024 excw -40007a1c: 002681 l32r a8, 3ffc7ab4 <_start-0x3854c> -40007a1f: 253840 extui a3, a4, 24, 3 -40007a22: 684000 excw -40007a25: 400024 excw -40007a28: 2468 l32i.n a6, a4, 8 -40007a2a: 684000 excw -40007a2d: 400024 excw -40007a30: 2468 l32i.n a6, a4, 8 -40007a32: 684000 excw -40007a35: 400024 excw -40007a38: 2468 l32i.n a6, a4, 8 -40007a3a: 684000 excw -40007a3d: 400024 excw -40007a40: 2468 l32i.n a6, a4, 8 -40007a42: 684000 excw -40007a45: 400024 excw -40007a48: 2468 l32i.n a6, a4, 8 -40007a4a: 684000 excw -40007a4d: 400024 excw -40007a50: 2468 l32i.n a6, a4, 8 -40007a52: 684000 excw -40007a55: 400024 excw -40007a58: 2468 l32i.n a6, a4, 8 -40007a5a: 354000 extui a4, a0, 16, 4 -40007a5d: 400026 beqi a0, -1, 40007aa1 <__umoddi3+0xc3d> -40007a60: 2468 l32i.n a6, a4, 8 -40007a62: 384000 excw -40007a65: 400025 call8 40047a68 <__bss_start+0x37a68> -40007a68: 2468 l32i.n a6, a4, 8 -40007a6a: 684000 excw -40007a6d: 400024 excw -40007a70: 2538 l32i.n a3, a5, 8 -40007a72: 684000 excw -40007a75: 400024 excw -40007a78: 2468 l32i.n a6, a4, 8 -40007a7a: 684000 excw -40007a7d: 400024 excw -40007a80: 2468 l32i.n a6, a4, 8 -40007a82: 684000 excw -40007a85: 400024 excw -40007a88: 2468 l32i.n a6, a4, 8 -40007a8a: 684000 excw -40007a8d: 400024 excw -40007a90: 2468 l32i.n a6, a4, 8 -40007a92: 684000 excw -40007a95: 400024 excw -40007a98: 2468 l32i.n a6, a4, 8 -40007a9a: 814000 src a4, a0, a0 -40007a9d: 400026 beqi a0, -1, 40007ae1 <__umoddi3+0xc7d> -40007aa0: 2538 l32i.n a3, a5, 8 -40007aa2: 684000 excw -40007aa5: 400024 excw -40007aa8: 2468 l32i.n a6, a4, 8 -40007aaa: 684000 excw -40007aad: 400024 excw -40007ab0: 2468 l32i.n a6, a4, 8 -40007ab2: 684000 excw -40007ab5: 400024 excw -40007ab8: 2468 l32i.n a6, a4, 8 -40007aba: 684000 excw -40007abd: 400024 excw -40007ac0: 2468 l32i.n a6, a4, 8 -40007ac2: 684000 excw -40007ac5: 400024 excw -40007ac8: 2468 l32i.n a6, a4, 8 -40007aca: 684000 excw -40007acd: 400024 excw -40007ad0: 002527 blt a5, a2, 40007ad4 <__umoddi3+0xc70> -40007ad3: 246840 extui a6, a4, 8, 3 -40007ad6: 684000 excw -40007ad9: 400024 excw -40007adc: 002635 call12 40007d40 <__umoddi3+0xedc> -40007adf: 246840 extui a6, a4, 8, 3 -40007ae2: 384000 excw -40007ae5: 400025 call8 40047ae8 <__bss_start+0x37ae8> -40007ae8: 2468 l32i.n a6, a4, 8 -40007aea: 684000 excw -40007aed: 400024 excw -40007af0: 2538 l32i.n a3, a5, 8 -40007af2: 124000 andbc b4, b0, b0 -40007af5: 400030 excw -40007af8: 003012 excw -40007afb: 30c240 xor a12, a2, a4 -40007afe: b04000 addx8 a4, a0, a0 -40007b01: 400030 excw -40007b04: 3098 l32i.n a9, a0, 12 -40007b06: 1e4000 excw -40007b09: 400030 excw -40007b0c: 003084 excw -40007b0f: 307240 xor a7, a2, a4 -40007b12: 624000 excw -40007b15: 400030 excw -40007b18: 003052 excw -40007b1b: 304040 xor a4, a0, a4 -40007b1e: 304000 xor a4, a0, a0 -40007b21: 400030 excw -40007b24: 00dbc0 excw - ... -40007b33: 010100 slli a0, a1, 32 -40007b36: 010101 l32r a0, 3ffc7f3c <_start-0x380c4> -40007b39: 010101 l32r a0, 3ffc7f40 <_start-0x380c0> -40007b3c: 010101 l32r a0, 3ffc7f40 <_start-0x380c0> -40007b3f: 010101 l32r a0, 3ffc7f44 <_start-0x380bc> -40007b42: 050307 bnone a3, a0, 40007b4b <__umoddi3+0xce7> -40007b45: 010101 l32r a0, 3ffc7f4c <_start-0x380b4> -40007b48: 010101 l32r a0, 3ffc7f4c <_start-0x380b4> -40007b4b: 020202 l8ui a0, a2, 2 -40007b4e: 030302 l8ui a0, a3, 3 -40007b51: 050403 excw -40007b54: 000043 excw -40007b57: 200a00 or a0, a10, a0 -40007b5a: 737465 call8 4007b2a0 <__bss_start+0x6b2a0> -40007b5d: 732520 maxu a2, a5, a2 -40007b60: 722c movi.n a2, 39 -40007b62: 207473 excw -40007b65: 756163 excw -40007b68: 3a6573 excw -40007b6b: 2c6425 call8 400341ac <__bss_start+0x241ac> -40007b6e: 6f6220 excw -40007b71: 6f .byte 0x6f -40007b72: 6d2074 excw -40007b75: 6f .byte 0x6f -40007b76: 3a6564 excw -40007b79: 2528 l32i.n a2, a5, 8 -40007b7b: 2978 l32i.n a7, a9, 8 -40007b7d: 0a0a add.n a0, a10, a0 -40007b7f: 754a00 extui a4, a0, 26, 8 -40007b82: 206c movi.n a0, -30 -40007b84: 203520 or a3, a5, a2 -40007b87: 313032 excw -40007b8a: 250035 call12 4002cb8c <__bss_start+0x1cb8c> -40007b8d: 252073 excw -40007b90: 0a2075 call12 40011d98 <__bss_start+0x1d98> -40007b93: 746500 extui a6, a0, 5, 8 -40007b96: 6d5f73 excw -40007b99: 6e6961 l32r a6, 3ffe3540 <_start-0x1cac0> -40007b9c: 2e .byte 0x2e -40007b9d: 000063 excw -40007ba0: 657375 call12 4006d2d8 <__bss_start+0x5d2d8> -40007ba3: 632072 l32i a7, a0, 0x18c -40007ba6: 6f .byte 0x6f -40007ba7: 206564 excw -40007baa: 6e6f64 excw -40007bad: 000a65 call8 40007c54 <__umoddi3+0xdf0> -40007bb0: 696177 bbci a1, 7, 40007c1d <__umoddi3+0xdb9> -40007bb3: 6e6974 excw -40007bb6: 662067 blt a0, a6, 40007c20 <__umoddi3+0xdbc> -40007bb9: 6f .byte 0x6f -40007bba: 682072 l32i a7, a0, 0x1a0 -40007bbd: 6f .byte 0x6f -40007bbe: 0a7473 excw -40007bc1: 000000 ill -40007bc4: 697073 excw -40007bc7: 6d6320 excw -40007bca: 6c2064 excw -40007bcd: 206e65 call8 400282b4 <__bss_start+0x182b4> -40007bd0: 0a6425 call8 40012214 <__bss_start+0x2214> -40007bd3: 642500 extui a2, a0, 5, 7 -40007bd6: 696c20 excw -40007bd9: 6e .byte 0x6e -40007bda: 202c65 call8 40027ea0 <__bss_start+0x17ea0> -40007bdd: 206425 call8 40028220 <__bss_start+0x18220> -40007be0: 6f6d excw -40007be2: 0a6564 excw -40007be5: 000000 ill -40007be8: 6f6c movi.n a15, -26 -40007bea: 206461 l32r a6, 3ffcfd7c <_start-0x30284> -40007bed: 257830 extui a7, a3, 24, 3 -40007bf0: 783830 excw -40007bf3: 202c movi.n a0, 34 -40007bf5: 656c movi.n a5, -26 -40007bf7: 6e .byte 0x6e -40007bf8: 642520 extui a2, a2, 5, 7 -40007bfb: 202c movi.n a0, 34 -40007bfd: 6f6f72 s32i a7, a15, 0x1bc -40007c00: 206d excw -40007c02: 0a6425 call8 40012244 <__bss_start+0x2244> -40007c05: 000000 ill -40007c08: 616c66 bnei a12, 6, 40007c6d <__umoddi3+0xe09> -40007c0b: 206873 excw -40007c0e: 616572 s32i a7, a5, 0x184 -40007c11: 652064 excw -40007c14: 2c7272 excw -40007c17: 732520 maxu a2, a5, a2 -40007c1a: 000a add.n a0, a0, a0 -40007c1c: 696174 excw -40007c1f: 206c movi.n a0, -30 -40007c21: 0a6425 call8 40012264 <__bss_start+0x2264> -40007c24: 000000 ill -40007c27: 686300 excw -40007c2a: 736b addi.n a7, a3, 6 -40007c2c: 206d75 call12 40028304 <__bss_start+0x18304> -40007c2f: 257830 extui a7, a3, 24, 3 -40007c32: 783230 excw -40007c35: 000a add.n a0, a0, a0 -40007c37: 736300 maxu a6, a3, a0 -40007c3a: 206d75 call12 40028310 <__bss_start+0x18310> -40007c3d: 257830 extui a7, a3, 24, 3 -40007c40: 783230 excw -40007c43: 000a add.n a0, a0, a0 -40007c45: 000000 ill -40007c48: 757363 excw -40007c4b: 206d excw -40007c4d: 727265 call8 4007a374 <__bss_start+0x6a374> -40007c50: 000a add.n a0, a0, a0 -40007c52: 680000 excw -40007c55: 6f .byte 0x6f -40007c56: 642520 extui a2, a2, 5, 7 -40007c59: 617420 excw -40007c5c: 6c69 s32i.n a6, a12, 24 -40007c5e: 642520 extui a2, a2, 5, 7 -40007c61: 6f7220 excw -40007c64: 6f .byte 0x6f -40007c65: 206d excw -40007c67: 0a6425 call8 400122a8 <__bss_start+0x22a8> -40007c6a: 090000 l32e a0, a0, -64 -40007c6d: 735f20 maxu a5, a15, a2 -40007c70: 636174 excw -40007c73: 5f6b addi.n a5, a15, 6 -40007c75: 6e6573 excw -40007c78: 797274 excw -40007c7b: 203a add.n a2, a0, a3 -40007c7d: 2c7025 call8 40034380 <__bss_start+0x24380> -40007c80: 200920 or a0, a9, a2 -40007c83: 5f .byte 0x5f -40007c84: 5f .byte 0x5f -40007c85: 617473 excw -40007c88: 3a6b63 excw -40007c8b: 783020 excw -40007c8e: 383025 call8 4003ff90 <__bss_start+0x2ff90> -40007c91: 2c78 l32i.n a7, a12, 8 -40007c93: 200a20 or a0, a10, a2 -40007c96: 2009 s32i.n a0, a0, 8 -40007c98: 5f .byte 0x5f -40007c99: 737362 excw -40007c9c: 5f .byte 0x5f -40007c9d: 617473 excw -40007ca0: 3a7472 excw -40007ca3: 783020 excw -40007ca6: 383025 call8 4003ffa8 <__bss_start+0x2ffa8> -40007ca9: 2c78 l32i.n a7, a12, 8 -40007cab: 200920 or a0, a9, a2 -40007cae: 5f .byte 0x5f -40007caf: 737362 excw -40007cb2: 5f .byte 0x5f -40007cb3: 646e65 call8 4006c398 <__bss_start+0x5c398> -40007cb6: 203a add.n a2, a0, a3 -40007cb8: 257830 extui a7, a3, 24, 3 -40007cbb: 783830 excw -40007cbe: 202c movi.n a0, 34 -40007cc0: 200a add.n a2, a0, a0 -40007cc2: 2009 s32i.n a0, a0, 8 -40007cc4: 5f .byte 0x5f -40007cc5: 746164 excw -40007cc8: 735f61 l32r a6, 3ffe4a44 <_start-0x1b5bc> -40007ccb: 726174 excw -40007cce: 203a74 excw -40007cd1: 2c7025 call8 400343d4 <__bss_start+0x243d4> -40007cd4: 200920 or a0, a9, a2 -40007cd7: 5f .byte 0x5f -40007cd8: 746164 excw -40007cdb: 655f61 l32r a6, 3ffe1258 <_start-0x1eda8> -40007cde: 6e .byte 0x6e -40007cdf: 203a64 excw -40007ce2: 207025 call8 400283e4 <__bss_start+0x183e4> -40007ce5: 000a add.n a0, a0, a0 -40007ce7: 707300 excw -40007cea: 702520 excw -40007ced: 000a20 excw -40007cf0: 5f6673 excw -40007cf3: 6d7564 excw -40007cf6: 255b70 extui a5, a7, 27, 3 -40007cf9: 205d64 excw -40007cfc: 3a3061 l32r a6, 3ffd65bc <_start-0x29a44> -40007cff: 783020 excw -40007d02: 383025 call8 40040004 <__bss_start+0x30004> -40007d05: 2078 l32i.n a7, a0, 8 -40007d07: 316120 srai a6, a2, 17 -40007d0a: 203a add.n a2, a0, a3 -40007d0c: 257830 extui a7, a3, 24, 3 -40007d0f: 783830 excw -40007d12: 612020 xsr.m0 a2 -40007d15: 203a32 excw -40007d18: 257830 extui a7, a3, 24, 3 -40007d1b: 783830 excw -40007d1e: 612020 xsr.m0 a2 -40007d21: 203a33 excw -40007d24: 257830 extui a7, a3, 24, 3 -40007d27: 783830 excw -40007d2a: 000a20 excw -40007d2d: 000000 ill -40007d30: 637065 call8 4006b438 <__bss_start+0x5b438> -40007d33: 303d31 l32r a3, 3ffd3e28 <_start-0x2c1d8> -40007d36: 2578 l32i.n a7, a5, 8 -40007d38: 783830 excw -40007d3b: 202c movi.n a0, 34 -40007d3d: 637065 call8 4006b444 <__bss_start+0x5b444> -40007d40: 303d32 excw -40007d43: 2578 l32i.n a7, a5, 8 -40007d45: 783830 excw -40007d48: 202c movi.n a0, 34 -40007d4a: 637065 call8 4006b450 <__bss_start+0x5b450> -40007d4d: 303d33 excw -40007d50: 2578 l32i.n a7, a5, 8 -40007d52: 783830 excw -40007d55: 202c movi.n a0, 34 -40007d57: 637865 call8 4006b4dc <__bss_start+0x5b4dc> -40007d5a: 646176 excw -40007d5d: 3d7264 excw -40007d60: 257830 extui a7, a3, 24, 3 -40007d63: 783830 excw -40007d66: 202c movi.n a0, 34 -40007d68: 706564 excw -40007d6b: 303d63 excw -40007d6e: 2578 l32i.n a7, a5, 8 -40007d70: 783830 excw -40007d73: 000a add.n a0, a0, a0 -40007d75: 000000 ill -40007d78: 746146 j 40024f01 <__bss_start+0x14f01> -40007d7b: 206c61 l32r a6, 3ffcff2c <_start-0x300d4> -40007d7e: 637865 call8 4006b504 <__bss_start+0x5b504> -40007d81: 747065 call8 4007c488 <__bss_start+0x6c488> -40007d84: 6f69 s32i.n a6, a15, 24 -40007d86: 6e .byte 0x6e -40007d87: 252820 extui a2, a2, 24, 3 -40007d8a: 3a2964 excw -40007d8d: 000a20 excw -40007d90: 727065 call8 4007a498 <__bss_start+0x6a498> -40007d93: 6e69 s32i.n a6, a14, 24 -40007d95: 206674 excw -40007d98: 6e .byte 0x6e -40007d99: 6f .byte 0x6f -40007d9a: 756220 extui a6, a2, 18, 8 -40007d9d: 000a66 bnei a10, -1, 40007da1 <__umoddi3+0xf3d> -40007da0: 323130 orbc b3, b1, b3 -40007da3: 353433 excw -40007da6: 383736 entry a7, 0x1c18 -40007da9: 0039 s32i.n a3, a0, 0 -40007dab: 313000 srai a3, a0, 16 -40007dae: 343332 excw -40007db1: 373635 call12 4003f114 <__bss_start+0x2f114> -40007db4: 3938 l32i.n a3, a9, 12 -40007db6: 636261 l32r a6, 3ffe0b40 <_start-0x1f4c0> -40007db9: 666564 excw -40007dbc: 000000 ill -40007dbf: 313000 srai a3, a0, 16 -40007dc2: 343332 excw -40007dc5: 373635 call12 4003f128 <__bss_start+0x2f128> -40007dc8: 3938 l32i.n a3, a9, 12 -40007dca: 434241 l32r a4, 3ffd8ad4 <_start-0x2752c> -40007dcd: 464544 excw -40007dd0: 000000 ill -40007dd3: 6e3c00 excw -40007dd6: 6c6c75 call12 4007449c <__bss_start+0x6449c> -40007dd9: 3e .byte 0x3e -40007dda: 650000 extui a0, a0, 16, 7 -40007ddd: 5f7374 excw -40007de0: 6d6974 excw -40007de3: 2e7265 call8 40036508 <__bss_start+0x26508> -40007de6: 6e0063 excw -40007de9: 6f .byte 0x6f -40007dea: 647220 extui a7, a2, 2, 7 -40007ded: 000a73 excw -40007df0: 716573 excw -40007df3: 752520 extui a2, a2, 21, 8 -40007df6: 202c movi.n a0, 34 -40007df8: 207525 call8 4002854c <__bss_start+0x1854c> -40007dfb: 207364 excw -40007dfe: 0a7025 call8 40012500 <__bss_start+0x2500> -40007e01: 000000 ill -40007e04: 000c movi.n a0, 0 -40007e06: 000000 ill -40007e09: 000000 ill -40007e0c: 010001 l32r a0, 3ffc820c <_start-0x37df4> -40007e0f: 007c movi.n a0, -16 -40007e11: 010c movi.n a1, 0 -40007e13: 001000 movsp a0, a0 -40007e16: 140000 extui a0, a0, 0, 2 -40007e19: 000000 ill -40007e1c: 006c30 rsil a3, 12 -40007e1f: 023240 andb b3, b2, b4 -40007e22: 0e0000 read_impwire a0 -40007e25: 000040 excw -40007e28: 000010 excw -40007e2b: 002800 excw -40007e2e: 640000 extui a0, a0, 0, 7 -40007e31: 6e .byte 0x6e -40007e32: 704000 excw -40007e35: 000002 l8ui a0, a0, 0 -40007e38: 0e .byte 0xe -40007e39: 000050 excw -40007e3c: cd48 l32i.n a4, a13, 48 -40007e3e: ff .byte 0xff -40007e3f: 3f .byte 0x3f -40007e40: ffe1d0 excw -40007e43: 3f .byte 0x3f -40007e44: c008 l32i.n a0, a0, 48 -40007e46: ff .byte 0xff -40007e47: 3f .byte 0x3f - ... diff --git a/src/common/platforms/esp31/rom/disasm.sh b/src/common/platforms/esp31/rom/disasm.sh deleted file mode 100755 index 5ab8fe5433a9f1c349c7977fc0719c4dd8026ac5..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp31/rom/disasm.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -xtensa-esp108-elf-gcc -Wl,-N,-Ttext,0x40000000 -nostdlib rom.S -o rom.elf && \ - xtensa-esp108-elf-objdump -d rom.elf > ESP31B_ROM.txt diff --git a/src/common/platforms/esp31/rom/notes.c b/src/common/platforms/esp31/rom/notes.c deleted file mode 100644 index 431d718fbacdefd34ee68e4776906acf2a503a58..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp31/rom/notes.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Just some notes scribbled while disassembling */ - -/* - * RTC = 0x60008000 - * RTC+0x18: ??c????? ???????? ???????? ???????? - * RTC+0x34: ???????? ??bbbbbb bbbb???? ??aaaaaa - */ -int _X_get_rst_cause(void) { - int ret; - int a = GET_PERI_REG_BITS(RTC_STATE1, 6, 0); - if (a == 5) { - int b = (RTC_STATE1 >> 12) && 0xfff; - if (b != 1) { - ret = (b == 8 ? a : 0); - } else { - ret = 20; - } - } else { - ret = a; - } - CLEAR_PERI_REG_MASK(RTC_STATE0, RTC_CNTL_SLP_WAKEUP); - return ret; -} - -/* - * RTC = 0x60008000 - * RTC+0x38: ???????? ???????? ???????? ??cccccc - * RTC+0x74: ???????? ???????? ???????? dddddddd - * RTC+0x80: ???????? ??????a? ???b???? ???????? - */ -void main(void) { - uint32_t rst_cause = _X_get_rst_cause(); - CLEAR_PERI_REG_MASK(RTC+0x80, BIT(17)); // a - SET_PERI_REG_MASK(RTC+0x80, BIT(12)); // b - uint32_t boot_mode = GET_PERI_REG_BITS(GPIO_STRAP, 6, 0); // c - if (boot_mode & (BIT(5) | BIT(4)) == (BIT(5) | BIT(4)) || boot_mode == 24 || boot_mode == 26) { - CLEAR_PERI_REG_MASK(RTC+0x74, 0xff); - } - if (boot_mode & (BIT(5) | BIT(4)) == BIT(5)) { - CLEAR_PERI_REG_MASK(RTC+0x94, BIT(31)); - CLEAR_PERI_REG_MASK(RTC+0x98, BIT(31)); - CLEAR_PERI_REG_MASK(RTC+0x9c, BIT(31)); - CLEAR_PERI_REG_MASK(RTC+0xa0, BIT(31)); - CLEAR_PERI_REG_MASK(RTC+0xa4, BIT(31)); - CLEAR_PERI_REG_MASK(RTC+0xa8, BIT(31)); - CLEAR_PERI_REG_MASK(RTC+0xac, BIT(31)); - } - if (boot_mode & (BIT(5) | BIT(3)) == 0) { - // ... 1405 - } - CLEAR_PERI_REG_MASK(RTC+0x74, 0xff); - _X_uart_attach(); - _X_uart_init(0); - // GPIO_STRAP ... - ets_printf(boot_banner, fw_build, rst_cause, boot_mode); - // rst_cause - if (rst_cause == 1 || rst_cause == 2) { - - } else { - // ... - } - ets_printf("%s %u", "ets_main.c", 305); - while(1) {} -} - -/* - * GPIO strap mapping: - * - * 0011 1111 1011 0011 - * || |||| |||| |||| - * || |||| |||| |||`- IO5 - * || |||| |||| ||`-- IO15 - * || |||| |||| |`--- IO4 - * || |||| |||| `---- IO2 - * || |||| |||`------ ? - * || |||| ||`------- IO0 - * || |||| |`-------- IO12 - * || |||| `--------- ? - * || |||`----------- CLK - * || ||`------------ ? - * || |`------------- SD0 - * || `-------------- SD1 - * |`---------------- ? SD2 - * `----------------- SD3 - */ - -struct uartdev { - uint32_t baud_rate; // 0 - uint32_t ud4; - uint32_t ud8; - uint32_t ud12; - uint32_t ud16; - uint32_t ud20; - uint8_t ud24; - uint8_t ud25; - uint32_t ud28; - uint32_t ud32; - uint32_t ud36; - uint8_t ud40; - uint32_t ud48; - uint32_t ud52; -}; - -void _X_uart_attach(void) { - // zero uartdev - uartdev.baud_rate = 115200; - _X_xtos_ints_off(1 << ETS_UART_INUM); - // INTR_MAP_REG_C - // 11111111 11111111 11111100 00011111 & - // 00000000 00000000 00000000 10100000 | - // PRODPORT_INTR_MAP_13 -> 5 = ETS_UART_INUM - // 11111111 11111111 10000011 11111111 & - // 00000000 00000000 00010100 11111111 | - // PRODPORT_INTR_MAP_14 -> 5 = ETS_UART_INUM - _xtos_set_interrupt_handler_arg(ETS_UART_INUM, uart_int_handler, _c_0x3fffdb2c_uart_int_handler_arg); -} - -void _X_uart_init(uint32_t a) { - // GPIO_FUNC_IN_SEL3 - // xx999999 88888877 77776666 66555555 - // 11111111 11111100 00001111 11111111 = 0xfffc0fff - // 00000000 00000000 10010000 00000000 = 0x00009000 - // GPIO17 func => 9 - // 00000000 00000010 00000000 00000000 - uart_div_modify(13000000 / uartdev.baud_rate); - // ... -} - -struct _st_0x3fffdc90 { -}; - -struct _st_0x3fffdf70 { - void *fp1; // 20 - void *fp2; // 24 - uint32_t d28; - uint32_t d32; - uint32_t d36; - struct _st_0x3fffdc90 *st; // 44 -} stdf70; - -void _X_slc_init_attach(void *fp1, void *fp2, struct _st_0x3fffdc90 *st, uint32_t gpio_mode) { - stdf70.fp1 = fp1; - stdf70.fp2 = fp2; - stdf70.st = st; - d28 = d32 = d36 = 0; - SET_PERI_REG_MASK(WIFI_RST_EN, PRODPORT_SDIO_RST); - CLEAR_PERI_REG_MASK(WIFI_RST_EN, PRODPORT_SDIO_RST); - if (gpio_mode == 4) { - SET_PERI_REG((READ_PERI_REG(PERIPHS_HINF_BASEADDR+4) & 0xf0000000) | 0x01110013); - } else { - SET_PERI_REG((READ_PERI_REG(PERIPHS_HINF_BASEADDR+4) & 0xf0000000) | 0x02320017); - } - SET_PERI_REG(PERIPHS_HINF_BASEADDR, 0x11116666); - _X_slc_set_host_io_max_window(); - ... -} - -#define SLC_TOKEN1 (PERIPHS_SLC_BASEADDR + 0x54) -#define SLC_BRIDGE_CONF (PERIPHS_SLC_BASEADDR + 0x74) - -void _X_slc_set_host_io_max_window(void) { - SET_PERI_REG(SLC_BRIDGE_CONF, (READ_PERI_REG(SLC_BRIDGE_CONF) & 0xfffff0c0) | 0x720); -} diff --git a/src/common/platforms/esp31/rom/rom.S b/src/common/platforms/esp31/rom/rom.S deleted file mode 100644 index 55737a5389d8f0c870036ea5ebc0096a1f5f2063..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp31/rom/rom.S +++ /dev/null @@ -1,16 +0,0 @@ -.text -.org 0 -.globl _start - -// xtensa-esp108-elf-gcc -Wl,-N,-Ttext,0x40000000 -nostdlib rom.S -o rom.elf - -here = . -#define PROVIDE(name, addr) name = here + addr - 0x40000000 - -#include "rom_functions.S" - -.text - -_start: -.incbin "rom.bin" -_end: diff --git a/src/common/platforms/esp31/rom/rom.bin b/src/common/platforms/esp31/rom/rom.bin deleted file mode 100644 index 355329da2776060e91395da6959f82b384520a00..0000000000000000000000000000000000000000 Binary files a/src/common/platforms/esp31/rom/rom.bin and /dev/null differ diff --git a/src/common/platforms/esp31/rom/rom_functions.S b/src/common/platforms/esp31/rom/rom_functions.S deleted file mode 100644 index 5711a5cc1af52690ec0fb410ee42defeeb271819..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp31/rom/rom_functions.S +++ /dev/null @@ -1,294 +0,0 @@ -// These come from linker script - -PROVIDE ( Cache_Read_Disable , 0x4000444c ); -PROVIDE ( Cache_Read_Enable , 0x4000438c ); - -PROVIDE ( ets_delay_us , 0x40002db4 ); - -PROVIDE ( bzero , 0x40002a54 ); - -PROVIDE ( memcmp , 0x400068ec ); -PROVIDE ( memcpy , 0x40006974 ); -PROVIDE ( memmove , 0x40006a6c ); -PROVIDE ( memset , 0x40006be4 ); - -PROVIDE ( strcmp , 0x40005bb8 ); -PROVIDE ( strcpy , 0x40005cdc ); -PROVIDE ( strlen , 0x40005d6c ); -PROVIDE ( strncmp , 0x40005dd0 ); -PROVIDE ( strncpy , 0x40005e90 ); -PROVIDE ( strstr , 0x40005f6c ); - -PROVIDE ( ets_install_putc1 , 0x40002774 ); -PROVIDE ( ets_printf , 0x40002804 ); -PROVIDE ( ets_putc , 0x40002b14 ); - -PROVIDE ( ets_str2macaddr , 0x40002a64 ); - -PROVIDE ( gpio_output_set , 0x400049d8 ); -PROVIDE ( gpio_output_set_high , 0x400049f8 ); - -PROVIDE ( ets_get_cpu_frequency , 0x40002de8 ); -PROVIDE ( ets_update_cpu_frequency , 0x40002ddc ); - -PROVIDE ( lldesc_build_chain , 0x40004c8c ); - -PROVIDE ( multofup , 0x400068a0 ); -PROVIDE ( roundup2 , 0x40006890 ); - -PROVIDE (software_reset_cpu , 0x40002998 ); - -PROVIDE ( SPIEraseSector , 0x40004708 ); -PROVIDE ( SPIRead , 0x40004898 ); -PROVIDE ( SPIWrite , 0x40004738 ); - -PROVIDE ( uart_div_modify , 0x400034e8 ); -PROVIDE ( uart_tx_one_char , 0x4000362c ); - -PROVIDE ( __divsi3 , 0x40006888 ); -PROVIDE ( __udivdi3 , 0x40006c30 ); -PROVIDE ( __umoddi3 , 0x40006e64 ); - -PROVIDE ( _xtos_set_intlevel , 0x40006670 ); - -// These have been reverse-engineered. - -PROVIDE(_XX_Vec40, 0x40000040) -PROVIDE(_XX_ExcVec50, 0x40000050) -PROVIDE(_XX_ExcVec80, 0x40000080) - -PROVIDE(_XX_Vec400, 0x40000300) - -PROVIDE(_WindowOverflowHandler, 0x40000100) -PROVIDE(_WindowUnderflowHandler, 0x40000140) - -PROVIDE(_X_ResetVector, 0x40000500) - -PROVIDE(_c_stack, 0x40000700) -PROVIDE(_c_bss_start, 0x40000708) -PROVIDE(_c_bss_end, 0x4000070c) -PROVIDE(_c_0x3fffc210, 0x40000734) -PROVIDE(_c_0x80000000, 0x40000738) -PROVIDE(_c_0x40000000, 0x40000760) -PROVIDE(_c_0x7fffffff, 0x40000780) -PROVIDE(_c_0x00ff0000, 0x40000798) - -PROVIDE(_X_start, 0x400007ac) - -PROVIDE(_c_0x3fffd820, 0x40000f50) -PROVIDE(_X_ets_task, 0x40000f54) -PROVIDE(_XX_unk0f84, 0x40000f84) -PROVIDE(_XX_unk0f96, 0x40000f98) - -PROVIDE(_c_ets_critical_level, 0x400010a4) -PROVIDE(_X_ets_enter_critical, 0x400010a8) -PROVIDE(_X_ets_exit_critical, 0x400010bc) -PROVIDE(_X_ets_exit_critical_and_wait_int, 0x400010d4) -PROVIDE(_X_ets_isr_attach, 0x400010e8) // 3 args -PROVIDE(_X_ets_isr_mask, 0x400010f8) // 1 arg -PROVIDE(_X_ets_isr_unmask, 0x40001104) // 1 arg - -PROVIDE(_c_0x3fffda30, 0x40001110) -PROVIDE(_XX_set_0x3fffda30_0, 0x40001114) -PROVIDE(_XX_set_0x3fffda30_4, 0x40001120) -PROVIDE(_c_0xfffdffff, 0x4000112c) -PROVIDE(_c_0x60003e00, 0x40001130) -PROVIDE(_c_0x60008200, 0x40001134) -PROVIDE(_c_0x60007e00, 0x40001138) -PROVIDE(_c_0x1000, 0x4000113c) -PROVIDE(_s_fw_build, 0x40001140) -PROVIDE(_s_boot_banner, 0x40001144) -PROVIDE(_s_pct_s_pct_u, 0x40001148) -PROVIDE(_s_ets_main_c, 0x4000114c) -PROVIDE(_X_main, 0x4000115c) - -PROVIDE(_l_strap_0x0xxx, 0x4000125a) -PROVIDE(_l_strap_init_uart0, 0x40001269) -PROVIDE(_l_strap_0x0x00, 0x400012e2) -PROVIDE(_l_boot, 0x400012ea) -PROVIDE(_l_rst_cause_345, 0x40001336) -PROVIDE(_l_rst_cause_12, 0x40001342) -PROVIDE(_l_strap_NxNxxx, 0x40001405) -PROVIDE(_l_strap_0010xx, 0x4000144c) -PROVIDE(_l_strap_001000_0x110x, 0x400014b0) -PROVIDE(_l_strap_0x0x11_loader, 0x400014c9) // loader -PROVIDE(_l_strap_0x0x01, 0x400014d4) -PROVIDE(_l_strap_0x0x10, 0x400014e6) -PROVIDE(_c_0xffff8fff, 0x400014f0) -PROVIDE(_c_0x60008e00, 0x400014f4) - -PROVIDE(_s_waiting_for_host, 0x4000152c) -PROVIDE(_s_mem_banner, 0x40001cdc) -PROVIDE(_c_stack_sentry, 0x40001ce0) -PROVIDE(_XX_unk153c, 0x4000153c) - -PROVIDE(_c_data_end, 0x40001cd8) -PROVIDE(_c_data_start, 0x40001ce4) -PROVIDE(_X_print_mem_banner, 0x40001ce8) - -PROVIDE(_s_exc_sp_fmt, 0x40001d0c) -PROVIDE(_s_exc_sf_dump_fmt, 0x40001d10) -PROVIDE(_s_exc_regs_fmt, 0x40001d14) -PROVIDE(_X_exc_handler, 0x40001d18) - -PROVIDE(_XX_unk1d90, 0x40001d90) - -PROVIDE(_X_ets_memset, 0x40001db4) -PROVIDE(_X_ets_memcpy, 0x40001dc4) -PROVIDE(_X_ets_memmove, 0x40001dd4) -PROVIDE(_X_ets_memcmp, 0x40001de4) - -PROVIDE(_st_0x3fffda9c, 0x40002150) // struct - -PROVIDE(_X_ets_uart_putc, 0x4000223c) -PROVIDE(_X_ets_unk225c, 0x4000225c) - -PROVIDE(_c_0x4000223c_ets_uart_putc, 0x40002780) -PROVIDE(_X_ets_install_uart_printf, 0x40002784) -PROVIDE(_c_0x400027dc, 0x40002790) -PROVIDE(_X_ets_install_external_printf, 0x40002794) -PROVIDE(_X_ets_install_putc2, 0x400027b4) -PROVIDE(_X_ets_get_printf_buf_remain_len, 0x400027c0) -PROVIDE(_X_ets_reset_printf_buf_len, 0x400027cc) -PROVIDE(_X_ets_putc, 0x400027dc) - -PROVIDE(_c_0xdfffffff, 0x400028d4) -PROVIDE(_X_get_rst_cause, 0x400028d8) -PROVIDE(_XX_unk2948, 0x40002948) -PROVIDE(_l_2970, 0x40002970) -PROVIDE(_X_sw_sys_rst, 0x4000297c) -PROVIDE(_c_0x00400000, 0x400029b4) -PROVIDE(_c_0xffbfffff, 0x400029b8) -PROVIDE(_XX_apb_bridge_toggle, 0x400029bc) // turns RTC_CNTL_APB2RTC_BRIDGE_SEL on and off -PROVIDE(_X_ets_strcpy, 0x400029ec) -PROVIDE(_X_ets_strncpy, 0x40002a00) -PROVIDE(_X_ets_strcmp, 0x40002a10) -PROVIDE(_X_ets_strncmp, 0x40002a24) -PROVIDE(_X_ets_strlen, 0x40002a34) -PROVIDE(_X_ets_strstr, 0x40002a40) - -PROVIDE(_st_0x3fffdb10_uartdev, 0x40002e4c) // some struct - uartdev? - -PROVIDE(_c_0x3fffdb00, 0x40002e50) -PROVIDE(_c_0x3fffdb04, 0x40002f64) -PROVIDE(_XX_unk2e58, 0x40002e58) -PROVIDE(_X_UartDwnLdProc, 0x40002f6c) -PROVIDE(_c_0x00001800, 0x400030ec) -PROVIDE(_X_FlashDwnLdStartMsgProc, 0x400030f0) -PROVIDE(_XX_unk313c, 0x4000313c) -PROVIDE(_XX_unk31bc, 0x400031bc) -PROVIDE(_XX_unk31e4, 0x400031e4) -PROVIDE(_XX_unk3210, 0x40003210) -PROVIDE(_XX_unk3240, 0x40003240) -PROVIDE(_X_MemDwnLdStopReqMsgProc, 0x4000329c) -PROVIDE(_X_UartConnectProc, 0x400032c4) -PROVIDE(_X_UartRegWriteProc, 0x400032d4) -PROVIDE(_X_UartRegReadProc, 0x40003318) - -PROVIDE(_c_115200, 0x4000332c) -PROVIDE(_c_0x3feffe00, 0x40003330) -PROVIDE(_c_0xffff83ff, 0x40003334) -PROVIDE(_c_0x00001400, 0x40003338) -PROVIDE(_c_0x40003728_uart_int_handler, 0x4000333c) -PROVIDE(_c_0x3fffdb2c_uart_int_handler_arg, 0x40003340) -PROVIDE(_X_uart_attach, 0x40003344) -PROVIDE(_XX_uart_set_unk33c0, 0x400033c0) -PROVIDE(_c_0x5ffffe00, 0x400033cc) -PROVIDE(_c_0x0000ffff, 0x400033d0) -PROVIDE(_c_0x000fffff, 0x40003448) -PROVIDE(_c_0x00060000, 0x400034e0) -PROVIDE(_c_0xfff9ffff, 0x400034e4) - -PROVIDE(_c_0xfffc0fff, 0x40003520) -PROVIDE(_c_0x00009000, 0x40003524) -PROVIDE(_c_0x00020000, 0x40003528) -PROVIDE(_c_13000000, 0x4000352c) -PROVIDE(_c_0x08000000, 0x40003530) -PROVIDE(_X_uart_init, 0x40003534) -PROVIDE(_l_35f4, 0x400035f4) -PROVIDE(_X_uart_wait_tx_empty, 0x4000369c) - -PROVIDE(_X_uart_int_handler, 0x40003728) - -PROVIDE(_X_uart_tx_one_char2, 0x40003664) - -PROVIDE(_X_send_packet, 0x400037d4) -PROVIDE(_X_SendMsg, 0x40003828) -PROVIDE(_X_recv_packet, 0x4000383c) -PROVIDE(_X_RcvMsg, 0x40003988) -PROVIDE(_X_uart_rx_readbuff, 0x400039a0) - -PROVIDE(_c_0x60004e00, 0x40003a18) -PROVIDE(_X_SelectSpiFunction, 0x40003a1c) // 1 arg - SPI number -PROVIDE(_c_0x60002e00, 0x40003c78) -PROVIDE(_X_SPI_chip_erase, 0x40003c7c) -PROVIDE(_c_0x00ffffff, 0x40003cb4) -PROVIDE(_c_0x01000000, 0x40003cb8) -PROVIDE(_XX_unk3cbc, 0x40003cbc) -PROVIDE(_c_0x00800000, 0x40003d00) -PROVIDE(_c_0x02000000, 0x40003d4c) -PROVIDE(_XX_unk3e24, 0x40003e24) -PROVIDE(_X_SPI_read_status, 0x40003efc) -PROVIDE(_c_0x90000000, 0x40003f48) -PROVIDE(_c_0x70000035, 0x40003f4c) -PROVIDE(_c_0x00040000, 0x40003f50) -PROVIDE(_XX_unk3f54, 0x40003f54) -PROVIDE(_c_0x04000000, 0x40003fcc) -PROVIDE(_XX_unk4010, 0x40004010) -PROVIDE(_X_SPI_write_enable, 0x400041bc) -PROVIDE(_X_Wait_SPI_Idle, 0x40004208) -PROVIDE(_l_4228, 0x40004228) -PROVIDE(_l_4234, 0x40004234) -PROVIDE(_XX_unk4238, 0x40004238) -PROVIDE(_X_SPIFlashModeConfig, 0x400042d8) -PROVIDE(_X_spi_flash_attach, 0x40004370) // 2 args: SPI num, ??? -PROVIDE(_X_SPIReadModeConfig, 0x40004538) - -PROVIDE(_X_SPIEraseArea, 0x400048b4) -PROVIDE(_XX_unk4940, 0x40004940) - -PROVIDE(_st_0x3fffdc90, 0x40004d80) -PROVIDE(_XX_unk4d88, 0x40004d88) -PROVIDE(_XX_unk4f6c, 0x40004f6c) -PROVIDE(_XX_unk4fc8, 0x40004fc8) - -PROVIDE(_c_0xbfffffff, 0x40004c80) -PROVIDE(_c_0xff000fff, 0x40004c88) -PROVIDE(_XX_unk4f14, 0x40004f14) -PROVIDE(_s_no_rds, 0x40005008) -PROVIDE(_XX_unk500c, 0x4000500c) - -PROVIDE(_fp_0x40004f6c, 0x40005164) -PROVIDE(_fp_0x40004fc8, 0x40005168) -PROVIDE(_X_sip_init_attach, 0x40005170) // 1 arg, boot_mode? -PROVIDE(_XX_unk51ac, 0x400051ac) -PROVIDE(_c_0x60017e00, 0x40005478) -PROVIDE(_st_0x3fffdf70, 0x400054a4) -PROVIDE(_c_0x6000ae00, 0x400054b8) -PROVIDE(_c_0xf0000000, 0x400054bc) -PROVIDE(_c_0x02320017, 0x400054c0) -PROVIDE(_c_0x11116666, 0x400054c4) -PROVIDE(_c_0x01110013, 0x400054e4) -PROVIDE(_X_slc_init_attach, 0x400054e8) // 4 args - fp, fp, st, boot_mode; PRODPORT_SDIO_RST -PROVIDE(_l_slc_boot_mode_4, 0x40005654) -PROVIDE(_X_slc_enable, 0x40005678) -PROVIDE(_X_slc_select_tohost_gpio_mode, 0x400056fc) -PROVIDE(_X_slc_select_tohost_gpio, 0x40005708) -PROVIDE(_c_0xff300000, 0x40005730) -PROVIDE(_XX_unk5734, 0x40005734) -PROVIDE(_XX_unk57b8, 0x400057b8) -PROVIDE(_XX_unk57f4, 0x400057f4) -PROVIDE(_XX_unk5848, 0x40005848) - -PROVIDE(_c_0xfffff0c0, 0x40005988) -PROVIDE(_X_slc_set_host_io_max_window, 0x4000598c) -PROVIDE(_X_slc_init_credit, 0x400059ac) -PROVIDE(_X_slc_add_credits, 0x400059c4) - -PROVIDE(_X_xtos_set_interrupt_handler_arg, 0x400059d8) -PROVIDE(_X_xtos_set_interrupt_handler, 0x40005a24) -PROVIDE(_X_xtos_ints_on, 0x40005a34) -PROVIDE(_X_xtos_ints_off, 0x40005a58) - -PROVIDE(_XX_xtos_exc_unk5a80, 0x40005a80) -PROVIDE(_XX_xtos_exc_unk5b94, 0x40005b94) diff --git a/src/common/platforms/esp32/rom/.gitattributes b/src/common/platforms/esp32/rom/.gitattributes deleted file mode 100644 index b2dd2258c3c4edbbb3bff339a3b861ada74c08e3..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/rom/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -rom.bin -nodiff -rom.elf -nodiff diff --git a/src/common/platforms/esp32/rom/disasm.sh b/src/common/platforms/esp32/rom/disasm.sh deleted file mode 100755 index ae719ac10fe03be4ac799e5ccbccc4ea7c8050ce..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/rom/disasm.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -xtensa-esp32-elf-gcc -Wl,-N,-Ttext,0x40000000 -nostdlib rom.S -o rom.elf && \ - xtensa-esp32-elf-objdump -d rom.elf > ESP32_ROM.txt diff --git a/src/common/platforms/esp32/rom/rom.S b/src/common/platforms/esp32/rom/rom.S deleted file mode 100644 index 11bd296504304d030f4d7a55398e2771644e4ea5..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/rom/rom.S +++ /dev/null @@ -1,28 +0,0 @@ -.text -.org 0 -.globl _start - -// xtensa-esp32-elf-gcc -Wl,-N,-Ttext,0x40000000 -nostdlib rom.S -o rom.elf - -here = . -#define PROVIDE(name, addr) name = here + addr - 0x40000000 - -#include "rom_functions.S" - -PROVIDE ( _x_unk_40061b88, 0x40061b88 ) -PROVIDE ( _x_unk_spi_400622c0, 0x400622c0 ) -PROVIDE ( _c_3ff000c8, 0x40062df0 ) -PROVIDE ( _c_3ff5b024, 0x40062e0c ) -PROVIDE ( _c_3ff5b000, 0x40062e10 ) -PROVIDE ( _c_3ff5b020, 0x40062e14 ) -PROVIDE ( _c_3ff5b028, 0x40062e18 ) -PROVIDE ( _l_40062e90, 0x40062e90 ) -PROVIDE ( _l_SPI_Prepare_Encrypt_Data_loop, 0x40062e34 ) -PROVIDE ( _l_SPI_Prepare_Encrypt_Data_wait, 0x40062e54 ) -PROVIDE ( _l_SPI_Prepare_Encrypt_Data_out, 0x40062e5e ) - -.text - -_start: -.incbin "rom.bin" -_end: diff --git a/src/common/platforms/esp32/rom/rom.bin b/src/common/platforms/esp32/rom/rom.bin deleted file mode 100644 index 8f0bb3fa676368b2cc2fb38b8d7fd7012220dab4..0000000000000000000000000000000000000000 Binary files a/src/common/platforms/esp32/rom/rom.bin and /dev/null differ diff --git a/src/common/platforms/esp32/rom/rom.elf b/src/common/platforms/esp32/rom/rom.elf deleted file mode 100755 index f65fbf09996b1f49996ff815c7e28fdabe12fd06..0000000000000000000000000000000000000000 Binary files a/src/common/platforms/esp32/rom/rom.elf and /dev/null differ diff --git a/src/common/platforms/esp32/rom/rom_functions.S b/src/common/platforms/esp32/rom/rom_functions.S deleted file mode 100644 index ec3b76fce32872cc06209e373dc6ecf92502b86b..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/rom/rom_functions.S +++ /dev/null @@ -1,1852 +0,0 @@ -// From esp-idf/components/esp32/ld/esp32.rom.ld: -// sort -k 5 esp32.rom.ld | perl -npe 's/=/,/; s/;//' - -PROVIDE ( __month_lengths , 0x3ff9609c ) -PROVIDE ( __ctype_ptr__ , 0x3ff96350 ) -PROVIDE ( _ctype_ , 0x3ff96354 ) -PROVIDE ( __sf_fake_stderr , 0x3ff96458 ) -PROVIDE ( __sf_fake_stdout , 0x3ff96478 ) -PROVIDE ( __sf_fake_stdin , 0x3ff96498 ) -PROVIDE ( __mb_cur_max , 0x3ff96530 ) -PROVIDE ( __wctomb , 0x3ff96540 ) -PROVIDE ( __nsau_data , 0x3ff96544 ) -PROVIDE ( __popcount_tab , 0x3ff96544 ) -PROVIDE ( lmp_ext_desc_tab , 0x3ff96d9c ) -PROVIDE ( lmp_desc_tab , 0x3ff96e6c ) -PROVIDE ( co_sca2ppm , 0x3ff971e8 ) -PROVIDE ( one_bits , 0x3ff971f8 ) -PROVIDE ( dbg_default_handler , 0x3ff97218 ) -PROVIDE ( ecc_Jacobian_InfinityPoint256 , 0x3ff972e8 ) -PROVIDE ( veryBigHexP256 , 0x3ff9736c ) -PROVIDE ( bigHexP256 , 0x3ff973bc ) -PROVIDE ( DebugE256SecretKey , 0x3ff973e8 ) -PROVIDE ( DebugE256PublicKey_y , 0x3ff97408 ) -PROVIDE ( DebugE256PublicKey_x , 0x3ff97428 ) -PROVIDE ( maxSecretKey_256 , 0x3ff97448 ) -PROVIDE ( BasePoint_y_256 , 0x3ff97468 ) -PROVIDE ( BasePoint_x_256 , 0x3ff97488 ) -PROVIDE ( hci_evt_le_desc_tab , 0x3ff974b4 ) -PROVIDE ( hci_evt_dbg_desc_tab , 0x3ff9750c ) -PROVIDE ( hci_evt_desc_tab , 0x3ff9751c ) -PROVIDE ( hci_cmd_desc_root_tab , 0x3ff976d4 ) -PROVIDE ( hci_cmd_desc_tab_vs , 0x3ff97714 ) -PROVIDE ( hci_cmd_desc_tab_le , 0x3ff97870 ) -PROVIDE ( hci_cmd_desc_tab_testing , 0x3ff97a98 ) -PROVIDE ( hci_cmd_desc_tab_stat_par , 0x3ff97ac8 ) -PROVIDE ( hci_cmd_desc_tab_info_par , 0x3ff97b1c ) -PROVIDE ( hci_cmd_desc_tab_ctrl_bb , 0x3ff97b70 ) -PROVIDE ( hci_cmd_desc_tab_lk_pol , 0x3ff97f3c ) -PROVIDE ( hci_cmd_desc_tab_lk_ctrl , 0x3ff97fc0 ) -PROVIDE ( lb_default_handler , 0x3ff982b8 ) -PROVIDE ( lc_default_handler , 0x3ff98648 ) -PROVIDE ( ld_pcm_settings_dft , 0x3ff98a0c ) -PROVIDE ( ld_acl_edr_sizes , 0x3ff98a14 ) -PROVIDE ( ld_acl_edr_types , 0x3ff98a22 ) -PROVIDE ( ld_acl_br_sizes , 0x3ff98a2a ) -PROVIDE ( ld_acl_br_types , 0x3ff98a36 ) -PROVIDE ( ld_sync_train_channels , 0x3ff98a3c ) -PROVIDE ( llc_default_handler , 0x3ff98b3c ) -PROVIDE ( lld_pdu_llcp_pk_desc_tab , 0x3ff98b68 ) -PROVIDE ( lld_pdu_adv_pk_desc_tab , 0x3ff98c70 ) -PROVIDE ( llm_local_data_len_values , 0x3ff98d1c ) -PROVIDE ( llm_local_le_states , 0x3ff98d28 ) -PROVIDE ( llm_local_le_feats , 0x3ff98d30 ) -PROVIDE ( llm_local_cmds , 0x3ff98d38 ) -PROVIDE ( llm_default_handler , 0x3ff98d80 ) -PROVIDE ( LLM_AA_CT2 , 0x3ff98d88 ) -PROVIDE ( LLM_AA_CT1 , 0x3ff98d8a ) -PROVIDE ( lm_default_handler , 0x3ff990e0 ) -PROVIDE ( lm_n_page_tab , 0x3ff990e8 ) -PROVIDE ( lm_local_supp_feats , 0x3ff990ee ) -PROVIDE ( rwip_coex_cfg , 0x3ff9914c ) -PROVIDE ( rwip_priority , 0x3ff99159 ) -PROVIDE ( exc_cause_table , 0x3ff991d0 ) -PROVIDE ( spi_modes , 0x3ff99270 ) -PROVIDE ( sha_blk_bits_bytes , 0x3ff99288 ) -PROVIDE ( sha_blk_hash_bytes , 0x3ff9928c ) -PROVIDE ( sha_blk_bits , 0x3ff99290 ) -PROVIDE ( dh_group18_prime , 0x3ff9a0dc ) -PROVIDE ( dh_group18_generator , 0x3ff9a4dc ) -PROVIDE ( dh_group17_prime , 0x3ff9a4dd ) -PROVIDE ( dh_group17_generator , 0x3ff9a7dd ) -PROVIDE ( dh_group16_prime , 0x3ff9a7de ) -PROVIDE ( dh_group16_generator , 0x3ff9a9de ) -PROVIDE ( dh_group15_prime , 0x3ff9a9df ) -PROVIDE ( dh_group15_generator , 0x3ff9ab5f ) -PROVIDE ( dh_group14_prime , 0x3ff9ab60 ) -PROVIDE ( dh_group14_generator , 0x3ff9ac60 ) -PROVIDE ( dh_group5_prime , 0x3ff9ac61 ) -PROVIDE ( dh_group5_generator , 0x3ff9ad21 ) -PROVIDE ( dh_group2_prime , 0x3ff9ad22 ) -PROVIDE ( dh_group2_generator , 0x3ff9ada2 ) -PROVIDE ( dh_group1_prime , 0x3ff9ada3 ) -PROVIDE ( dh_group1_generator , 0x3ff9ae03 ) -PROVIDE ( Xthal_intlevel , 0x3ff9c2b4 ) -PROVIDE ( syscall_table_ptr_app , 0x3ffae020 ) -PROVIDE ( syscall_table_ptr_pro , 0x3ffae024 ) -PROVIDE ( _tzname , 0x3ffae030 ) -PROVIDE ( _timezone , 0x3ffae0a0 ) -PROVIDE ( _daylight , 0x3ffae0a4 ) -PROVIDE ( _global_impure_ptr , 0x3ffae0b0 ) -PROVIDE ( environ , 0x3ffae0b4 ) -PROVIDE ( rom_phyFuns , 0x3ffae0c0 ) -PROVIDE ( g_phyFuns_instance , 0x3ffae0c4 ) -PROVIDE ( g_rom_flashchip , 0x3ffae270 ) -PROVIDE ( SPI_flashchip_data , 0x3ffae270 ) -PROVIDE ( dummy_len_plus , 0x3ffae290 ) -PROVIDE ( sig_matrix , 0x3ffae293 ) -PROVIDE ( r_btdm_option_data , 0x3ffae6e0 ) -PROVIDE ( _data_start_btdm , 0x3ffae6e0) -PROVIDE ( co_default_bdaddr , 0x3ffae704 ) -PROVIDE ( r_ip_funcs_p , 0x3ffae70c ) -PROVIDE ( r_ip_funcs , 0x3ffae710 ) -PROVIDE ( r_import_rf_phy_func_p , 0x3ffafd64 ) -PROVIDE ( r_modules_funcs_p , 0x3ffafd68 ) -PROVIDE ( r_modules_funcs , 0x3ffafd6c ) -PROVIDE ( _data_end_btdm , 0x3ffaff10) -PROVIDE ( _bss_start_btdm , 0x3ffb8000) -PROVIDE ( co_null_bdaddr , 0x3ffb80e0 ) -PROVIDE ( ld_sco_env , 0x3ffb824c ) -PROVIDE ( ld_acl_env , 0x3ffb8258 ) -PROVIDE ( ld_bcst_acl_env , 0x3ffb8274 ) -PROVIDE ( ld_csb_rx_env , 0x3ffb8278 ) -PROVIDE ( ld_csb_tx_env , 0x3ffb827c ) -PROVIDE ( ld_fm_env , 0x3ffb8284 ) -PROVIDE ( ld_inq_env , 0x3ffb82e4 ) -PROVIDE ( ld_iscan_env , 0x3ffb82e8 ) -PROVIDE ( ld_page_env , 0x3ffb82f0 ) -PROVIDE ( ld_pca_env , 0x3ffb82f4 ) -PROVIDE ( ld_pscan_env , 0x3ffb8308 ) -PROVIDE ( ld_sched_env , 0x3ffb830c ) -PROVIDE ( ld_sscan_env , 0x3ffb832c ) -PROVIDE ( ld_strain_env , 0x3ffb8330 ) -PROVIDE ( ld_active_ch_map , 0x3ffb8334 ) -PROVIDE ( r_import_rf_phy_func , 0x3ffb8354 ) -PROVIDE ( r_plf_funcs_p , 0x3ffb8360 ) -PROVIDE ( RFPLL_ICP_TABLE , 0x3ffb8b7c ) -PROVIDE ( bt_util_buf_env , 0x3ffb8bd4 ) -PROVIDE ( sw_to_hw , 0x3ffb8d40 ) -PROVIDE ( dbg_state , 0x3ffb8d5d ) -PROVIDE ( ecc_env , 0x3ffb8d60 ) -PROVIDE ( em_buf_env , 0x3ffb8d74 ) -PROVIDE ( hci_fc_env , 0x3ffb9340 ) -PROVIDE ( hci_env , 0x3ffb9350 ) -PROVIDE ( ke_env , 0x3ffb93cc ) -PROVIDE ( lb_env , 0x3ffb9424 ) -PROVIDE ( lb_state , 0x3ffb94e8 ) -PROVIDE ( lc_env , 0x3ffb94ec ) -PROVIDE ( lc_state , 0x3ffb9508 ) -PROVIDE ( ld_env , 0x3ffb9510 ) -PROVIDE ( ld_env , 0x3ffb9510 ) -PROVIDE ( ld_sched_params , 0x3ffb96c0 ) -PROVIDE ( ld_sched_params , 0x3ffb96c0 ) -PROVIDE ( llc_env , 0x3ffb96d0 ) -PROVIDE ( llc_state , 0x3ffb96f8 ) -PROVIDE ( lld_evt_env , 0x3ffb9704 ) -PROVIDE ( llm_le_env , 0x3ffb976c ) -PROVIDE ( llm_state , 0x3ffb985c ) -PROVIDE ( lm_env , 0x3ffb9860 ) -PROVIDE ( lm_state , 0x3ffb9a1c ) -PROVIDE ( rwip_rf , 0x3ffbdb28 ) -PROVIDE ( _bss_end_btdm , 0x3ffbff70) -PROVIDE ( gpio_pending_mask , 0x3ffe0038 ) -PROVIDE ( app_gpio_arg , 0x3ffe003c ) -PROVIDE ( app_gpio_handler , 0x3ffe0040 ) -PROVIDE ( gpio_pending_mask_high , 0x3ffe0044 ) -PROVIDE ( gTxMsg , 0x3ffe0050 ) -PROVIDE ( RecvBuff , 0x3ffe009c ) -PROVIDE ( UartDev , 0x3ffe019c ) -PROVIDE ( ets_readySet_ , 0x3ffe01f0 ) -PROVIDE ( ets_intr_count , 0x3ffe03fc ) -PROVIDE ( user_code_start , 0x3ffe0400 ) -PROVIDE ( ets_startup_callback , 0x3ffe0404 ) -PROVIDE ( debug_timer , 0x3ffe042c ) -PROVIDE ( debug_timerfn , 0x3ffe0430 ) -PROVIDE ( _xtos_exc_handler_table , 0x3ffe0448 ) -PROVIDE ( _xtos_c_handler_table , 0x3ffe0548 ) -PROVIDE ( _Pri_4_HandlerAddress , 0x3ffe0648 ) -PROVIDE ( _Pri_5_HandlerAddress , 0x3ffe064c ) -PROVIDE ( _xtos_enabled , 0x3ffe0650 ) -PROVIDE ( _xtos_intstruct , 0x3ffe0650 ) -PROVIDE ( _xtos_vpri_enabled , 0x3ffe0654 ) -PROVIDE ( _xtos_interrupt_table , 0x3ffe0658 ) -PROVIDE ( _xtos_interrupt_mask_table , 0x3ffe0758 ) -PROVIDE ( _stack_sentry , 0x3ffe1320 ) -PROVIDE ( __stack , 0x3ffe3f20 ) -PROVIDE ( _stack_sentry_app , 0x3ffe5230 ) -PROVIDE ( __stack_app , 0x3ffe7e30 ) -PROVIDE ( _WindowOverflow4 , 0x40000000 ) -PROVIDE ( _xtos_alloca_handler , 0x40000010 ) -PROVIDE ( _WindowUnderflow4 , 0x40000040 ) -PROVIDE ( _WindowOverflow8 , 0x40000080 ) -PROVIDE ( _WindowUnderflow8 , 0x400000c0 ) -PROVIDE ( _WindowOverflow12 , 0x40000100 ) -PROVIDE ( _WindowUnderflow12 , 0x40000140 ) -PROVIDE ( _Level2Vector , 0x40000180 ) -PROVIDE ( _Level3Vector , 0x400001c0 ) -PROVIDE ( _Level4Vector , 0x40000200 ) -PROVIDE ( _Level5Vector , 0x40000240 ) -PROVIDE ( _DebugExceptionVector , 0x40000280 ) -PROVIDE ( _NMIExceptionVector , 0x400002c0 ) -PROVIDE ( _KernelExceptionVector , 0x40000300 ) -PROVIDE ( _UserExceptionVector , 0x40000340 ) -PROVIDE ( _DoubleExceptionVector , 0x400003c0 ) -PROVIDE ( _ResetVector , 0x40000400 ) -PROVIDE ( _ResetHandler , 0x40000450 ) -PROVIDE ( _stext , 0x40000560 ) -PROVIDE ( _start , 0x40000704 ) -PROVIDE ( _xtos_set_exception_handler , 0x4000074c ) -PROVIDE ( _xtos_syscall_handler , 0x40000790 ) -PROVIDE ( _SyscallException , 0x400007cf ) -PROVIDE ( _xtos_l1int_handler , 0x40000814 ) -PROVIDE ( _LevelOneInterrupt , 0x40000835 ) -PROVIDE ( _xtos_restore_intlevel , 0x40000928 ) -PROVIDE ( _xtos_set_vpri , 0x40000934 ) -PROVIDE ( _Level2FromVector , 0x40000954 ) -PROVIDE ( _Level3FromVector , 0x40000a28 ) -PROVIDE ( _Level4FromVector , 0x40000af8 ) -PROVIDE ( _Level5FromVector , 0x40000c68 ) -PROVIDE ( _xtos_cause3_handler , 0x40000dd8 ) -PROVIDE ( _xtos_c_wrapper_handler , 0x40000de8 ) -PROVIDE ( _GeneralException , 0x40000e14 ) -PROVIDE ( creat , 0x40000e8c ) -PROVIDE ( _isatty_r , 0x40000ea0 ) -PROVIDE ( asctime_r , 0x40000ec8 ) -PROVIDE ( isalnum , 0x40000f04 ) -PROVIDE ( isalpha , 0x40000f18 ) -PROVIDE ( isblank , 0x40000f2c ) -PROVIDE ( iscntrl , 0x40000f50 ) -PROVIDE ( isdigit , 0x40000f64 ) -PROVIDE ( islower , 0x40000f78 ) -PROVIDE ( isgraph , 0x40000f94 ) -PROVIDE ( isprint , 0x40000fa8 ) -PROVIDE ( ispunct , 0x40000fc0 ) -PROVIDE ( isspace , 0x40000fd4 ) -PROVIDE ( isupper , 0x40000fe8 ) -PROVIDE ( srand , 0x40001004 ) -PROVIDE ( rand , 0x40001058 ) -PROVIDE ( rand_r , 0x400010d4 ) -PROVIDE ( __sread , 0x40001118 ) -PROVIDE ( __seofread , 0x40001148 ) -PROVIDE ( __swrite , 0x40001150 ) -PROVIDE ( __sseek , 0x40001184 ) -PROVIDE ( __sclose , 0x400011b8 ) -PROVIDE ( strcasecmp , 0x400011cc ) -PROVIDE ( strcasestr , 0x40001210 ) -PROVIDE ( strcmp , 0x40001274 ) -PROVIDE ( strcoll , 0x40001398 ) -PROVIDE ( strcpy , 0x400013ac ) -PROVIDE ( strdup , 0x4000143c ) -PROVIDE ( _strdup_r , 0x40001450 ) -PROVIDE ( strlcat , 0x40001470 ) -PROVIDE ( strlen , 0x400014c0 ) -PROVIDE ( strlwr , 0x40001524 ) -PROVIDE ( strncasecmp , 0x40001550 ) -PROVIDE ( strncpy , 0x400015d4 ) -PROVIDE ( strndup , 0x400016b0 ) -PROVIDE ( _strndup_r , 0x400016c4 ) -PROVIDE ( strrchr , 0x40001708 ) -PROVIDE ( strsep , 0x40001734 ) -PROVIDE ( strupr , 0x4000174c ) -PROVIDE ( close , 0x40001778 ) -PROVIDE ( open , 0x4000178c ) -PROVIDE ( read , 0x400017dc ) -PROVIDE ( sbrk , 0x400017f4 ) -PROVIDE ( times , 0x40001808 ) -PROVIDE ( write , 0x4000181c ) -PROVIDE ( __get_current_time_locale , 0x40001834 ) -PROVIDE ( __time_load_locale , 0x4000183c ) -PROVIDE ( time , 0x40001844 ) -PROVIDE ( tolower , 0x40001868 ) -PROVIDE ( toupper , 0x40001884 ) -PROVIDE ( __tzcalc_limits , 0x400018a0 ) -PROVIDE ( __tz_lock , 0x40001a04 ) -PROVIDE ( __tz_unlock , 0x40001a10 ) -PROVIDE ( tzset , 0x40001a1c ) -PROVIDE ( _tzset_r , 0x40001a28 ) -PROVIDE ( _cleanup_r , 0x40001d48 ) -PROVIDE ( __sfmoreglue , 0x40001dc8 ) -PROVIDE ( _cleanup , 0x40001df8 ) -PROVIDE ( __sfp_lock_acquire , 0x40001e08 ) -PROVIDE ( __sfp_lock_release , 0x40001e14 ) -PROVIDE ( __sinit_lock_acquire , 0x40001e20 ) -PROVIDE ( __sinit_lock_release , 0x40001e2c ) -PROVIDE ( __sinit , 0x40001e38 ) -PROVIDE ( __sfp , 0x40001e90 ) -PROVIDE ( __fp_lock_all , 0x40001f1c ) -PROVIDE ( __fp_unlock_all , 0x40001f30 ) -PROVIDE ( _findenv_r , 0x40001f44 ) -PROVIDE ( _getenv_r , 0x40001fbc ) -PROVIDE ( __gettzinfo , 0x40001fcc ) -PROVIDE ( __env_lock , 0x40001fd4 ) -PROVIDE ( __env_unlock , 0x40001fe0 ) -PROVIDE ( _fclose_r , 0x40001fec ) -PROVIDE ( fclose , 0x400020ac ) -PROVIDE ( __negsf2 , 0x400020c0 ) -PROVIDE ( __addsf3 , 0x400020e8 ) -PROVIDE ( __subsf3 , 0x400021d0 ) -PROVIDE ( __divsf3 , 0x4000234c ) -PROVIDE ( __fixsfsi , 0x4000240c ) -PROVIDE ( __fixsfdi , 0x4000244c ) -PROVIDE ( __fixunssfsi , 0x400024ac ) -PROVIDE ( __fixunssfdi , 0x40002504 ) -PROVIDE ( __adddf3 , 0x40002590 ) -PROVIDE ( __subdf3 , 0x400026e4 ) -PROVIDE ( __divdf3 , 0x40002954 ) -PROVIDE ( __fixdfsi , 0x40002a78 ) -PROVIDE ( __fixdfdi , 0x40002ac4 ) -PROVIDE ( __fixunsdfsi , 0x40002b30 ) -PROVIDE ( __truncdfsf2 , 0x40002b90 ) -PROVIDE ( __extendsfdf2 , 0x40002c34 ) -PROVIDE ( __addvsi3 , 0x40002c98 ) -PROVIDE ( __addvdi3 , 0x40002cbc ) -PROVIDE ( __subvsi3 , 0x40002cf8 ) -PROVIDE ( __subvdi3 , 0x40002d20 ) -PROVIDE ( __mulvsi3 , 0x40002d60 ) -PROVIDE ( __mulvdi3 , 0x40002d78 ) -PROVIDE ( __negvsi2 , 0x40002e78 ) -PROVIDE ( __negvdi2 , 0x40002e98 ) -PROVIDE ( __popcountsi2 , 0x40002ed0 ) -PROVIDE ( __popcountdi2 , 0x40002ef8 ) -PROVIDE ( __paritysi2 , 0x40002f3c ) -PROVIDE ( rom_phy_disable_agc , 0x40002f6c ) -PROVIDE ( rom_phy_enable_agc , 0x40002f88 ) -PROVIDE ( rom_disable_agc , 0x40002fa4 ) -PROVIDE ( rom_enable_agc , 0x40002fcc ) -PROVIDE ( rom_phy_disable_cca , 0x40003000 ) -PROVIDE ( rom_phy_enable_cca , 0x4000302c ) -PROVIDE ( rom_pow_usr , 0x40003044 ) -PROVIDE ( rom_set_loopback_gain , 0x40003060 ) -PROVIDE ( rom_set_cal_rxdc , 0x400030b8 ) -PROVIDE ( rom_loopback_mode_en , 0x400030f8 ) -PROVIDE ( rom_get_data_sat , 0x4000312c ) -PROVIDE ( rom_set_pbus_mem , 0x400031a4 ) -PROVIDE ( rom_write_gain_mem , 0x4000348c ) -PROVIDE ( rom_rx_gain_force , 0x4000351c ) -PROVIDE ( rom_set_txclk_en , 0x40003564 ) -PROVIDE ( rom_set_rxclk_en , 0x40003594 ) -PROVIDE ( rom_start_tx_tone_step , 0x400035d0 ) -PROVIDE ( rom_start_tx_tone , 0x400036b4 ) -PROVIDE ( rom_clk_force_on_vit , 0x40003710 ) -PROVIDE ( rom_bb_rx_ht20_cen_bcov_en , 0x40003734 ) -PROVIDE ( rom_bb_tx_ht20_cen , 0x40003760 ) -PROVIDE ( rom_spur_reg_write_one_tone , 0x400037f0 ) -PROVIDE ( rom_spur_coef_cfg , 0x40003ac8 ) -PROVIDE ( rom_bb_wdg_test_en , 0x40003b70 ) -PROVIDE ( rom_bb_bss_cbw40_dig , 0x40003bac ) -PROVIDE ( rom_noise_floor_auto_set , 0x40003bdc ) -PROVIDE ( rom_phy_get_noisefloor , 0x40003c2c ) -PROVIDE ( rom_check_noise_floor , 0x40003c78 ) -PROVIDE ( rom_set_noise_floor , 0x40003d48 ) -PROVIDE ( rom_chip_v7_rx_rifs_en , 0x40003d90 ) -PROVIDE ( rom_rtc_mem_backup , 0x40003db4 ) -PROVIDE ( rom_rtc_mem_recovery , 0x40003df4 ) -PROVIDE ( rom_gen_rx_gain_table , 0x40003e3c ) -PROVIDE ( rom_stop_tx_tone , 0x40003f98 ) -PROVIDE ( rom_bb_bss_bw_40_en , 0x4000401c ) -PROVIDE ( rom_mhz2ieee , 0x4000404c ) -PROVIDE ( rom_cbw2040_cfg , 0x400040b0 ) -PROVIDE ( phy_get_romfuncs , 0x40004100 ) -PROVIDE ( rom_chip_i2c_readReg , 0x40004110 ) -PROVIDE ( rom_i2c_readReg , 0x40004148 ) -PROVIDE ( rom_chip_i2c_writeReg , 0x40004168 ) -PROVIDE ( rom_i2c_writeReg , 0x400041a4 ) -PROVIDE ( rom_i2c_readReg_Mask , 0x400041c0 ) -PROVIDE ( rom_i2c_writeReg_Mask , 0x400041fc ) -PROVIDE ( rom_pbus_force_mode , 0x40004270 ) -PROVIDE ( rom_pbus_rd_addr , 0x40004334 ) -PROVIDE ( rom_pbus_rd_shift , 0x40004374 ) -PROVIDE ( rom_pbus_force_test , 0x400043c0 ) -PROVIDE ( rom_pbus_rd , 0x40004414 ) -PROVIDE ( rom_pbus_debugmode , 0x40004458 ) -PROVIDE ( rom_pbus_workmode , 0x4000446c ) -PROVIDE ( rom_pbus_set_rxgain , 0x40004480 ) -PROVIDE ( rom_pbus_xpd_rx_off , 0x40004508 ) -PROVIDE ( rom_pbus_xpd_rx_on , 0x4000453c ) -PROVIDE ( rom_pbus_xpd_tx_off , 0x40004590 ) -PROVIDE ( rom_pbus_xpd_tx_on , 0x400045e0 ) -PROVIDE ( rom_pbus_set_dco , 0x40004638 ) -PROVIDE ( rom_rfpll_reset , 0x40004680 ) -PROVIDE ( rom_restart_cal , 0x400046e0 ) -PROVIDE ( rom_write_rfpll_sdm , 0x40004740 ) -PROVIDE ( rom_wait_rfpll_cal_end , 0x400047a8 ) -PROVIDE ( rom_rfpll_set_freq , 0x400047f8 ) -PROVIDE ( rom_set_channel_freq , 0x40004880 ) -PROVIDE ( rom_phy_freq_correct , 0x40004b44 ) -PROVIDE ( rom_set_rf_freq_offset , 0x40004ca8 ) -PROVIDE ( rom_chip_v7_rx_init , 0x40004cec ) -PROVIDE ( rom_chip_v7_tx_init , 0x40004d18 ) -PROVIDE ( rom_chip_v7_bt_init , 0x40004d8c ) -PROVIDE ( rom_txbbgain_to_index , 0x40004dc0 ) -PROVIDE ( rom_index_to_txbbgain , 0x40004df8 ) -PROVIDE ( rom_txdc_cal_init , 0x40004e10 ) -PROVIDE ( rom_txdc_cal_v70 , 0x40004ea4 ) -PROVIDE ( rom_en_pwdet , 0x4000506c ) -PROVIDE ( rom_txcal_work_mode , 0x4000510c ) -PROVIDE ( rom_txiq_set_reg , 0x40005154 ) -PROVIDE ( rom_read_sar_dout , 0x400051c0 ) -PROVIDE ( rom_get_fm_sar_dout , 0x40005204 ) -PROVIDE ( rom_txtone_linear_pwr , 0x40005290 ) -PROVIDE ( rom_txiq_get_mis_pwr , 0x400052dc ) -PROVIDE ( rom_txiq_cover , 0x4000538c ) -PROVIDE ( rom_abs_temp , 0x400054f0 ) -PROVIDE ( rom_iq_est_enable , 0x40005514 ) -PROVIDE ( rom_iq_est_disable , 0x40005590 ) -PROVIDE ( rom_dc_iq_est , 0x400055c8 ) -PROVIDE ( rom_pbus_rx_dco_cal , 0x40005620 ) -PROVIDE ( rom_rxiq_get_mis , 0x400058e4 ) -PROVIDE ( rom_rxiq_set_reg , 0x40005a00 ) -PROVIDE ( rom_rxiq_cover_mg_mp , 0x40005a68 ) -PROVIDE ( rom_rfcal_rxiq , 0x40005b4c ) -PROVIDE ( rom_get_rfcal_rxiq_data , 0x40005bbc ) -PROVIDE ( rom_set_chan_cal_interp , 0x40005ce0 ) -PROVIDE ( rom_set_txcap_reg , 0x40005d50 ) -PROVIDE ( rom_rfcal_txcap , 0x40005dec ) -PROVIDE ( rom_linear_to_db , 0x40005f64 ) -PROVIDE ( rom_get_power_db , 0x40005fc8 ) -PROVIDE ( rom_meas_tone_pwr_db , 0x40006004 ) -PROVIDE ( rom_rfcal_pwrctrl , 0x40006058 ) -PROVIDE ( rom_tx_atten_set_interp , 0x400061cc ) -PROVIDE ( rom_target_power_add_backoff , 0x40006268 ) -PROVIDE ( rom_get_rf_gain_qdb , 0x40006290 ) -PROVIDE ( rom_correct_rf_ana_gain , 0x400062a8 ) -PROVIDE ( rom_phy_get_vdd33 , 0x4000642c ) -PROVIDE ( rom_get_sar_dout , 0x40006564 ) -PROVIDE ( rom_get_pwctrl_correct , 0x400065d4 ) -PROVIDE ( rom_tx_pwctrl_bg_init , 0x4000662c ) -PROVIDE ( ets_set_idle_cb , 0x40006674 ) -PROVIDE ( ets_task , 0x40006688 ) -PROVIDE ( ets_run , 0x400066bc ) -PROVIDE ( ets_post , 0x4000673c ) -PROVIDE ( ets_intr_lock , 0x400067b0 ) -PROVIDE ( ets_intr_unlock , 0x400067c4 ) -PROVIDE ( ets_waiti0 , 0x400067d8 ) -PROVIDE ( ets_isr_attach , 0x400067ec ) -PROVIDE ( ets_isr_mask , 0x400067fc ) -PROVIDE ( ets_isr_unmask , 0x40006808 ) -PROVIDE ( intr_matrix_set , 0x4000681c ) -PROVIDE ( ets_set_user_start , 0x4000687c ) -PROVIDE ( ets_set_startup_callback , 0x4000688c ) -PROVIDE ( ets_set_appcpu_boot_addr , 0x4000689c ) -PROVIDE ( check_pos , 0x400068b8 ) -PROVIDE ( ets_unpack_flash_code_legacy , 0x4000694c ) -PROVIDE ( ets_unpack_flash_code , 0x40007018 ) -PROVIDE ( rom_main , 0x400076c4 ) -PROVIDE ( ets_install_putc1 , 0x40007d18 ) -PROVIDE ( ets_install_uart_printf , 0x40007d28 ) -PROVIDE ( ets_install_putc2 , 0x40007d38 ) -PROVIDE ( ets_printf , 0x40007d54 ) -PROVIDE ( calc_rtc_memory_crc , 0x40008170 ) -PROVIDE ( rtc_get_reset_reason , 0x400081d4 ) -PROVIDE ( rtc_get_wakeup_cause , 0x400081f4 ) -PROVIDE ( set_rtc_memory_crc , 0x40008208 ) -PROVIDE ( rtc_boot_control , 0x4000821c ) -PROVIDE ( software_reset , 0x4000824c ) -PROVIDE ( software_reset_cpu , 0x40008264 ) -PROVIDE ( rtc_select_apb_bridge , 0x40008288 ) -PROVIDE ( ets_timer_setfn , 0x40008350 ) -PROVIDE ( ets_timer_arm , 0x40008368 ) -PROVIDE ( ets_timer_arm_us , 0x400083ac ) -PROVIDE ( ets_timer_disarm , 0x400083ec ) -PROVIDE ( ets_timer_done , 0x40008428 ) -PROVIDE ( ets_timer_handler_isr , 0x40008454 ) -PROVIDE ( ets_timer_init , 0x400084e8 ) -PROVIDE ( ets_delay_us , 0x40008534 ) -PROVIDE ( ets_update_cpu_frequency , 0x40008550 ) -PROVIDE ( ets_get_cpu_frequency , 0x4000855c ) -PROVIDE ( ets_get_xtal_scale , 0x4000856c ) -PROVIDE ( ets_get_detected_xtal_freq , 0x40008588 ) -PROVIDE ( ets_efuse_read_op , 0x40008600 ) -PROVIDE ( ets_efuse_program_op , 0x40008628 ) -PROVIDE ( ets_efuse_get_spiconfig , 0x40008658 ) -PROVIDE ( ets_efuse_get_8M_clock , 0x40008710 ) -PROVIDE ( UartConnCheck , 0x40008738 ) -PROVIDE ( FlashDwnLdStartMsgProc , 0x40008820 ) -PROVIDE ( FilePacketSendReqMsgProc , 0x40008860 ) -PROVIDE ( FlashDwnLdStopReqMsgProc , 0x400088ec ) -PROVIDE ( FlashDwnLdParamCfgMsgProc , 0x4000891c ) -PROVIDE ( MemDwnLdStartMsgProc , 0x40008948 ) -PROVIDE ( MemPacketSendReqMsgProc , 0x40008978 ) -PROVIDE ( MemDwnLdStopReqMsgProc , 0x400089dc ) -PROVIDE ( UartConnectProc , 0x40008a04 ) -PROVIDE ( UartRegWriteProc , 0x40008a14 ) -PROVIDE ( UartRegReadProc , 0x40008a58 ) -PROVIDE ( UartSpiAttachProc , 0x40008a6c ) -PROVIDE ( UartSpiReadProc , 0x40008a80 ) -PROVIDE ( UartSetBaudProc , 0x40008aac ) -PROVIDE ( FlashDwnLdDeflatedStartMsgProc , 0x40008ad8 ) -PROVIDE ( FilePacketSendDeflatedReqMsgProc , 0x40008b24 ) -PROVIDE ( FlashDwnLdStopDeflatedReqMsgProc , 0x40008c18 ) -PROVIDE ( VerifyFlashMd5Proc , 0x40008c44 ) -PROVIDE ( UartDwnLdProc , 0x40008ce8 ) -PROVIDE ( uart_rx_intr_handler , 0x40008f4c ) -PROVIDE ( uartAttach , 0x40008fd0 ) -PROVIDE ( uart_tx_switch , 0x40009028 ) -PROVIDE ( uart_baudrate_detect , 0x40009034 ) -PROVIDE ( uart_div_modify , 0x400090cc ) -PROVIDE ( Uart_Init , 0x40009120 ) -PROVIDE ( uart_tx_one_char , 0x40009200 ) -PROVIDE ( uart_tx_one_char2 , 0x4000922c ) -PROVIDE ( uart_tx_flush , 0x40009258 ) -PROVIDE ( uart_tx_wait_idle , 0x40009278 ) -PROVIDE ( uart_rx_one_char_block , 0x400092a4 ) -PROVIDE ( uart_rx_one_char , 0x400092d0 ) -PROVIDE ( UartRxString , 0x400092fc ) -PROVIDE ( send_packet , 0x40009340 ) -PROVIDE ( SendMsg , 0x40009384 ) -PROVIDE ( uart_rx_readbuff , 0x40009394 ) -PROVIDE ( uart_buff_switch , 0x400093c0 ) -PROVIDE ( recv_packet , 0x40009424 ) -PROVIDE ( RcvMsg , 0x4000954c ) -PROVIDE ( UartGetCmdLn , 0x40009564 ) -PROVIDE ( GetUartDevice , 0x40009598 ) -PROVIDE ( mmu_init , 0x400095a4 ) -PROVIDE ( cache_flash_mmu_set , 0x400095e0 ) -PROVIDE ( cache_sram_mmu_set , 0x400097f4 ) -PROVIDE ( Cache_Read_Init , 0x40009950 ) -PROVIDE ( Cache_Flush , 0x40009a14 ) -PROVIDE ( Cache_Read_Enable , 0x40009a84 ) -PROVIDE ( Cache_Read_Disable , 0x40009ab8 ) -PROVIDE ( gpio_output_set , 0x40009b24 ) -PROVIDE ( gpio_output_set_high , 0x40009b5c ) -PROVIDE ( gpio_input_get , 0x40009b88 ) -PROVIDE ( gpio_input_get_high , 0x40009b9c ) -PROVIDE ( gpio_register_set , 0x40009bbc ) -PROVIDE ( gpio_init , 0x40009c20 ) -PROVIDE ( gpio_register_get , 0x40009cbc ) -PROVIDE ( gpio_intr_pending , 0x40009cec ) -PROVIDE ( gpio_intr_pending_high , 0x40009cf8 ) -PROVIDE ( gpio_pin_intr_state_set , 0x40009d04 ) -PROVIDE ( gpio_intr_ack , 0x40009dd4 ) -PROVIDE ( gpio_intr_ack_high , 0x40009e1c ) -PROVIDE ( gpio_intr_handler_register , 0x40009e6c ) -PROVIDE ( gpio_pin_wakeup_enable , 0x40009e7c ) -PROVIDE ( gpio_pin_wakeup_disable , 0x40009eb0 ) -PROVIDE ( gpio_matrix_in , 0x40009edc ) -PROVIDE ( gpio_matrix_out , 0x40009f0c ) -PROVIDE ( gpio_pad_select_gpio , 0x40009fdc ) -PROVIDE ( gpio_pad_set_drv , 0x4000a11c ) -PROVIDE ( gpio_pad_pullup , 0x4000a22c ) -PROVIDE ( gpio_pad_pulldown , 0x4000a348 ) -PROVIDE ( gpio_pad_unhold , 0x4000a484 ) -PROVIDE ( gpio_pad_hold , 0x4000a734 ) -PROVIDE ( lldesc_build_chain , 0x4000a850 ) -PROVIDE ( lldesc_num2link , 0x4000a948 ) -PROVIDE ( lldesc_set_owner , 0x4000a974 ) -PROVIDE ( roundup2 , 0x4000ab7c ) -PROVIDE ( multofup , 0x4000ab8c ) -PROVIDE ( sip_alloc_to_host_evt , 0x4000ab9c ) -PROVIDE ( sip_to_host_evt_send_done , 0x4000ac04 ) -PROVIDE ( sip_reclaim_tx_data_pkt , 0x4000ad5c ) -PROVIDE ( sip_reclaim_from_host_cmd , 0x4000adbc ) -PROVIDE ( sip_install_rx_ctrl_cb , 0x4000ae10 ) -PROVIDE ( sip_install_rx_data_cb , 0x4000ae20 ) -PROVIDE ( sip_get_state , 0x4000ae2c ) -PROVIDE ( sip_init_attach , 0x4000ae58 ) -PROVIDE ( sip_post_init , 0x4000aed8 ) -PROVIDE ( sip_to_host_chain_append , 0x4000aef8 ) -PROVIDE ( sip_send , 0x4000af54 ) -PROVIDE ( sip_get_ptr , 0x4000b34c ) -PROVIDE ( sip_after_tx_complete , 0x4000b358 ) -PROVIDE ( sip_is_active , 0x4000b3c0 ) -PROVIDE ( slc_has_pkt_to_host , 0x4000b5fc ) -PROVIDE ( slc_reattach , 0x4000b62c ) -PROVIDE ( slc_enable , 0x4000b64c ) -PROVIDE ( slc_send_to_host_chain , 0x4000b6a0 ) -PROVIDE ( slc_to_host_chain_recycle , 0x4000b758 ) -PROVIDE ( slc_from_host_chain_fetch , 0x4000b7e8 ) -PROVIDE ( slc_set_host_io_max_window , 0x4000b89c ) -PROVIDE ( slc_init_attach , 0x4000b918 ) -PROVIDE ( slc_init_credit , 0x4000badc ) -PROVIDE ( slc_add_credits , 0x4000baf4 ) -PROVIDE ( slc_from_host_chain_recycle , 0x4000bb10 ) -PROVIDE ( abort , 0x4000bba4 ) -PROVIDE ( _malloc_r , 0x4000bbb4 ) -PROVIDE ( _free_r , 0x4000bbcc ) -PROVIDE ( _realloc_r , 0x4000bbe0 ) -PROVIDE ( _calloc_r , 0x4000bbf8 ) -PROVIDE ( _system_r , 0x4000bc10 ) -PROVIDE ( _rename_r , 0x4000bc28 ) -PROVIDE ( _times_r , 0x4000bc40 ) -PROVIDE ( _gettimeofday_r , 0x4000bc58 ) -PROVIDE ( _raise_r , 0x4000bc70 ) -PROVIDE ( _unlink_r , 0x4000bc84 ) -PROVIDE ( _link_r , 0x4000bc9c ) -PROVIDE ( _stat_r , 0x4000bcb4 ) -PROVIDE ( _fstat_r , 0x4000bccc ) -PROVIDE ( _sbrk_r , 0x4000bce4 ) -PROVIDE ( _getpid_r , 0x4000bcfc ) -PROVIDE ( _kill_r , 0x4000bd10 ) -PROVIDE ( _exit_r , 0x4000bd28 ) -PROVIDE ( _close_r , 0x4000bd3c ) -PROVIDE ( _open_r , 0x4000bd54 ) -PROVIDE ( _write_r , 0x4000bd70 ) -PROVIDE ( _lseek_r , 0x4000bd8c ) -PROVIDE ( _read_r , 0x4000bda8 ) -PROVIDE ( _lock_init , 0x4000bdc4 ) -PROVIDE ( _lock_init_recursive , 0x4000bdd8 ) -PROVIDE ( _lock_close , 0x4000bdec ) -PROVIDE ( _lock_close_recursive , 0x4000be00 ) -PROVIDE ( _lock_acquire , 0x4000be14 ) -PROVIDE ( _lock_acquire_recursive , 0x4000be28 ) -PROVIDE ( _lock_try_acquire , 0x4000be3c ) -PROVIDE ( _lock_try_acquire_recursive , 0x4000be50 ) -PROVIDE ( _lock_release , 0x4000be64 ) -PROVIDE ( _lock_release_recursive , 0x4000be78 ) -PROVIDE ( __getreent , 0x4000be8c ) -PROVIDE ( malloc , 0x4000bea0 ) -PROVIDE ( free , 0x4000beb8 ) -PROVIDE ( realloc , 0x4000becc ) -PROVIDE ( calloc , 0x4000bee4 ) -PROVIDE ( _printf_float , 0x4000befc ) -PROVIDE ( _scanf_float , 0x4000bf18 ) -PROVIDE ( _xtos_set_interrupt_handler_arg , 0x4000bf34 ) -PROVIDE ( _xtos_set_interrupt_handler , 0x4000bf78 ) -PROVIDE ( _xtos_ints_on , 0x4000bf88 ) -PROVIDE ( _xtos_ints_off , 0x4000bfac ) -PROVIDE ( _xtos_p_none , 0x4000bfd4 ) -PROVIDE ( _xtos_set_intlevel , 0x4000bfdc ) -PROVIDE ( _xtos_set_min_intlevel , 0x4000bff8 ) -PROVIDE ( _xtos_unhandled_interrupt , 0x4000c01c ) -PROVIDE ( _xtos_unhandled_exception , 0x4000c024 ) -PROVIDE ( _xtos_return_from_exc , 0x4000c034 ) -PROVIDE ( xthal_get_ccount , 0x4000c050 ) -PROVIDE ( xthal_set_ccompare , 0x4000c058 ) -PROVIDE ( xthal_get_ccompare , 0x4000c078 ) -PROVIDE ( xthal_bcopy , 0x4000c098 ) -PROVIDE ( xthal_memcpy , 0x4000c0bc ) -PROVIDE ( xthal_copy123 , 0x4000c124 ) -PROVIDE ( xthal_get_interrupt , 0x4000c1e4 ) -PROVIDE ( xthal_get_intread , 0x4000c1e4 ) -PROVIDE ( xthal_set_intclear , 0x4000c1ec ) -PROVIDE ( bzero , 0x4000c1f4 ) -PROVIDE ( isascii , 0x4000c20c ) -PROVIDE ( memccpy , 0x4000c220 ) -PROVIDE ( memchr , 0x4000c244 ) -PROVIDE ( memcmp , 0x4000c260 ) -PROVIDE ( memcpy , 0x4000c2c8 ) -PROVIDE ( memmove , 0x4000c3c0 ) -PROVIDE ( memrchr , 0x4000c400 ) -PROVIDE ( memset , 0x4000c44c ) -PROVIDE ( __sccl , 0x4000c498 ) -PROVIDE ( strcat , 0x4000c518 ) -PROVIDE ( strchr , 0x4000c53c ) -PROVIDE ( strcspn , 0x4000c558 ) -PROVIDE ( strlcpy , 0x4000c584 ) -PROVIDE ( strncat , 0x4000c5c4 ) -PROVIDE ( strncmp , 0x4000c5f4 ) -PROVIDE ( strnlen , 0x4000c628 ) -PROVIDE ( strspn , 0x4000c648 ) -PROVIDE ( strstr , 0x4000c674 ) -PROVIDE ( __strtok_r , 0x4000c6a8 ) -PROVIDE ( strtok_r , 0x4000c70c ) -PROVIDE ( toascii , 0x4000c720 ) -PROVIDE ( __dummy_lock , 0x4000c728 ) -PROVIDE ( __dummy_lock_try , 0x4000c730 ) -PROVIDE ( _fwalk , 0x4000c738 ) -PROVIDE ( _fwalk_reent , 0x4000c770 ) -PROVIDE ( __mulsi3 , 0x4000c7b0 ) -PROVIDE ( __divsi3 , 0x4000c7b8 ) -PROVIDE ( __modsi3 , 0x4000c7c0 ) -PROVIDE ( __udivsi3 , 0x4000c7c8 ) -PROVIDE ( __umodsi3 , 0x4000c7d0 ) -PROVIDE ( __umulsidi3 , 0x4000c7d8 ) -PROVIDE ( __clzsi2 , 0x4000c7e8 ) -PROVIDE ( __ctzsi2 , 0x4000c7f0 ) -PROVIDE ( __ffssi2 , 0x4000c804 ) -PROVIDE ( __ashldi3 , 0x4000c818 ) -PROVIDE ( __ashrdi3 , 0x4000c830 ) -PROVIDE ( __lshrdi3 , 0x4000c84c ) -PROVIDE ( __floatunsisf , 0x4000c864 ) -PROVIDE ( __floatsisf , 0x4000c870 ) -PROVIDE ( __floatundisf , 0x4000c8b0 ) -PROVIDE ( __floatdisf , 0x4000c8c0 ) -PROVIDE ( __floatunsidf , 0x4000c938 ) -PROVIDE ( __floatsidf , 0x4000c944 ) -PROVIDE ( __floatundidf , 0x4000c978 ) -PROVIDE ( __floatdidf , 0x4000c988 ) -PROVIDE ( __muldi3 , 0x4000c9fc ) -PROVIDE ( __negdi2 , 0x4000ca14 ) -PROVIDE ( __ffsdi2 , 0x4000ca2c ) -PROVIDE ( __clzdi2 , 0x4000ca50 ) -PROVIDE ( __ctzdi2 , 0x4000ca64 ) -PROVIDE ( __divdi3 , 0x4000ca84 ) -PROVIDE ( __moddi3 , 0x4000cd4c ) -PROVIDE ( __udivdi3 , 0x4000cff8 ) -PROVIDE ( __umoddi3 , 0x4000d280 ) -PROVIDE ( _data_start_btdm_rom , 0x4000d4f4 ) -PROVIDE ( _data_end_btdm_rom , 0x4000d4f8 ) -PROVIDE ( _data_start , 0x4000d4f8 ) -PROVIDE ( _rom_store_table , 0x4000d4f8 ) -PROVIDE ( _data_end , 0x4000d5c8 ) -PROVIDE ( _etext , 0x4000d66c ) -PROVIDE ( _rom_store , 0x4000d66c ) -PROVIDE ( btdm_r_btdm_option_data_p_get , 0x40010004 ) -PROVIDE ( btdm_r_data_init , 0x4001002c ) -PROVIDE ( btdm_r_btdm_rom_version_get , 0x40010078 ) -PROVIDE ( r_bt_util_buf_init , 0x400100e4 ) -PROVIDE ( r_bt_util_buf_lmp_tx_alloc , 0x400101d0 ) -PROVIDE ( r_bt_util_buf_lmp_tx_free , 0x400101ec ) -PROVIDE ( r_bt_util_buf_acl_rx_alloc , 0x40010218 ) -PROVIDE ( r_bt_util_buf_acl_rx_free , 0x40010234 ) -PROVIDE ( r_bt_util_buf_acl_tx_alloc , 0x40010268 ) -PROVIDE ( r_bt_util_buf_acl_tx_free , 0x40010280 ) -PROVIDE ( r_bt_util_buf_sync_init , 0x400102c4 ) -PROVIDE ( r_bt_util_buf_sync_clear , 0x400103c8 ) -PROVIDE ( r_bt_util_buf_sync_tx_alloc , 0x400103ec ) -PROVIDE ( r_bt_util_buf_sync_tx_free , 0x40010428 ) -PROVIDE ( r_bt_util_buf_sync_rx_alloc , 0x40010468 ) -PROVIDE ( r_bt_util_buf_sync_rx_free , 0x4001049c ) -PROVIDE ( r_E1 , 0x400108e8 ) -PROVIDE ( r_E21 , 0x40010968 ) -PROVIDE ( r_E22 , 0x400109b4 ) -PROVIDE ( r_E3 , 0x40010a58 ) -PROVIDE ( r_KPrimC , 0x40010ad4 ) -PROVIDE ( r_XorKey , 0x400112c0 ) -PROVIDE ( r_LM_MakeRandVec , 0x400112d8 ) -PROVIDE ( r_lmp_pack , 0x4001135c ) -PROVIDE ( r_lmp_unpack , 0x4001149c ) -PROVIDE ( r_lm_n_is_zero , 0x40012170 ) -PROVIDE ( r_lm_sp_sha256_calculate , 0x400121a0 ) -PROVIDE ( r_lm_sp_n_one , 0x400123a4 ) -PROVIDE ( r_lm_sp_n192_convert_wnaf , 0x400123c0 ) -PROVIDE ( r_lm_sp_p192_point_to_inf , 0x40012458 ) -PROVIDE ( r_lm_sp_p192_point_jacobian_to_affine , 0x40012468 ) -PROVIDE ( r_lm_sp_p192_points_jacobian_to_affine , 0x400124e4 ) -PROVIDE ( r_lm_sp_pre_compute_points , 0x40012640 ) -PROVIDE ( r_lm_sp_p192_dbl , 0x4001268c ) -PROVIDE ( r_lm_sp_p192_add , 0x40012828 ) -PROVIDE ( r_lm_sp_p192_invert , 0x40012b6c ) -PROVIDE ( r_lm_f1 , 0x40012bb8 ) -PROVIDE ( r_lm_f2 , 0x40012cfc ) -PROVIDE ( r_lm_oob_f1 , 0x40012e54 ) -PROVIDE ( r_lm_g , 0x40012f90 ) -PROVIDE ( r_lm_f3 , 0x40013050 ) -PROVIDE ( r_lm_get_nonce , 0x400131c4 ) -PROVIDE ( r_lm_dhkey_calc_init , 0x40013234 ) -PROVIDE ( r_lm_dhkey_compare , 0x400132d8 ) -PROVIDE ( r_F1_256 , 0x400133e4 ) -PROVIDE ( r_G_256 , 0x40013470 ) -PROVIDE ( r_F2_256 , 0x40013568 ) -PROVIDE ( r_F3_256 , 0x40013664 ) -PROVIDE ( r_H3 , 0x40013760 ) -PROVIDE ( r_H4 , 0x40013830 ) -PROVIDE ( r_H5 , 0x400138dc ) -PROVIDE ( r_HMAC , 0x40013968 ) -PROVIDE ( r_hashConcat , 0x40013a38 ) -PROVIDE ( r_SHA_256 , 0x40013a90 ) -PROVIDE ( r_co_list_init , 0x40013f14 ) -PROVIDE ( r_co_list_pool_init , 0x40013f30 ) -PROVIDE ( r_co_list_push_back , 0x40013fb8 ) -PROVIDE ( r_co_list_push_front , 0x40013ff4 ) -PROVIDE ( r_co_list_pop_front , 0x40014028 ) -PROVIDE ( r_co_list_extract , 0x4001404c ) -PROVIDE ( r_co_list_extract_after , 0x40014118 ) -PROVIDE ( r_co_list_find , 0x4001419c ) -PROVIDE ( r_co_list_merge , 0x400141bc ) -PROVIDE ( r_co_list_insert_before , 0x40014200 ) -PROVIDE ( r_co_list_insert_after , 0x40014254 ) -PROVIDE ( r_co_list_size , 0x400142ac ) -PROVIDE ( r_co_list_check_size_available , 0x400142c4 ) -PROVIDE ( r_co_bytes_to_string , 0x400142e4 ) -PROVIDE ( r_co_bdaddr_compare , 0x40014324 ) -PROVIDE ( r_co_slot_to_duration , 0x40014348 ) -PROVIDE ( r_co_nb_good_channels , 0x40014360 ) -PROVIDE ( r_dbg_init , 0x40014394 ) -PROVIDE ( r_dbg_platform_reset_complete , 0x400143d0 ) -PROVIDE ( r_dbg_swdiag_init , 0x40014470 ) -PROVIDE ( r_dbg_swdiag_read , 0x400144a4 ) -PROVIDE ( r_dbg_swdiag_write , 0x400144d0 ) -PROVIDE ( r_ea_elt_cancel , 0x400150d0 ) -PROVIDE ( r_ea_init , 0x40015228 ) -PROVIDE ( r_ea_elt_create , 0x40015264 ) -PROVIDE ( r_ea_elt_insert , 0x400152a8 ) -PROVIDE ( r_ea_elt_remove , 0x400154f0 ) -PROVIDE ( r_ea_interval_create , 0x4001555c ) -PROVIDE ( r_ea_interval_insert , 0x4001557c ) -PROVIDE ( r_ea_interval_remove , 0x40015590 ) -PROVIDE ( r_ea_interval_delete , 0x400155a8 ) -PROVIDE ( r_ea_finetimer_isr , 0x400155d4 ) -PROVIDE ( r_ea_sw_isr , 0x40015724 ) -PROVIDE ( r_ea_offset_req , 0x40015748 ) -PROVIDE ( r_ea_time_get_halfslot_rounded , 0x40015894 ) -PROVIDE ( r_ea_time_get_slot_rounded , 0x400158d4 ) -PROVIDE ( r_ea_sleep_check , 0x40015928 ) -PROVIDE ( r_ea_interval_duration_req , 0x4001597c ) -PROVIDE ( r_ea_alarm_set , 0x40015a10 ) -PROVIDE ( r_ea_alarm_clear , 0x40015ab4 ) -PROVIDE ( notEqual256 , 0x40015b04 ) -PROVIDE ( AddBigHex256 , 0x40015b28 ) -PROVIDE ( Add2SelfBigHex256 , 0x40015b7c ) -PROVIDE ( SubtractBigHex256 , 0x40015bcc ) -PROVIDE ( SubtractFromSelfBigHex256 , 0x40015c20 ) -PROVIDE ( AddP256 , 0x40015c74 ) -PROVIDE ( AddBigHexModP256 , 0x40015c98 ) -PROVIDE ( AddPdiv2_256 , 0x40015ce0 ) -PROVIDE ( SubtractFromSelfBigHexSign256 , 0x40015dc8 ) -PROVIDE ( SubtractBigHexMod256 , 0x40015e8c ) -PROVIDE ( SubtractBigHexUint32_256 , 0x40015f8c ) -PROVIDE ( MultiplyByU32ModP256 , 0x40015fdc ) -PROVIDE ( specialModP256 , 0x4001600c ) -PROVIDE ( MultiplyBigHexModP256 , 0x400160b8 ) -PROVIDE ( MultiplyBigHexByUint32_256 , 0x40016214 ) -PROVIDE ( GF_Jacobian_Point_Double256 , 0x40016260 ) -PROVIDE ( GF_Jacobian_Point_Addition256 , 0x400163a4 ) -PROVIDE ( bigHexInversion256 , 0x400168f0 ) -PROVIDE ( GF_Point_Jacobian_To_Affine256 , 0x40016b0c ) -PROVIDE ( r_ecc_init , 0x40016dbc ) -PROVIDE ( r_ecc_generate_key256 , 0x40016e00 ) -PROVIDE ( r_ecc_abort_key256_generation , 0x40017070 ) -PROVIDE ( r_ecc_gen_new_public_key , 0x400170c0 ) -PROVIDE ( r_ecc_gen_new_secret_key , 0x400170e4 ) -PROVIDE ( r_ecc_get_debug_Keys , 0x40017224 ) -PROVIDE ( r_em_buf_init , 0x4001729c ) -PROVIDE ( r_em_buf_rx_free , 0x400173c4 ) -PROVIDE ( r_em_buf_rx_buff_addr_get , 0x400173e8 ) -PROVIDE ( r_em_buf_tx_buff_addr_get , 0x40017404 ) -PROVIDE ( r_em_buf_tx_free , 0x4001741c ) -PROVIDE ( r_h4tl_init , 0x40017878 ) -PROVIDE ( r_h4tl_write , 0x400178d0 ) -PROVIDE ( r_h4tl_start , 0x40017924 ) -PROVIDE ( r_h4tl_stop , 0x40017934 ) -PROVIDE ( r_hci_fc_init , 0x40017974 ) -PROVIDE ( r_hci_fc_acl_buf_size_set , 0x40017988 ) -PROVIDE ( r_hci_fc_sync_buf_size_set , 0x400179b0 ) -PROVIDE ( r_hci_fc_acl_en , 0x400179d8 ) -PROVIDE ( r_hci_fc_sync_en , 0x40017a30 ) -PROVIDE ( r_hci_fc_acl_packet_sent , 0x40017a3c ) -PROVIDE ( r_hci_fc_sync_packet_sent , 0x40017a54 ) -PROVIDE ( r_hci_fc_host_nb_acl_pkts_complete , 0x40017a6c ) -PROVIDE ( r_hci_fc_host_nb_sync_pkts_complete , 0x40017a88 ) -PROVIDE ( r_hci_fc_check_host_available_nb_acl_packets , 0x40017aa4 ) -PROVIDE ( r_hci_fc_check_host_available_nb_sync_packets , 0x40017ac8 ) -PROVIDE ( r_hci_look_for_cmd_desc , 0x40018454 ) -PROVIDE ( r_hci_look_for_evt_desc , 0x400184a0 ) -PROVIDE ( r_hci_look_for_dbg_evt_desc , 0x400184c4 ) -PROVIDE ( r_hci_look_for_le_evt_desc , 0x400184e0 ) -PROVIDE ( r_hci_init , 0x40018538 ) -PROVIDE ( r_hci_reset , 0x4001856c ) -PROVIDE ( r_hci_send_2_host , 0x400185bc ) -PROVIDE ( r_hci_bt_acl_bdaddr_register , 0x40018900 ) -PROVIDE ( r_hci_bt_acl_conhdl_register , 0x4001895c ) -PROVIDE ( r_hci_bt_acl_bdaddr_unregister , 0x400189ac ) -PROVIDE ( r_hci_evt_mask_set , 0x400189e4 ) -PROVIDE ( r_hci_evt_filter_add , 0x40018a64 ) -PROVIDE ( r_hci_voice_settings_get , 0x40018bdc ) -PROVIDE ( r_hci_voice_settings_set , 0x40018be8 ) -PROVIDE ( r_hci_tl_send , 0x40019228 ) -PROVIDE ( r_hci_tl_init , 0x40019290 ) -PROVIDE ( r_hci_cmd_get_max_param_size , 0x400192d0 ) -PROVIDE ( r_hci_cmd_received , 0x400192f8 ) -PROVIDE ( r_hci_acl_tx_data_alloc , 0x4001951c ) -PROVIDE ( r_hci_acl_tx_data_received , 0x40019654 ) -PROVIDE ( r_hci_sync_tx_data_alloc , 0x40019754 ) -PROVIDE ( r_hci_sync_tx_data_received , 0x400197c0 ) -PROVIDE ( r_hci_util_pack , 0x40019874 ) -PROVIDE ( r_hci_util_unpack , 0x40019998 ) -PROVIDE ( btdm_r_ip_func_p_get , 0x40019af0 ) -PROVIDE ( btdm_r_ip_func_p_set , 0x40019afc ) -PROVIDE ( btdm_r_ble_bt_handler_tab_p_get , 0x40019b0c ) -PROVIDE ( r_ke_event_init , 0x40019b90 ) -PROVIDE ( r_ke_event_callback_set , 0x40019ba8 ) -PROVIDE ( r_ke_event_set , 0x40019be0 ) -PROVIDE ( r_ke_event_clear , 0x40019c2c ) -PROVIDE ( r_ke_event_get , 0x40019c78 ) -PROVIDE ( r_ke_event_get_all , 0x40019cc0 ) -PROVIDE ( r_ke_event_flush , 0x40019ccc ) -PROVIDE ( r_ke_event_schedule , 0x40019cdc ) -PROVIDE ( r_ke_mem_init , 0x40019d3c ) -PROVIDE ( r_ke_mem_is_empty , 0x40019d8c ) -PROVIDE ( r_ke_check_malloc , 0x40019de0 ) -PROVIDE ( r_ke_malloc , 0x40019eb4 ) -PROVIDE ( r_ke_free , 0x4001a014 ) -PROVIDE ( r_ke_is_free , 0x4001a184 ) -PROVIDE ( r_ke_get_mem_usage , 0x4001a1a0 ) -PROVIDE ( r_ke_get_max_mem_usage , 0x4001a1c8 ) -PROVIDE ( r_ke_msg_alloc , 0x4001a1e0 ) -PROVIDE ( r_ke_msg_send , 0x4001a234 ) -PROVIDE ( r_ke_msg_send_basic , 0x4001a26c ) -PROVIDE ( r_ke_msg_forward , 0x4001a290 ) -PROVIDE ( r_ke_msg_forward_new_id , 0x4001a2ac ) -PROVIDE ( r_ke_msg_free , 0x4001a2cc ) -PROVIDE ( r_ke_msg_dest_id_get , 0x4001a2e0 ) -PROVIDE ( r_ke_msg_src_id_get , 0x4001a2ec ) -PROVIDE ( r_ke_msg_in_queue , 0x4001a2f8 ) -PROVIDE ( r_ke_init , 0x4001a318 ) -PROVIDE ( r_ke_flush , 0x4001a374 ) -PROVIDE ( r_ke_sleep_check , 0x4001a3d8 ) -PROVIDE ( r_ke_stats_get , 0x4001a3f0 ) -PROVIDE ( r_ke_task_init , 0x4001a650 ) -PROVIDE ( r_ke_task_create , 0x4001a674 ) -PROVIDE ( r_ke_task_delete , 0x4001a6c0 ) -PROVIDE ( r_ke_state_set , 0x4001a6fc ) -PROVIDE ( r_ke_state_get , 0x4001a7d8 ) -PROVIDE ( r_ke_msg_discard , 0x4001a850 ) -PROVIDE ( r_ke_msg_save , 0x4001a858 ) -PROVIDE ( r_ke_task_msg_flush , 0x4001a860 ) -PROVIDE ( r_ke_task_check , 0x4001a8a4 ) -PROVIDE ( r_ke_timer_init , 0x4001aa9c ) -PROVIDE ( r_ke_timer_set , 0x4001aac0 ) -PROVIDE ( r_ke_timer_clear , 0x4001ab90 ) -PROVIDE ( r_ke_timer_active , 0x4001ac08 ) -PROVIDE ( r_ke_timer_adjust_all , 0x4001ac30 ) -PROVIDE ( r_ke_timer_sleep_check , 0x4001ac50 ) -PROVIDE ( r_LM_ExtractMaxEncKeySize , 0x4001aca4 ) -PROVIDE ( r_lb_init , 0x4001acd4 ) -PROVIDE ( r_lb_reset , 0x4001ad38 ) -PROVIDE ( r_lb_util_get_nb_broadcast , 0x4001ad80 ) -PROVIDE ( r_lb_util_set_nb_broadcast , 0x4001ad8c ) -PROVIDE ( r_lb_util_get_res_lt_addr , 0x4001ad98 ) -PROVIDE ( r_lb_util_get_csb_mode , 0x4001ada4 ) -PROVIDE ( r_lb_send_lmp , 0x4001adbc ) -PROVIDE ( r_lb_clk_adj_activate , 0x4001ae70 ) -PROVIDE ( r_lb_clk_adj_id_get , 0x4001af14 ) -PROVIDE ( r_lb_clk_adj_period_update , 0x4001af20 ) -PROVIDE ( r_lb_send_pdu_clk_adj , 0x4001af3c ) -PROVIDE ( r_lb_mst_key_cmp , 0x4001af74 ) -PROVIDE ( r_lb_mst_key , 0x4001afc0 ) -PROVIDE ( r_lb_mst_key_restart_enc , 0x4001b0d4 ) -PROVIDE ( r_lb_mst_start_act_bcst_enc , 0x4001b198 ) -PROVIDE ( r_lb_mst_stop_act_bcst_enc , 0x4001b24c ) -PROVIDE ( r_LM_GetMasterKey , 0x4001b260 ) -PROVIDE ( r_LM_GetMasterKeyRand , 0x4001b274 ) -PROVIDE ( r_LM_GetMasterEncRand , 0x4001b288 ) -PROVIDE ( r_LM_GetMasterEncKeySize , 0x4001b29c ) -PROVIDE ( lb_hci_cmd_handler_tab_p_get , 0x4001c18c ) -PROVIDE ( lb_default_state_tab_p_get , 0x4001c198 ) -PROVIDE ( r_lc_send_lmp , 0x4001c1a8 ) -PROVIDE ( r_lc_send_pdu_acc , 0x4001c21c ) -PROVIDE ( r_lc_send_pdu_acc_ext4 , 0x4001c240 ) -PROVIDE ( r_lc_send_pdu_not_acc , 0x4001c26c ) -PROVIDE ( r_lc_send_pdu_not_acc_ext4 , 0x4001c294 ) -PROVIDE ( r_lc_send_pdu_set_afh , 0x4001c2c8 ) -PROVIDE ( r_lc_send_pdu_au_rand , 0x4001c308 ) -PROVIDE ( r_lc_send_pdu_in_rand , 0x4001c338 ) -PROVIDE ( r_lc_send_pdu_comb_key , 0x4001c368 ) -PROVIDE ( r_lc_send_pdu_unit_key , 0x4001c398 ) -PROVIDE ( r_lc_send_pdu_max_slot , 0x4001c3c8 ) -PROVIDE ( r_lc_send_pdu_max_slot_req , 0x4001c3ec ) -PROVIDE ( r_lc_send_pdu_encaps_payl , 0x4001c410 ) -PROVIDE ( r_lc_send_pdu_encaps_head , 0x4001c440 ) -PROVIDE ( r_lc_send_pdu_clk_adj_ack , 0x4001c46c ) -PROVIDE ( r_lc_send_pdu_clk_adj_req , 0x4001c494 ) -PROVIDE ( r_lc_send_pdu_ptt_req , 0x4001c4c0 ) -PROVIDE ( r_lc_send_pdu_sp_nb , 0x4001c4e8 ) -PROVIDE ( r_lc_send_pdu_sp_cfm , 0x4001c518 ) -PROVIDE ( r_lc_send_pdu_sres , 0x4001c548 ) -PROVIDE ( r_lc_send_pdu_sco_lk_rem_req , 0x4001c580 ) -PROVIDE ( r_lc_send_pdu_esco_lk_rem_req , 0x4001c5a8 ) -PROVIDE ( r_lc_send_pdu_auto_rate , 0x4001c5d0 ) -PROVIDE ( r_lc_send_pdu_sniff_req , 0x4001c5f0 ) -PROVIDE ( r_lc_send_pdu_lsto , 0x4001c64c ) -PROVIDE ( r_lc_send_pdu_enc_key_sz_req , 0x4001c670 ) -PROVIDE ( r_lc_send_pdu_feats_res , 0x4001c694 ) -PROVIDE ( r_lc_send_pdu_tim_acc , 0x4001c6cc ) -PROVIDE ( r_lc_send_pdu_feats_ext_req , 0x4001c6ec ) -PROVIDE ( r_lc_send_pdu_io_cap_res , 0x4001c72c ) -PROVIDE ( r_lc_send_pdu_num_comp_fail , 0x4001c770 ) -PROVIDE ( r_lc_send_pdu_pause_enc_aes_req , 0x4001c794 ) -PROVIDE ( r_lc_send_pdu_paus_enc_req , 0x4001c7c0 ) -PROVIDE ( r_lc_send_pdu_resu_enc_req , 0x4001c7e4 ) -PROVIDE ( r_lc_send_pdu_setup_cmp , 0x4001c808 ) -PROVIDE ( r_lc_send_pdu_qos_req , 0x4001c82c ) -PROVIDE ( r_lc_send_pdu_slot_off , 0x4001c854 ) -PROVIDE ( r_lc_send_pdu_unsniff_req , 0x4001c894 ) -PROVIDE ( r_lc_send_pdu_vers_req , 0x4001c8b4 ) -PROVIDE ( r_lc_send_pdu_dhkey_chk , 0x4001c8e8 ) -PROVIDE ( r_lc_cmd_stat_send , 0x4001c914 ) -PROVIDE ( r_lc_init , 0x4001c948 ) -PROVIDE ( r_lc_reset , 0x4001c99c ) -PROVIDE ( r_lc_start , 0x4001ca28 ) -PROVIDE ( r_lc_afh_set , 0x4001cc74 ) -PROVIDE ( r_lc_auth_cmp , 0x4001cd54 ) -PROVIDE ( r_lc_calc_link_key , 0x4001ce7c ) -PROVIDE ( r_lc_chg_pkt_type_cont , 0x4001cfbc ) -PROVIDE ( r_lc_chg_pkt_type_cmp , 0x4001d038 ) -PROVIDE ( r_lc_chg_pkt_type_retry , 0x4001d0ac ) -PROVIDE ( r_lc_afh_start , 0x4001d240 ) -PROVIDE ( r_lc_chk_to , 0x4001d2a8 ) -PROVIDE ( r_lc_comb_key_svr , 0x4001d30c ) -PROVIDE ( r_lc_con_cmp , 0x4001d44c ) -PROVIDE ( r_lc_con_cmp_evt_send , 0x4001d4fc ) -PROVIDE ( r_lc_dhkey , 0x4001d564 ) -PROVIDE ( r_lc_locepr_rsw , 0x4001d5d0 ) -PROVIDE ( r_lc_locepr_lkref , 0x4001d648 ) -PROVIDE ( r_lc_enc_key_refresh , 0x4001d720 ) -PROVIDE ( r_lc_end_chk_colli , 0x4001d858 ) -PROVIDE ( r_lc_enc_cmp , 0x4001d8bc ) -PROVIDE ( r_lc_end_of_sniff_nego , 0x4001d9a4 ) -PROVIDE ( r_lc_epr_cmp , 0x4001da88 ) -PROVIDE ( r_lc_epr_change_lk , 0x4001db38 ) -PROVIDE ( r_lc_rsw_done , 0x4001db94 ) -PROVIDE ( r_lc_rsw_clean_up , 0x4001dc70 ) -PROVIDE ( r_lc_epr_rsw_cmp , 0x4001dd40 ) -PROVIDE ( r_lc_enter_sniff_mode , 0x4001ddb8 ) -PROVIDE ( r_lc_init_calc_f3 , 0x4001deb0 ) -PROVIDE ( r_lc_init_start_mutual_auth , 0x4001df60 ) -PROVIDE ( r_lc_init_passkey_loop , 0x4001dfc0 ) -PROVIDE ( r_lc_initiator_epr , 0x4001e064 ) -PROVIDE ( r_lc_epr_resp , 0x4001e0b4 ) -PROVIDE ( r_lc_key_exch_end , 0x4001e140 ) -PROVIDE ( r_lc_legacy_pair , 0x4001e1c0 ) -PROVIDE ( r_lc_local_switch , 0x4001e22c ) -PROVIDE ( r_lc_local_trans_mode , 0x4001e2e4 ) -PROVIDE ( r_lc_local_untrans_mode , 0x4001e3a0 ) -PROVIDE ( r_lc_max_slot_mgt , 0x4001e410 ) -PROVIDE ( r_lc_mutual_auth_end2 , 0x4001e4f4 ) -PROVIDE ( r_lc_mutual_auth_end , 0x4001e670 ) -PROVIDE ( r_lc_mst_key , 0x4001e7c0 ) -PROVIDE ( r_lc_mst_send_mst_key , 0x4001e8f4 ) -PROVIDE ( r_lc_mst_qos_done , 0x4001ea80 ) -PROVIDE ( r_lc_pairing_cont , 0x4001eafc ) -PROVIDE ( r_lc_passkey_comm , 0x4001ed20 ) -PROVIDE ( r_lc_proc_rcv_dhkey , 0x4001edec ) -PROVIDE ( r_lc_ptt , 0x4001ee2c ) -PROVIDE ( r_lc_ptt_cmp , 0x4001eeec ) -PROVIDE ( r_lc_qos_setup , 0x4001ef50 ) -PROVIDE ( r_lc_rd_rem_name , 0x4001efd0 ) -PROVIDE ( r_lc_restore_afh_reporting , 0x4001f028 ) -PROVIDE ( r_lc_rem_switch , 0x4001f070 ) -PROVIDE ( r_lc_rem_enc , 0x4001f124 ) -PROVIDE ( r_lc_rem_nego_trans_mode , 0x4001f1b4 ) -PROVIDE ( r_lc_rem_name_cont , 0x4001f290 ) -PROVIDE ( r_lc_rem_trans_mode , 0x4001f314 ) -PROVIDE ( r_lc_rem_untrans_mode , 0x4001f36c ) -PROVIDE ( r_lc_sec_auth_compute_sres , 0x4001f3ec ) -PROVIDE ( r_lc_resp_sec_auth , 0x4001f4a0 ) -PROVIDE ( r_lc_resp_auth , 0x4001f518 ) -PROVIDE ( r_lc_resp_oob_wait_nonce , 0x4001f66c ) -PROVIDE ( r_lc_resp_oob_nonce , 0x4001f694 ) -PROVIDE ( r_lc_resp_calc_f3 , 0x4001f710 ) -PROVIDE ( r_lc_resp_wait_dhkey_cont , 0x4001f86c ) -PROVIDE ( r_lc_release , 0x4001f8a8 ) -PROVIDE ( r_lc_restart_enc , 0x4001f8ec ) -PROVIDE ( r_lc_restart_enc_cont , 0x4001f940 ) -PROVIDE ( r_lc_restore_to , 0x4001f9e0 ) -PROVIDE ( r_lc_ret_sniff_max_slot_chg , 0x4001fa30 ) -PROVIDE ( r_lc_start_lmp_to , 0x4001fae8 ) -PROVIDE ( r_lc_start_enc , 0x4001fb28 ) -PROVIDE ( r_lc_start_enc_key_size , 0x4001fd9c ) -PROVIDE ( r_lc_start_key_exch , 0x4001fe10 ) -PROVIDE ( r_lc_start_passkey , 0x4001feac ) -PROVIDE ( r_lc_start_passkey_loop , 0x4001ff88 ) -PROVIDE ( r_lc_start_oob , 0x4001fffc ) -PROVIDE ( r_lc_resp_num_comp , 0x40020074 ) -PROVIDE ( r_lc_stop_enc , 0x40020110 ) -PROVIDE ( r_lc_stop_afh_report , 0x40020184 ) -PROVIDE ( r_lc_skip_hl_oob_req , 0x400201bc ) -PROVIDE ( r_lc_send_enc_mode , 0x40020220 ) -PROVIDE ( r_lc_semi_key_cmp , 0x40020294 ) -PROVIDE ( r_lc_detach , 0x4002037c ) -PROVIDE ( r_lc_switch_cmp , 0x40020448 ) -PROVIDE ( r_lc_sp_fail , 0x40020470 ) -PROVIDE ( r_lc_sp_oob_tid_fail , 0x400204cc ) -PROVIDE ( r_lc_sniff_sub_mode , 0x400204fc ) -PROVIDE ( r_lc_sniff_max_slot_chg , 0x40020590 ) -PROVIDE ( r_lc_upd_to , 0x4002065c ) -PROVIDE ( r_lc_unit_key_svr , 0x400206d8 ) -PROVIDE ( r_lc_unsniff_cont , 0x40020750 ) -PROVIDE ( r_lc_rem_unsniff , 0x400207a0 ) -PROVIDE ( r_lc_unsniff_cmp , 0x40020810 ) -PROVIDE ( r_lc_resp_pair , 0x400208a4 ) -PROVIDE ( r_lc_feat , 0x40020984 ) -PROVIDE ( r_lc_hl_connect , 0x400209e8 ) -PROVIDE ( r_lc_version , 0x40020a30 ) -PROVIDE ( r_lc_loc_sniff , 0x40020a6c ) -PROVIDE ( r_lc_rem_sniff_sub_rate , 0x40020b10 ) -PROVIDE ( r_lc_unsniff , 0x40020c50 ) -PROVIDE ( r_lc_rem_sniff , 0x40020ca4 ) -PROVIDE ( r_lc_ext_feat , 0x40020d6c ) -PROVIDE ( r_lc_pair , 0x40020ddc ) -PROVIDE ( r_lc_loc_auth , 0x40020ecc ) -PROVIDE ( r_lc_packet_type , 0x40021038 ) -PROVIDE ( r_lc_sniff_slot_unchange , 0x40021100 ) -PROVIDE ( r_lc_ssr_nego , 0x4002125c ) -PROVIDE ( r_lc_conn_seq_done , 0x40021334 ) -PROVIDE ( r_lc_send_enc_chg_evt , 0x4002134c ) -PROVIDE ( r_lc_sp_end , 0x400213a8 ) -PROVIDE ( r_lc_prepare_all_links_for_clk_adj , 0x40021430 ) -PROVIDE ( r_lc_sco_init , 0x40021dc8 ) -PROVIDE ( r_lc_sco_reset , 0x40021dfc ) -PROVIDE ( r_lc_sco_detach , 0x40021e40 ) -PROVIDE ( r_lc_sco_release , 0x40021eec ) -PROVIDE ( r_lc_sco_host_request , 0x40021f4c ) -PROVIDE ( r_lc_sco_host_accept , 0x40022118 ) -PROVIDE ( r_lc_sco_host_reject , 0x400222b8 ) -PROVIDE ( r_lc_sco_host_request_disc , 0x4002235c ) -PROVIDE ( r_lc_sco_peer_request , 0x4002240c ) -PROVIDE ( r_lc_sco_peer_accept , 0x40022780 ) -PROVIDE ( r_lc_sco_peer_reject , 0x40022824 ) -PROVIDE ( r_lc_sco_peer_request_disc , 0x400228ec ) -PROVIDE ( r_lc_sco_peer_accept_disc , 0x40022a08 ) -PROVIDE ( r_lc_sco_peer_reject_disc , 0x40022a8c ) -PROVIDE ( r_lc_sco_baseband_ack , 0x40022b00 ) -PROVIDE ( r_lc_sco_timeout , 0x40022bd4 ) -PROVIDE ( r_lc_sniff_init , 0x40022cac ) -PROVIDE ( r_lc_sniff_reset , 0x40022cc8 ) -PROVIDE ( r_LM_AddSniff , 0x40022d20 ) -PROVIDE ( r_LM_RemoveSniff , 0x40023124 ) -PROVIDE ( r_LM_SniffSubratingHlReq , 0x40023154 ) -PROVIDE ( r_LM_SniffSubratingPeerReq , 0x400231dc ) -PROVIDE ( r_LM_GetSniffSubratingParam , 0x4002325c ) -PROVIDE ( r_LM_SniffSubrateNegoRequired , 0x40023334 ) -PROVIDE ( r_LM_ComputeSniffSubRate , 0x400233ac ) -PROVIDE ( r_LM_RemoveSniffSubrating , 0x400233c4 ) -PROVIDE ( r_LM_GetLinkTimeout , 0x400233ec ) -PROVIDE ( lc_hci_cmd_handler_tab_p_get , 0x4002f488 ) -PROVIDE ( lc_default_state_tab_p_get , 0x4002f494 ) -PROVIDE ( r_lc_util_get_max_packet_size , 0x4002f4ac ) -PROVIDE ( r_lc_util_set_loc_trans_coll , 0x4002f500 ) -PROVIDE ( r_lc_util_get_offset_clkn , 0x4002f51c ) -PROVIDE ( r_lc_util_get_offset_clke , 0x4002f538 ) -PROVIDE ( r_LM_ComputePacketType , 0x4002f554 ) -PROVIDE ( r_LM_UpdateAclPacketType , 0x4002f584 ) -PROVIDE ( r_LM_UpdateAclEdrPacketType , 0x4002f5d8 ) -PROVIDE ( r_LM_SuppressAclPacket , 0x4002f658 ) -PROVIDE ( r_LM_MaxSlot , 0x4002f694 ) -PROVIDE ( r_LM_GetQoSParam , 0x4002f6e0 ) -PROVIDE ( r_LM_GetSwitchInstant , 0x4002f7f8 ) -PROVIDE ( r_LM_MakeCof , 0x4002f84c ) -PROVIDE ( r_LM_GetAFHSwitchInstant , 0x4002f86c ) -PROVIDE ( r_LM_CheckSwitchInstant , 0x4002f8c0 ) -PROVIDE ( r_LM_CheckEdrFeatureRequest , 0x4002f90c ) -PROVIDE ( r_LM_GetFeature , 0x4002f924 ) -PROVIDE ( r_lm_look_for_stored_link_key , 0x4002f948 ) -PROVIDE ( r_lc_util_convert_pref_rate_to_packet_type , 0x4002f9b0 ) -PROVIDE ( r_lm_get_common_pkt_types , 0x4002fa1c ) -PROVIDE ( r_ld_acl_init , 0x40034d08 ) -PROVIDE ( r_ld_acl_reset , 0x40034d24 ) -PROVIDE ( r_ld_acl_start , 0x40034ddc ) -PROVIDE ( r_ld_acl_stop , 0x4003532c ) -PROVIDE ( r_ld_acl_flow_off , 0x40035400 ) -PROVIDE ( r_ld_acl_flow_on , 0x4003541c ) -PROVIDE ( r_ld_acl_data_tx , 0x4003544c ) -PROVIDE ( r_ld_acl_data_flush , 0x400357bc ) -PROVIDE ( r_ld_acl_lmp_tx , 0x40035b34 ) -PROVIDE ( r_ld_acl_lmp_flush , 0x40035d80 ) -PROVIDE ( r_ld_acl_rsw_req , 0x40035e74 ) -PROVIDE ( r_ld_acl_flush_timeout_get , 0x40035f9c ) -PROVIDE ( r_ld_acl_flush_timeout_set , 0x40035fe0 ) -PROVIDE ( r_ld_acl_t_poll_get , 0x40036024 ) -PROVIDE ( r_ld_acl_t_poll_set , 0x40036068 ) -PROVIDE ( r_ld_acl_sniff_trans , 0x400360a8 ) -PROVIDE ( r_ld_acl_sniff , 0x4003617c ) -PROVIDE ( r_ld_acl_unsniff , 0x400361e0 ) -PROVIDE ( r_ld_acl_ssr_set , 0x40036274 ) -PROVIDE ( r_ld_acl_tx_enc , 0x400362f8 ) -PROVIDE ( r_ld_acl_rx_enc , 0x40036344 ) -PROVIDE ( r_ld_acl_bcst_rx_dec , 0x40036394 ) -PROVIDE ( r_ld_acl_enc_key_load , 0x40036404 ) -PROVIDE ( r_ld_acl_clock_offset_get , 0x400364c0 ) -PROVIDE ( r_ld_acl_slot_offset_get , 0x4003653c ) -PROVIDE ( r_ld_acl_slot_offset_set , 0x40036658 ) -PROVIDE ( r_ld_acl_lsto_get , 0x400366b4 ) -PROVIDE ( r_ld_acl_lsto_set , 0x400366f8 ) -PROVIDE ( r_ld_acl_timing_accuracy_set , 0x4003673c ) -PROVIDE ( r_ld_acl_edr_set , 0x4003678c ) -PROVIDE ( r_ld_acl_allowed_tx_packet_types_set , 0x40036810 ) -PROVIDE ( r_ld_acl_current_tx_power_get , 0x400368f0 ) -PROVIDE ( r_ld_acl_clk_set , 0x40036950 ) -PROVIDE ( r_ld_acl_clk_adj_set , 0x40036a00 ) -PROVIDE ( r_ld_acl_clk_off_get , 0x40036b00 ) -PROVIDE ( r_ld_acl_bit_off_get , 0x40036b18 ) -PROVIDE ( r_ld_acl_role_get , 0x40036b30 ) -PROVIDE ( r_ld_acl_afh_set , 0x40036b60 ) -PROVIDE ( r_ld_acl_afh_prepare , 0x40036c84 ) -PROVIDE ( r_ld_acl_afh_confirm , 0x40036d40 ) -PROVIDE ( r_ld_acl_active_hop_types_get , 0x40036e10 ) -PROVIDE ( r_ld_acl_rx_max_slot_get , 0x40036e58 ) -PROVIDE ( r_ld_acl_rx_max_slot_set , 0x40036ea0 ) -PROVIDE ( r_ld_acl_test_mode_set , 0x40036f24 ) -PROVIDE ( r_ld_acl_rssi_delta_get , 0x40037028 ) -PROVIDE ( r_ld_sco_start , 0x40037110 ) -PROVIDE ( r_ld_sco_update , 0x40037a74 ) -PROVIDE ( r_ld_sco_stop , 0x40037c40 ) -PROVIDE ( r_ld_sco_audio_isr , 0x40037cc8 ) -PROVIDE ( r_ld_sco_data_tx , 0x40037ee8 ) -PROVIDE ( r_ld_bcst_acl_start , 0x4003882c ) -PROVIDE ( r_ld_bcst_acl_init , 0x40038bd0 ) -PROVIDE ( r_ld_bcst_acl_reset , 0x40038bdc ) -PROVIDE ( r_ld_bcst_lmp_tx , 0x40038bf8 ) -PROVIDE ( r_ld_bcst_acl_data_tx , 0x40038d3c ) -PROVIDE ( r_ld_bcst_afh_update , 0x40038f3c ) -PROVIDE ( r_ld_bcst_tx_enc , 0x40038ff8 ) -PROVIDE ( r_ld_bcst_enc_key_load , 0x4003906c ) -PROVIDE ( r_ld_csb_rx_init , 0x40039690 ) -PROVIDE ( r_ld_csb_rx_reset , 0x4003969c ) -PROVIDE ( r_ld_csb_rx_start , 0x4003972c ) -PROVIDE ( r_ld_csb_rx_afh_update , 0x40039af4 ) -PROVIDE ( r_ld_csb_rx_stop , 0x40039bb8 ) -PROVIDE ( r_ld_csb_tx_init , 0x4003a0e8 ) -PROVIDE ( r_ld_csb_tx_reset , 0x4003a0f8 ) -PROVIDE ( r_ld_csb_tx_en , 0x4003a1c0 ) -PROVIDE ( r_ld_csb_tx_dis , 0x4003a5e8 ) -PROVIDE ( r_ld_csb_tx_afh_update , 0x4003a5fc ) -PROVIDE ( r_ld_csb_tx_set_data , 0x4003a6c0 ) -PROVIDE ( r_ld_csb_tx_clr_data , 0x4003a71c ) -PROVIDE ( r_ld_fm_init , 0x4003a760 ) -PROVIDE ( r_ld_fm_reset , 0x4003a794 ) -PROVIDE ( r_ld_fm_clk_isr , 0x4003a7a8 ) -PROVIDE ( r_ld_fm_rx_isr , 0x4003a7f4 ) -PROVIDE ( r_ld_fm_frame_isr , 0x4003a82c ) -PROVIDE ( r_ld_fm_sket_isr , 0x4003a8a4 ) -PROVIDE ( r_ld_fm_prog_enable , 0x4003a944 ) -PROVIDE ( r_ld_fm_prog_disable , 0x4003a984 ) -PROVIDE ( r_ld_fm_prog_push , 0x4003a9d4 ) -PROVIDE ( r_ld_fm_prog_check , 0x4003ab28 ) -PROVIDE ( r_ld_inq_init , 0x4003b15c ) -PROVIDE ( r_ld_inq_reset , 0x4003b168 ) -PROVIDE ( r_ld_inq_start , 0x4003b1f0 ) -PROVIDE ( r_ld_inq_stop , 0x4003b4f0 ) -PROVIDE ( r_ld_iscan_init , 0x4003b9f0 ) -PROVIDE ( r_ld_iscan_reset , 0x4003ba14 ) -PROVIDE ( r_ld_iscan_restart , 0x4003ba44 ) -PROVIDE ( r_ld_iscan_start , 0x4003bb28 ) -PROVIDE ( r_ld_iscan_stop , 0x4003bf1c ) -PROVIDE ( r_ld_iscan_eir_set , 0x4003bfa0 ) -PROVIDE ( r_ld_iscan_eir_get , 0x4003c118 ) -PROVIDE ( r_ld_iscan_tx_pwr_get , 0x4003c138 ) -PROVIDE ( r_ld_channel_assess , 0x4003c184 ) -PROVIDE ( r_ld_init , 0x4003c294 ) -PROVIDE ( r_ld_reset , 0x4003c714 ) -PROVIDE ( r_ld_read_clock , 0x4003c9e4 ) -PROVIDE ( r_ld_bd_addr_get , 0x4003ca20 ) -PROVIDE ( r_ld_class_of_dev_get , 0x4003ca34 ) -PROVIDE ( r_ld_class_of_dev_set , 0x4003ca50 ) -PROVIDE ( r_ld_version_get , 0x4003ca6c ) -PROVIDE ( r_ld_timing_accuracy_get , 0x4003caac ) -PROVIDE ( r_ld_active_check , 0x4003cac4 ) -PROVIDE ( r_ld_afh_ch_assess_data_get , 0x4003caec ) -PROVIDE ( r_ld_wlcoex_set , 0x4003caf8 ) -PROVIDE ( r_ld_page_init , 0x4003d808 ) -PROVIDE ( r_ld_page_reset , 0x4003d814 ) -PROVIDE ( r_ld_page_start , 0x4003d848 ) -PROVIDE ( r_ld_page_stop , 0x4003da54 ) -PROVIDE ( r_ld_pca_init , 0x4003deb4 ) -PROVIDE ( r_ld_pca_reset , 0x4003df0c ) -PROVIDE ( r_ld_pca_local_config , 0x4003df6c ) -PROVIDE ( r_ld_pca_reporting_enable , 0x4003e018 ) -PROVIDE ( r_ld_pca_update_target_offset , 0x4003e050 ) -PROVIDE ( r_ld_pca_mws_frame_sync , 0x4003e104 ) -PROVIDE ( r_ld_pca_mws_moment_offset_gt , 0x4003e278 ) -PROVIDE ( r_ld_pca_mws_moment_offset_lt , 0x4003e280 ) -PROVIDE ( r_ld_pca_coarse_clock_adjust , 0x4003e324 ) -PROVIDE ( r_ld_pca_initiate_clock_dragging , 0x4003e4ac ) -PROVIDE ( r_ld_pscan_evt_handler , 0x4003f238 ) -PROVIDE ( r_ld_pscan_init , 0x4003f474 ) -PROVIDE ( r_ld_pscan_reset , 0x4003f498 ) -PROVIDE ( r_ld_pscan_restart , 0x4003f4b8 ) -PROVIDE ( r_ld_pscan_start , 0x4003f514 ) -PROVIDE ( r_ld_pscan_stop , 0x4003f618 ) -PROVIDE ( r_ld_sched_compute , 0x4003f6f8 ) -PROVIDE ( r_ld_sched_init , 0x4003f7ac ) -PROVIDE ( r_ld_sched_reset , 0x4003f7d4 ) -PROVIDE ( r_ld_sched_iscan_add , 0x4003f7e8 ) -PROVIDE ( r_ld_sched_iscan_remove , 0x4003f808 ) -PROVIDE ( r_ld_sched_pscan_add , 0x4003f828 ) -PROVIDE ( r_ld_sched_pscan_remove , 0x4003f848 ) -PROVIDE ( r_ld_sched_sscan_add , 0x4003f868 ) -PROVIDE ( r_ld_sched_sscan_remove , 0x4003f888 ) -PROVIDE ( r_ld_sched_inq_add , 0x4003f8a8 ) -PROVIDE ( r_ld_sched_inq_remove , 0x4003f8d0 ) -PROVIDE ( r_ld_sched_page_add , 0x4003f910 ) -PROVIDE ( r_ld_sched_page_remove , 0x4003f938 ) -PROVIDE ( r_ld_sched_acl_add , 0x4003f978 ) -PROVIDE ( r_ld_sched_acl_remove , 0x4003f99c ) -PROVIDE ( r_ld_sched_sniff_add , 0x4003f9c4 ) -PROVIDE ( r_ld_sched_sniff_remove , 0x4003fa0c ) -PROVIDE ( r_ld_sched_sco_add , 0x4003fa4c ) -PROVIDE ( r_ld_sched_sco_remove , 0x4003fa9c ) -PROVIDE ( r_ld_sscan_init , 0x400402f0 ) -PROVIDE ( r_ld_sscan_reset , 0x400402fc ) -PROVIDE ( r_ld_sscan_activated , 0x4004031c ) -PROVIDE ( r_ld_sscan_start , 0x40040384 ) -PROVIDE ( r_ld_strain_init , 0x400409f4 ) -PROVIDE ( r_ld_strain_reset , 0x40040a00 ) -PROVIDE ( r_ld_strain_start , 0x40040a8c ) -PROVIDE ( r_ld_strain_stop , 0x40040df0 ) -PROVIDE ( r_ld_util_fhs_unpk , 0x40040e54 ) -PROVIDE ( r_ld_util_bch_create , 0x40040fcc ) -PROVIDE ( r_ld_util_fhs_pk , 0x400411c8 ) -PROVIDE ( r_ld_util_active_master_afh_map_set , 0x40041308 ) -PROVIDE ( r_ld_util_active_master_afh_map_get , 0x4004131c ) -PROVIDE ( r_ld_util_stp_unpk , 0x40041324 ) -PROVIDE ( r_ld_util_stp_pk , 0x400413f4 ) -PROVIDE ( r_llc_ch_assess_local , 0x40041494 ) -PROVIDE ( r_llc_ch_assess_get_local_ch_map , 0x4004150c ) -PROVIDE ( r_llc_ch_assess_get_current_ch_map , 0x40041574 ) -PROVIDE ( r_llc_ch_assess_merge_ch , 0x40041588 ) -PROVIDE ( r_llc_ch_assess_reass_ch , 0x400415c0 ) -PROVIDE ( llc_hci_cmd_handler_tab_p_get , 0x40042358 ) -PROVIDE ( llc_hci_command_handler , 0x40042360 ) -PROVIDE ( llc_hci_acl_data_tx_handler , 0x40042398 ) -PROVIDE ( llcp_pdu_handler_tab_p_get , 0x40043f64 ) -PROVIDE ( r_llc_llcp_version_ind_pdu_send , 0x40043f6c ) -PROVIDE ( r_llc_llcp_ch_map_update_pdu_send , 0x40043f94 ) -PROVIDE ( r_llc_llcp_pause_enc_req_pdu_send , 0x40043fd8 ) -PROVIDE ( r_llc_llcp_pause_enc_rsp_pdu_send , 0x40044010 ) -PROVIDE ( r_llc_llcp_enc_req_pdu_send , 0x40044064 ) -PROVIDE ( r_llc_llcp_enc_rsp_pdu_send , 0x40044160 ) -PROVIDE ( r_llc_llcp_start_enc_rsp_pdu_send , 0x400441f8 ) -PROVIDE ( r_llc_llcp_reject_ind_pdu_send , 0x4004425c ) -PROVIDE ( r_llc_llcp_con_update_pdu_send , 0x400442c4 ) -PROVIDE ( r_llc_llcp_con_param_req_pdu_send , 0x400442fc ) -PROVIDE ( r_llc_llcp_con_param_rsp_pdu_send , 0x40044358 ) -PROVIDE ( r_llc_llcp_feats_req_pdu_send , 0x400443b4 ) -PROVIDE ( r_llc_llcp_feats_rsp_pdu_send , 0x400443f0 ) -PROVIDE ( r_llc_llcp_start_enc_req_pdu_send , 0x4004441c ) -PROVIDE ( r_llc_llcp_terminate_ind_pdu_send , 0x400444b0 ) -PROVIDE ( r_llc_llcp_unknown_rsp_send_pdu , 0x40044534 ) -PROVIDE ( r_llc_llcp_ping_req_pdu_send , 0x4004454c ) -PROVIDE ( r_llc_llcp_ping_rsp_pdu_send , 0x40044560 ) -PROVIDE ( r_llc_llcp_length_req_pdu_send , 0x40044574 ) -PROVIDE ( r_llc_llcp_length_rsp_pdu_send , 0x400445ac ) -PROVIDE ( r_llc_llcp_tester_send , 0x400445e4 ) -PROVIDE ( r_llc_llcp_recv_handler , 0x40044678 ) -PROVIDE ( r_llc_llcp_get_autorize , 0x4004475c ) -PROVIDE ( r_llc_init , 0x40044778 ) -PROVIDE ( r_llc_reset , 0x400447b8 ) -PROVIDE ( r_llc_start , 0x400447f4 ) -PROVIDE ( r_llc_stop , 0x400449ac ) -PROVIDE ( r_llc_discon_event_complete_send , 0x40044a30 ) -PROVIDE ( r_llc_le_con_cmp_evt_send , 0x40044a78 ) -PROVIDE ( r_llc_con_update_complete_send , 0x40044d68 ) -PROVIDE ( r_llc_ltk_req_send , 0x40044dc0 ) -PROVIDE ( r_llc_feats_rd_event_send , 0x40044e0c ) -PROVIDE ( r_llc_version_rd_event_send , 0x40044e60 ) -PROVIDE ( r_llc_common_cmd_complete_send , 0x40044eac ) -PROVIDE ( r_llc_common_cmd_status_send , 0x40044ee0 ) -PROVIDE ( r_llc_common_flush_occurred_send , 0x40044f0c ) -PROVIDE ( r_llc_common_enc_key_ref_comp_evt_send , 0x40044f38 ) -PROVIDE ( r_llc_common_enc_change_evt_send , 0x40044f6c ) -PROVIDE ( r_llc_common_nb_of_pkt_comp_evt_send , 0x40045000 ) -PROVIDE ( r_llc_con_update_ind , 0x40045038 ) -PROVIDE ( r_llc_lsto_con_update , 0x40045098 ) -PROVIDE ( r_llc_map_update_ind , 0x400450f0 ) -PROVIDE ( r_llc_con_update_finished , 0x4004518c ) -PROVIDE ( r_llc_map_update_finished , 0x40045260 ) -PROVIDE ( llc_default_state_tab_p_get , 0x40046058 ) -PROVIDE ( r_llc_util_get_free_conhdl , 0x400460c8 ) -PROVIDE ( r_llc_util_get_nb_active_link , 0x40046100 ) -PROVIDE ( r_llc_util_dicon_procedure , 0x40046130 ) -PROVIDE ( r_llc_util_update_channel_map , 0x400461ac ) -PROVIDE ( r_llc_util_set_llcp_discard_enable , 0x400461c8 ) -PROVIDE ( r_llc_util_set_auth_payl_to_margin , 0x400461f4 ) -PROVIDE ( r_llc_util_clear_operation_ptr , 0x40046234 ) -PROVIDE ( r_llc_util_bw_mgt , 0x4004629c ) -PROVIDE ( r_llc_end_evt_defer , 0x40046330 ) -PROVIDE ( r_llc_pdu_llcp_tx_ack_defer , 0x400463ac ) -PROVIDE ( r_llc_pdu_acl_tx_ack_defer , 0x400464dc ) -PROVIDE ( r_llc_pdu_defer , 0x40046528 ) -PROVIDE ( r_lld_evt_delete_elt_handler , 0x40046974 ) -PROVIDE ( r_lld_evt_delete_elt_push , 0x40046a3c ) -PROVIDE ( r_lld_evt_channel_next , 0x40046aac ) -PROVIDE ( r_lld_evt_init , 0x40046b3c ) -PROVIDE ( r_lld_evt_init_evt , 0x40046cd0 ) -PROVIDE ( r_lld_evt_restart , 0x40046d50 ) -PROVIDE ( r_lld_evt_elt_insert , 0x400474c8 ) -PROVIDE ( r_lld_evt_elt_delete , 0x40047538 ) -PROVIDE ( r_lld_evt_drift_compute , 0x40047670 ) -PROVIDE ( r_lld_evt_schedule_next_instant , 0x400476a8 ) -PROVIDE ( r_lld_evt_schedule_next , 0x400477dc ) -PROVIDE ( r_lld_evt_schedule , 0x40047908 ) -PROVIDE ( r_lld_evt_prevent_stop , 0x40047adc ) -PROVIDE ( r_lld_evt_scan_create , 0x40047ae8 ) -PROVIDE ( r_lld_evt_move_to_master , 0x40047ba0 ) -PROVIDE ( r_lld_evt_update_create , 0x40047cd8 ) -PROVIDE ( r_lld_evt_move_to_slave , 0x40047e18 ) -PROVIDE ( r_lld_evt_slave_update , 0x40048138 ) -PROVIDE ( r_lld_evt_adv_create , 0x400481f4 ) -PROVIDE ( r_lld_evt_deffered_elt_handler , 0x400482bc ) -PROVIDE ( r_lld_evt_end , 0x400483e8 ) -PROVIDE ( r_lld_evt_rx , 0x40048578 ) -PROVIDE ( r_lld_evt_canceled , 0x400485c8 ) -PROVIDE ( r_lld_evt_end_isr , 0x4004862c ) -PROVIDE ( r_lld_evt_rx_isr , 0x40048678 ) -PROVIDE ( r_lld_init , 0x4004873c ) -PROVIDE ( r_lld_core_reset , 0x40048a9c ) -PROVIDE ( r_lld_adv_start , 0x40048b38 ) -PROVIDE ( r_lld_adv_stop , 0x40048ea0 ) -PROVIDE ( r_lld_scan_start , 0x40048ee0 ) -PROVIDE ( r_lld_scan_stop , 0x40049190 ) -PROVIDE ( r_lld_con_start , 0x400491f8 ) -PROVIDE ( r_lld_move_to_master , 0x400499e0 ) -PROVIDE ( r_lld_con_update_req , 0x40049b60 ) -PROVIDE ( r_lld_con_update_after_param_req , 0x40049bcc ) -PROVIDE ( r_lld_con_param_rsp , 0x40049e00 ) -PROVIDE ( r_lld_con_param_req , 0x40049f0c ) -PROVIDE ( r_lld_con_stop , 0x40049fdc ) -PROVIDE ( r_lld_get_mode , 0x40049ff8 ) -PROVIDE ( r_lld_move_to_slave , 0x4004a024 ) -PROVIDE ( r_lld_ch_map_ind , 0x4004a2f4 ) -PROVIDE ( r_lld_con_update_ind , 0x4004a30c ) -PROVIDE ( r_lld_crypt_isr , 0x4004a324 ) -PROVIDE ( r_lld_test_mode_tx , 0x4004a350 ) -PROVIDE ( r_lld_test_mode_rx , 0x4004a540 ) -PROVIDE ( r_lld_test_stop , 0x4004a710 ) -PROVIDE ( r_lld_ral_renew_req , 0x4004a73c ) -PROVIDE ( r_lld_pdu_check , 0x4004ac34 ) -PROVIDE ( r_lld_pdu_tx_loop , 0x4004ae40 ) -PROVIDE ( r_lld_pdu_data_tx_push , 0x4004aecc ) -PROVIDE ( r_lld_pdu_data_send , 0x4004b018 ) -PROVIDE ( r_lld_pdu_tx_push , 0x4004b080 ) -PROVIDE ( r_lld_pdu_tx_prog , 0x4004b120 ) -PROVIDE ( r_lld_pdu_tx_flush , 0x4004b414 ) -PROVIDE ( r_lld_pdu_adv_pack , 0x4004b488 ) -PROVIDE ( r_lld_pdu_rx_handler , 0x4004b4d4 ) -PROVIDE ( r_lld_pdu_send_packet , 0x4004b774 ) -PROVIDE ( r_lld_util_instant_get , 0x4004b890 ) -PROVIDE ( r_lld_util_get_bd_address , 0x4004b8ac ) -PROVIDE ( r_lld_util_set_bd_address , 0x4004b8f8 ) -PROVIDE ( r_lld_util_ral_force_rpa_renew , 0x4004b980 ) -PROVIDE ( r_lld_util_freq2chnl , 0x4004b9e4 ) -PROVIDE ( r_lld_util_get_local_offset , 0x4004ba10 ) -PROVIDE ( r_lld_util_get_peer_offset , 0x4004ba24 ) -PROVIDE ( r_lld_util_connection_param_set , 0x4004ba40 ) -PROVIDE ( r_lld_util_dle_set_cs_fields , 0x4004ba90 ) -PROVIDE ( r_lld_util_anchor_point_move , 0x4004bacc ) -PROVIDE ( r_lld_util_flush_list , 0x4004bbd8 ) -PROVIDE ( r_lld_util_instant_ongoing , 0x4004bbfc ) -PROVIDE ( r_lld_util_compute_ce_max , 0x4004bc0c ) -PROVIDE ( r_lld_util_elt_programmed , 0x4004bce0 ) -PROVIDE ( r_lld_util_priority_set , 0x4004bd10 ) -PROVIDE ( r_lld_util_priority_update , 0x4004bd78 ) -PROVIDE ( r_lld_util_get_tx_pkt_cnt , 0x4004bd80 ) -PROVIDE ( r_lld_util_eff_tx_time_set , 0x4004bd88 ) -PROVIDE ( r_lld_wlcoex_set , 0x4004bd98 ) -PROVIDE ( llm_hci_cmd_handler_tab_p_get , 0x4004c920 ) -PROVIDE ( hci_command_handler , 0x4004c928 ) -PROVIDE ( r_llm_init , 0x4004c9f8 ) -PROVIDE ( r_llm_ble_ready , 0x4004cc34 ) -PROVIDE ( r_llm_con_req_ind , 0x4004cc54 ) -PROVIDE ( r_llm_le_adv_report_ind , 0x4004cdf4 ) -PROVIDE ( r_llm_con_req_tx_cfm , 0x4004d158 ) -PROVIDE ( r_llm_common_cmd_complete_send , 0x4004d288 ) -PROVIDE ( r_llm_common_cmd_status_send , 0x4004d2b4 ) -PROVIDE ( r_llm_test_mode_start_tx , 0x4004d2fc ) -PROVIDE ( r_llm_test_mode_start_rx , 0x4004d534 ) -PROVIDE ( r_llm_set_adv_param , 0x4004d5f4 ) -PROVIDE ( r_llm_set_adv_en , 0x4004d7ec ) -PROVIDE ( r_llm_set_adv_data , 0x4004d960 ) -PROVIDE ( r_llm_set_scan_rsp_data , 0x4004da14 ) -PROVIDE ( r_llm_set_scan_param , 0x4004dac8 ) -PROVIDE ( r_llm_set_scan_en , 0x4004db64 ) -PROVIDE ( r_llm_wl_clr , 0x4004dc54 ) -PROVIDE ( r_llm_wl_dev_add , 0x4004dcc0 ) -PROVIDE ( r_llm_wl_dev_rem , 0x4004dcfc ) -PROVIDE ( r_llm_wl_dev_add_hdl , 0x4004dd38 ) -PROVIDE ( r_llm_wl_dev_rem_hdl , 0x4004dde0 ) -PROVIDE ( r_llm_create_con , 0x4004de78 ) -PROVIDE ( r_llm_encryption_done , 0x4004dff8 ) -PROVIDE ( r_llm_encryption_start , 0x4004e128 ) -PROVIDE ( r_llm_ral_clear , 0x4004e1fc ) -PROVIDE ( r_llm_ral_dev_add , 0x4004e23c ) -PROVIDE ( r_llm_ral_dev_rm , 0x4004e3bc ) -PROVIDE ( r_llm_ral_get_rpa , 0x4004e400 ) -PROVIDE ( r_llm_ral_set_timeout , 0x4004e4a0 ) -PROVIDE ( r_llm_ral_update , 0x4004e4f8 ) -PROVIDE ( llm_default_state_tab_p_get , 0x4004e718 ) -PROVIDE ( r_llm_util_bd_addr_wl_position , 0x4004e720 ) -PROVIDE ( r_llm_util_bd_addr_in_wl , 0x4004e788 ) -PROVIDE ( r_llm_util_check_address_validity , 0x4004e7e4 ) -PROVIDE ( r_llm_util_check_map_validity , 0x4004e800 ) -PROVIDE ( r_llm_util_apply_bd_addr , 0x4004e868 ) -PROVIDE ( r_llm_util_set_public_addr , 0x4004e89c ) -PROVIDE ( r_llm_util_check_evt_mask , 0x4004e8b0 ) -PROVIDE ( r_llm_util_get_channel_map , 0x4004e8d4 ) -PROVIDE ( r_llm_util_get_supp_features , 0x4004e8e8 ) -PROVIDE ( r_llm_util_adv_data_update , 0x4004e8fc ) -PROVIDE ( r_llm_util_bl_check , 0x4004e930 ) -PROVIDE ( r_llm_util_bl_add , 0x4004e9ac ) -PROVIDE ( r_llm_util_bl_rem , 0x4004ea70 ) -PROVIDE ( r_llm_util_bd_addr_in_ral , 0x4004eb08 ) -PROVIDE ( r_llm_end_evt_defer , 0x4004eb6c ) -PROVIDE ( r_llm_pdu_defer , 0x4004ec48 ) -PROVIDE ( r_lm_init , 0x4004ed34 ) -PROVIDE ( r_lm_lt_addr_alloc , 0x4004ef1c ) -PROVIDE ( r_lm_lt_addr_reserve , 0x4004ef48 ) -PROVIDE ( r_lm_lt_addr_free , 0x4004ef74 ) -PROVIDE ( r_lm_get_nb_acl , 0x4004ef9c ) -PROVIDE ( r_lm_role_switch_start , 0x4004efe0 ) -PROVIDE ( r_lm_role_switch_finished , 0x4004f028 ) -PROVIDE ( r_lm_read_features , 0x4004f0d8 ) -PROVIDE ( r_lm_acl_disc , 0x4004f148 ) -PROVIDE ( r_lm_get_auth_en , 0x4004f1ac ) -PROVIDE ( r_lm_get_sp_en , 0x4004f1c0 ) -PROVIDE ( r_lm_get_sec_con_host_supp , 0x4004f1d4 ) -PROVIDE ( r_LM_GetPINType , 0x4004f1e8 ) -PROVIDE ( r_LM_GetConnectionAcceptTimeout , 0x4004f1f4 ) -PROVIDE ( r_LM_GetLocalNameSeg , 0x4004f200 ) -PROVIDE ( r_lm_get_loopback_mode , 0x4004f248 ) -PROVIDE ( r_lm_get_pub_key_192 , 0x4004f258 ) -PROVIDE ( r_lm_get_priv_key_192 , 0x4004f278 ) -PROVIDE ( r_lm_get_pub_key_256 , 0x4004f298 ) -PROVIDE ( r_lm_get_priv_key_256 , 0x4004f2b8 ) -PROVIDE ( r_lm_get_oob_local_data_192 , 0x4004f2d4 ) -PROVIDE ( r_lm_get_oob_local_data_256 , 0x4004f318 ) -PROVIDE ( r_lm_get_oob_local_commit , 0x4004f374 ) -PROVIDE ( r_lm_sp_debug_mode_get , 0x4004f398 ) -PROVIDE ( r_lm_debug_key_compare_192 , 0x4004f3a8 ) -PROVIDE ( r_lm_debug_key_compare_256 , 0x4004f3d0 ) -PROVIDE ( r_lm_dut_mode_en_get , 0x4004f3ec ) -PROVIDE ( r_lm_afh_ch_ass_en_get , 0x4004f3f8 ) -PROVIDE ( r_lm_sync_flow_ctrl_en_get , 0x4004f404 ) -PROVIDE ( r_lm_afh_host_ch_class_get , 0x4004f410 ) -PROVIDE ( r_lm_afh_peer_ch_class_set , 0x4004f418 ) -PROVIDE ( r_lm_afh_master_ch_map_get , 0x4004f43c ) -PROVIDE ( r_lm_afh_activate_timer , 0x4004f444 ) -PROVIDE ( r_lm_is_acl_con , 0x4004f47c ) -PROVIDE ( r_lm_is_acl_con_role , 0x4004f49c ) -PROVIDE ( r_lm_is_clk_adj_instant_pending , 0x4004f4c8 ) -PROVIDE ( r_lm_clk_adj_instant_pending_set , 0x4004f4d8 ) -PROVIDE ( r_lm_is_clk_adj_ack_pending , 0x4004f4e8 ) -PROVIDE ( r_lm_num_clk_adj_ack_pending_set , 0x4004f500 ) -PROVIDE ( r_lm_clk_adj_ack_pending_clear , 0x4004f514 ) -PROVIDE ( r_lm_local_ext_fr_configured , 0x4004f540 ) -PROVIDE ( r_lm_pca_sscan_link_set , 0x4004f550 ) -PROVIDE ( r_lm_pca_sscan_link_get , 0x4004f560 ) -PROVIDE ( r_lm_get_sync_param , 0x400503b4 ) -PROVIDE ( r_lm_init_sync , 0x400512d8 ) -PROVIDE ( r_lm_reset_sync , 0x40051304 ) -PROVIDE ( r_lm_check_active_sync , 0x40051334 ) -PROVIDE ( r_lm_add_sync , 0x40051358 ) -PROVIDE ( r_lm_modif_sync , 0x40051578 ) -PROVIDE ( r_lm_check_sync_hl_rsp , 0x4005169c ) -PROVIDE ( r_lm_get_synchdl , 0x4005175c ) -PROVIDE ( r_lm_look_for_sync , 0x40051774 ) -PROVIDE ( r_lm_get_nb_sync_link , 0x4005179c ) -PROVIDE ( r_lm_get_min_sync_intv , 0x400517a8 ) -PROVIDE ( r_lm_remove_sync , 0x400517c8 ) -PROVIDE ( r_lm_sco_nego_end , 0x40051828 ) -PROVIDE ( r_lm_master_clk_adj_req_handler , 0x40054180 ) -PROVIDE ( lm_hci_cmd_handler_tab_p_get , 0x4005425c ) -PROVIDE ( lm_default_state_tab_p_get , 0x40054268 ) -PROVIDE ( btdm_r_modules_func_p_set , 0x40054270 ) -PROVIDE ( btdm_r_modules_func_p_get , 0x4005427c ) -PROVIDE ( btdm_r_plf_func_p_set , 0x40054288 ) -PROVIDE ( btdm_r_import_rf_phy_func_p_get , 0x40054298 ) -PROVIDE ( r_nvds_init , 0x40054410 ) -PROVIDE ( r_nvds_get , 0x40054488 ) -PROVIDE ( r_nvds_del , 0x400544c4 ) -PROVIDE ( r_nvds_lock , 0x400544fc ) -PROVIDE ( r_nvds_put , 0x40054534 ) -PROVIDE ( r_rf_rw_bt_init , 0x40054868 ) -PROVIDE ( r_rf_rw_le_init , 0x400549d0 ) -PROVIDE ( r_rf_rw_init , 0x40054b0c ) -PROVIDE ( r_rwble_init , 0x40054bf4 ) -PROVIDE ( r_rwble_reset , 0x40054ce8 ) -PROVIDE ( r_rwble_sleep_check , 0x40054d78 ) -PROVIDE ( r_rwble_activity_ongoing_check , 0x40054d8c ) -PROVIDE ( r_rwble_version , 0x40054dac ) -PROVIDE ( r_rwble_isr , 0x40054e08 ) -PROVIDE ( r_rwbt_init , 0x40055160 ) -PROVIDE ( r_rwbt_reset , 0x400551bc ) -PROVIDE ( r_rwbt_version , 0x4005520c ) -PROVIDE ( r_rwbt_isr , 0x40055248 ) -PROVIDE ( r_rwbt_sleep_check , 0x4005577c ) -PROVIDE ( r_rwbt_sleep_enter , 0x400557a4 ) -PROVIDE ( r_rwbt_sleep_wakeup , 0x400557fc ) -PROVIDE ( r_rwbt_sleep_wakeup_end , 0x400558cc ) -PROVIDE ( rwip_rf_p_get , 0x400558f4 ) -PROVIDE ( r_rwip_check_wakeup_boundary , 0x400558fc ) -PROVIDE ( r_rwip_init , 0x4005595c ) -PROVIDE ( r_rwip_reset , 0x40055ab8 ) -PROVIDE ( r_rwip_version , 0x40055b20 ) -PROVIDE ( r_rwip_schedule , 0x40055b38 ) -PROVIDE ( r_rwip_sleep , 0x40055b5c ) -PROVIDE ( r_rwip_wakeup , 0x40055dc4 ) -PROVIDE ( r_rwip_wakeup_end , 0x40055e18 ) -PROVIDE ( r_rwip_wakeup_delay_set , 0x40055e4c ) -PROVIDE ( r_rwip_prevent_sleep_set , 0x40055e64 ) -PROVIDE ( r_rwip_prevent_sleep_clear , 0x40055ec8 ) -PROVIDE ( r_rwip_sleep_enable , 0x40055f30 ) -PROVIDE ( r_rwip_ext_wakeup_enable , 0x40055f3c ) -PROVIDE ( r_rwip_pca_clock_dragging_only , 0x40055f48 ) -PROVIDE ( r_rwip_wlcoex_set , 0x40055f60 ) -PROVIDE ( r_rwip_assert_err , 0x40055f88 ) -PROVIDE ( r_ke_queue_extract , 0x40055fd0 ) -PROVIDE ( r_ke_queue_insert , 0x40056020 ) -PROVIDE ( __utoa , 0x400561f0 ) -PROVIDE ( utoa , 0x40056258 ) -PROVIDE ( setjmp , 0x40056268 ) -PROVIDE ( longjmp , 0x400562cc ) -PROVIDE ( abs , 0x40056340 ) -PROVIDE ( div , 0x40056348 ) -PROVIDE ( labs , 0x40056370 ) -PROVIDE ( ldiv , 0x40056378 ) -PROVIDE ( qsort , 0x40056424 ) -PROVIDE ( __itoa , 0x40056678 ) -PROVIDE ( itoa , 0x400566b4 ) -PROVIDE ( atoi , 0x400566c4 ) -PROVIDE ( _atoi_r , 0x400566d4 ) -PROVIDE ( atol , 0x400566ec ) -PROVIDE ( _atol_r , 0x400566fc ) -PROVIDE ( _strtol_r , 0x40056714 ) -PROVIDE ( strtol , 0x4005681c ) -PROVIDE ( _strtoul_r , 0x40056834 ) -PROVIDE ( strtoul , 0x4005692c ) -PROVIDE ( _iprintf_r , 0x40056944 ) -PROVIDE ( _printf_r , 0x40056944 ) -PROVIDE ( iprintf , 0x40056978 ) -PROVIDE ( printf , 0x40056978 ) -PROVIDE ( viprintf , 0x400569b4 ) -PROVIDE ( vprintf , 0x400569b4 ) -PROVIDE ( _viprintf_r , 0x400569e4 ) -PROVIDE ( _vprintf_r , 0x400569e4 ) -PROVIDE ( _vsniprintf_r , 0x40056a14 ) -PROVIDE ( _vsnprintf_r , 0x40056a14 ) -PROVIDE ( vsniprintf , 0x40056a68 ) -PROVIDE ( vsnprintf , 0x40056a68 ) -PROVIDE ( _vsiprintf_r , 0x40056a90 ) -PROVIDE ( _vsprintf_r , 0x40056a90 ) -PROVIDE ( vsiprintf , 0x40056ac4 ) -PROVIDE ( vsprintf , 0x40056ac4 ) -PROVIDE ( _sniprintf_r , 0x40056ae4 ) -PROVIDE ( _snprintf_r , 0x40056ae4 ) -PROVIDE ( sniprintf , 0x40056b4c ) -PROVIDE ( snprintf , 0x40056b4c ) -PROVIDE ( _siprintf_r , 0x40056bbc ) -PROVIDE ( _sprintf_r , 0x40056bbc ) -PROVIDE ( siprintf , 0x40056c08 ) -PROVIDE ( sprintf , 0x40056c08 ) -PROVIDE ( _asniprintf_r , 0x40056c64 ) -PROVIDE ( _asnprintf_r , 0x40056c64 ) -PROVIDE ( asniprintf , 0x40056cd8 ) -PROVIDE ( asnprintf , 0x40056cd8 ) -PROVIDE ( _asiprintf_r , 0x40056d4c ) -PROVIDE ( _asprintf_r , 0x40056d4c ) -PROVIDE ( asiprintf , 0x40056d9c ) -PROVIDE ( asprintf , 0x40056d9c ) -PROVIDE ( _vasniprintf_r , 0x40056df8 ) -PROVIDE ( _vasnprintf_r , 0x40056df8 ) -PROVIDE ( vasniprintf , 0x40056e58 ) -PROVIDE ( vasnprintf , 0x40056e58 ) -PROVIDE ( _vasiprintf_r , 0x40056e80 ) -PROVIDE ( _vasprintf_r , 0x40056e80 ) -PROVIDE ( vasiprintf , 0x40056eb8 ) -PROVIDE ( vasprintf , 0x40056eb8 ) -PROVIDE ( _fiprintf_r , 0x40056ed8 ) -PROVIDE ( _fprintf_r , 0x40056ed8 ) -PROVIDE ( fiprintf , 0x40056efc ) -PROVIDE ( fprintf , 0x40056efc ) -PROVIDE ( __ssputs_r , 0x40056f2c ) -PROVIDE ( __ssprint_r , 0x40056ff8 ) -PROVIDE ( _svfiprintf_r , 0x40057100 ) -PROVIDE ( _svfprintf_r , 0x40057100 ) -PROVIDE ( _printf_common , 0x40057338 ) -PROVIDE ( _printf_i , 0x40057404 ) -PROVIDE ( __sfputs_r , 0x40057790 ) -PROVIDE ( __sprint_r , 0x400577e4 ) -PROVIDE ( _vfiprintf_r , 0x40057850 ) -PROVIDE ( _vfprintf_r , 0x40057850 ) -PROVIDE ( vfiprintf , 0x40057ae8 ) -PROVIDE ( vfprintf , 0x40057ae8 ) -PROVIDE ( __svfiscanf_r , 0x40057b08 ) -PROVIDE ( __svfscanf_r , 0x40057b08 ) -PROVIDE ( vfiscanf , 0x40057eb8 ) -PROVIDE ( vfscanf , 0x40057eb8 ) -PROVIDE ( __svfscanf , 0x40057f04 ) -PROVIDE ( _vfiscanf_r , 0x40057f24 ) -PROVIDE ( _vfscanf_r , 0x40057f24 ) -PROVIDE ( _sungetc_r , 0x40057f6c ) -PROVIDE ( __ssrefill_r , 0x40057fec ) -PROVIDE ( __ssvfiscanf_r , 0x4005802c ) -PROVIDE ( __ssvfscanf_r , 0x4005802c ) -PROVIDE ( _scanf_chars , 0x40058384 ) -PROVIDE ( _scanf_i , 0x4005845c ) -PROVIDE ( viscanf , 0x40058698 ) -PROVIDE ( vscanf , 0x40058698 ) -PROVIDE ( _viscanf_r , 0x400586c8 ) -PROVIDE ( _vscanf_r , 0x400586c8 ) -PROVIDE ( _vsiscanf_r , 0x400586f8 ) -PROVIDE ( _vsscanf_r , 0x400586f8 ) -PROVIDE ( vsiscanf , 0x40058740 ) -PROVIDE ( vsscanf , 0x40058740 ) -PROVIDE ( iscanf , 0x40058760 ) -PROVIDE ( scanf , 0x40058760 ) -PROVIDE ( _iscanf_r , 0x4005879c ) -PROVIDE ( _scanf_r , 0x4005879c ) -PROVIDE ( siscanf , 0x400587d0 ) -PROVIDE ( sscanf , 0x400587d0 ) -PROVIDE ( _siscanf_r , 0x40058830 ) -PROVIDE ( _sscanf_r , 0x40058830 ) -PROVIDE ( fiscanf , 0x40058884 ) -PROVIDE ( fscanf , 0x40058884 ) -PROVIDE ( _fiscanf_r , 0x400588b4 ) -PROVIDE ( _fscanf_r , 0x400588b4 ) -PROVIDE ( _wcrtomb_r , 0x400588d8 ) -PROVIDE ( wcrtomb , 0x40058920 ) -PROVIDE ( __sfvwrite_r , 0x4005893c ) -PROVIDE ( __swbuf_r , 0x40058bec ) -PROVIDE ( __swbuf , 0x40058cb4 ) -PROVIDE ( __swsetup_r , 0x40058cc8 ) -PROVIDE ( __fputwc , 0x40058da0 ) -PROVIDE ( _fputwc_r , 0x40058e4c ) -PROVIDE ( fputwc , 0x40058ea8 ) -PROVIDE ( __ascii_wctomb , 0x40058ef0 ) -PROVIDE ( _wctomb_r , 0x40058f14 ) -PROVIDE ( __submore , 0x40058f3c ) -PROVIDE ( _ungetc_r , 0x40058fa0 ) -PROVIDE ( ungetc , 0x400590f4 ) -PROVIDE ( __smakebuf_r , 0x40059108 ) -PROVIDE ( __sflush_r , 0x400591e0 ) -PROVIDE ( _fflush_r , 0x40059320 ) -PROVIDE ( fflush , 0x40059394 ) -PROVIDE ( __srefill_r , 0x400593d4 ) -PROVIDE ( _setlocale_r , 0x4005950c ) -PROVIDE ( __locale_charset , 0x40059540 ) -PROVIDE ( __locale_mb_cur_max , 0x40059548 ) -PROVIDE ( __locale_msgcharset , 0x40059550 ) -PROVIDE ( __locale_cjk_lang , 0x40059558 ) -PROVIDE ( _localeconv_r , 0x40059560 ) -PROVIDE ( setlocale , 0x40059568 ) -PROVIDE ( localeconv , 0x4005957c ) -PROVIDE ( asctime , 0x40059588 ) -PROVIDE ( ctime , 0x400595b0 ) -PROVIDE ( ctime_r , 0x400595c4 ) -PROVIDE ( localtime , 0x400595dc ) -PROVIDE ( localtime_r , 0x400595fc ) -PROVIDE ( gmtime , 0x40059848 ) -PROVIDE ( gmtime_r , 0x40059868 ) -PROVIDE ( strftime , 0x40059ab4 ) -PROVIDE ( mktime , 0x4005a5e8 ) -PROVIDE ( start_tb_console , 0x4005a980 ) -PROVIDE ( ets_sha_enable , 0x4005c07c ) -PROVIDE ( ets_sha_disable , 0x4005c0a8 ) -PROVIDE ( ets_sha_init , 0x4005c0d4 ) -PROVIDE ( ets_sha_finish , 0x4005c104 ) -PROVIDE ( ets_sha_update , 0x4005c2a0 ) -PROVIDE ( ets_bigint_enable , 0x4005c498 ) -PROVIDE ( ets_bigint_disable , 0x4005c4e0 ) -PROVIDE ( ets_bigint_wait_finish , 0x4005c520 ) -PROVIDE ( ets_bigint_mod_power_prepare , 0x4005c54c ) -PROVIDE ( ets_bigint_mod_power_getz , 0x4005c614 ) -PROVIDE ( ets_bigint_mult_prepare , 0x4005c630 ) -PROVIDE ( ets_bigint_mult_getz , 0x4005c6e8 ) -PROVIDE ( ets_bigint_montgomery_mult_prepare , 0x4005c6fc ) -PROVIDE ( ets_bigint_montgomery_mult_getz , 0x4005c7a4 ) -PROVIDE ( ets_bigint_mod_mult_prepare , 0x4005c7b4 ) -PROVIDE ( ets_bigint_mod_mult_getz , 0x4005c818 ) -PROVIDE ( ets_aes_enable , 0x4005c8cc ) -PROVIDE ( ets_aes_disable , 0x4005c8f8 ) -PROVIDE ( ets_aes_set_endian , 0x4005c928 ) -PROVIDE ( ets_aes_setkey_enc , 0x4005c97c ) -PROVIDE ( ets_aes_setkey_dec , 0x4005c994 ) -PROVIDE ( ets_aes_crypt , 0x4005c9b8 ) -PROVIDE ( ets_secure_boot_start , 0x4005ca34 ) -PROVIDE ( ets_secure_boot_finish , 0x4005ca84 ) -PROVIDE ( ets_secure_boot_hash , 0x4005cad4 ) -PROVIDE ( ets_secure_boot_obtain , 0x4005cb14 ) -PROVIDE ( ets_secure_boot_check , 0x4005cb40 ) -PROVIDE ( ets_secure_boot_rd_iv , 0x4005cb84 ) -PROVIDE ( ets_secure_boot_rd_abstract , 0x4005cba8 ) -PROVIDE ( ets_secure_boot_check_start , 0x4005cbcc ) -PROVIDE ( ets_secure_boot_check_finish , 0x4005cc04 ) -PROVIDE ( aes_128_cbc_encrypt , 0x4005cc18 ) -PROVIDE ( aes_128_cbc_decrypt , 0x4005cc7c ) -PROVIDE ( aes_unwrap , 0x4005ccf0 ) -PROVIDE ( base64_encode , 0x4005cdbc ) -PROVIDE ( base64_decode , 0x4005ced8 ) -PROVIDE ( crc32_le , 0x4005cfec ) -PROVIDE ( crc32_be , 0x4005d024 ) -PROVIDE ( crc16_le , 0x4005d05c ) -PROVIDE ( crc16_be , 0x4005d09c ) -PROVIDE ( crc8_le , 0x4005d0e0 ) -PROVIDE ( crc8_be , 0x4005d114 ) -PROVIDE ( esp_crc8 , 0x4005d144 ) -PROVIDE ( hmac_md5_vector , 0x4005d17c ) -PROVIDE ( hmac_md5 , 0x4005d264 ) -PROVIDE ( MD5Init , 0x4005da7c ) -PROVIDE ( MD5Update , 0x4005da9c ) -PROVIDE ( MD5Final , 0x4005db1c ) -PROVIDE ( md5_vector , 0x4005db80 ) -PROVIDE ( mz_adler32 , 0x4005edbc ) -PROVIDE ( mz_crc32 , 0x4005ee88 ) -PROVIDE ( mz_free , 0x4005eed4 ) -PROVIDE ( tinfl_decompress , 0x4005ef30 ) -PROVIDE ( tinfl_decompress_mem_to_mem , 0x40060050 ) -PROVIDE ( tinfl_decompress_mem_to_callback , 0x40060090 ) -PROVIDE ( tdefl_compress , 0x400600bc ) -PROVIDE ( tdefl_compress_buffer , 0x400607f4 ) -PROVIDE ( tdefl_init , 0x40060810 ) -PROVIDE ( tdefl_get_prev_return_status , 0x400608d0 ) -PROVIDE ( tdefl_get_adler32 , 0x400608d8 ) -PROVIDE ( tdefl_compress_mem_to_output , 0x400608e0 ) -PROVIDE ( tdefl_compress_mem_to_mem , 0x40060900 ) -PROVIDE ( tdefl_write_image_to_png_file_in_memory_ex , 0x40060910 ) -PROVIDE ( tdefl_write_image_to_png_file_in_memory , 0x4006091c ) -PROVIDE ( rc4_skip , 0x40060928 ) -PROVIDE ( hmac_sha1_vector , 0x400609e4 ) -PROVIDE ( hmac_sha1 , 0x40060acc ) -PROVIDE ( sha1_prf , 0x40060ae8 ) -PROVIDE ( sha1_vector , 0x40060b64 ) -PROVIDE ( pbkdf2_sha1 , 0x40060ba4 ) -PROVIDE ( hmac_sha256_vector , 0x40060c84 ) -PROVIDE ( hmac_sha256 , 0x40060d58 ) -PROVIDE ( sha256_prf , 0x40060d70 ) -PROVIDE ( sha256_vector , 0x40060e08 ) -PROVIDE ( jd_prepare , 0x40060fa8 ) -PROVIDE ( jd_decomp , 0x400613e8 ) -PROVIDE ( spi_dummy_len_fix , 0x40061d90 ) -PROVIDE ( SelectSpiQIO , 0x40061ddc ) -PROVIDE ( SetSpiDrvs , 0x40061e78 ) -PROVIDE ( SelectSpiFunction , 0x40061f84 ) -PROVIDE ( SPI_user_command_read , 0x400621b0 ) -PROVIDE ( SPI_read_status , 0x4006226c ) -PROVIDE ( SPI_write_status , 0x400622f0 ) -PROVIDE ( SPI_write_enable , 0x40062320 ) -PROVIDE ( SPI_read_status_high , 0x40062448 ) -PROVIDE ( SPI_Common_Command , 0x4006246c ) -PROVIDE ( spi_cache_sram_init , 0x400626e4 ) -PROVIDE ( SPIUnlockXXX , 0x400628b0 ) -PROVIDE ( SPILock , 0x400628f0 ) -PROVIDE ( SPIReadModeCnfig , 0x40062944 ) -PROVIDE ( spi_flash_attach , 0x40062a6c ) -PROVIDE ( SPIMasterReadModeCnfig , 0x40062b64 ) -PROVIDE ( SPIClkConfig , 0x40062bc8 ) -PROVIDE ( SPIEraseChip , 0x40062c14 ) -PROVIDE ( SPIEraseBlock , 0x40062c4c ) -PROVIDE ( SPIEraseSector , 0x40062ccc ) -PROVIDE ( SPIWrite , 0x40062d50 ) -PROVIDE ( SPI_Write_Encrypt_Enable , 0x40062df4 ) -PROVIDE ( SPI_Prepare_Encrypt_Data , 0x40062e1c ) -PROVIDE ( SPI_Write_Encrypt_Disable , 0x40062e60 ) -PROVIDE ( SPI_Encrypt_Write , 0x40062e78 ) -PROVIDE ( SPIRead , 0x40062ed8 ) -PROVIDE ( SPIEraseArea , 0x400631ac ) -PROVIDE ( SPIParamCfg , 0x40063238 ) -PROVIDE ( __mulsf3 , 0x400632c8 ) -PROVIDE ( __eqsf2 , 0x40063374 ) -PROVIDE ( __nesf2 , 0x40063374 ) -PROVIDE ( __gtsf2 , 0x400633a0 ) -PROVIDE ( __lesf2 , 0x400633c0 ) -PROVIDE ( __gesf2 , 0x4006340c ) -PROVIDE ( __ltsf2 , 0x4006342c ) -PROVIDE ( __unordsf2 , 0x40063478 ) -PROVIDE ( __negdf2 , 0x400634a0 ) -PROVIDE ( __muldf3 , 0x4006358c ) -PROVIDE ( __eqdf2 , 0x400636a8 ) -PROVIDE ( __nedf2 , 0x400636a8 ) -PROVIDE ( __gtdf2 , 0x400636dc ) -PROVIDE ( __ledf2 , 0x40063704 ) -PROVIDE ( __gedf2 , 0x40063768 ) -PROVIDE ( __ltdf2 , 0x40063790 ) -PROVIDE ( __unorddf2 , 0x400637f4 ) -PROVIDE ( __cmpdi2 , 0x40063820 ) -PROVIDE ( __ucmpdi2 , 0x40063840 ) -PROVIDE ( __clear_cache , 0x40063860 ) -PROVIDE ( __absvsi2 , 0x40063868 ) -PROVIDE ( __absvdi2 , 0x4006387c ) -PROVIDE ( __powisf2 , 0x4006389c ) -PROVIDE ( __powidf2 , 0x400638d4 ) -PROVIDE ( __mulsc3 , 0x40063934 ) -PROVIDE ( __muldc3 , 0x40063bf4 ) -PROVIDE ( __divsc3 , 0x40064200 ) -PROVIDE ( __divdc3 , 0x40064460 ) -PROVIDE ( __bswapsi2 , 0x4006499c ) -PROVIDE ( __bswapdi2 , 0x400649c4 ) -PROVIDE ( __clrsbsi2 , 0x40064a20 ) -PROVIDE ( __clrsbdi2 , 0x40064a38 ) -PROVIDE ( __gcc_bcmp , 0x40064a70 ) -PROVIDE ( __udiv_w_sdiv , 0x40064aa8 ) -PROVIDE ( __udivmoddi4 , 0x40064ab0 ) diff --git a/src/common/platforms/esp32/stubs/Makefile b/src/common/platforms/esp32/stubs/Makefile deleted file mode 100644 index 857512afee54dab0fc5cc6462d19f5f58ae42cad..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (c) 2015 Cesanta Software Limited -# All rights reserved -# - -STUB = stub_hello.c -LIBS = -PARAMS = -PORT = /dev/ttyUSB0 - -BUILD_DIR = .build -COMMON_STUB_DIR = ../../esp -STUB_ELF = $(BUILD_DIR)/$(patsubst %.c,%.elf,$(notdir $(STUB))) -STUB_JSON ?= $(BUILD_DIR)/$(patsubst %.c,%.json,$(notdir $(STUB))) -SDK = $(shell cat ../../../../fw/platforms/esp32/sdk.version) -XT_CC = xtensa-esp32-elf-gcc - -.PHONY: all clean run wrap - -all: $(STUB_ELF) - -$(STUB_ELF): $(STUB) $(LIBS) - @echo " CC $^ -> $@" - @[ -d $(BUILD_DIR) ] || mkdir $(BUILD_DIR) - @docker run --rm -i -v $(CURDIR)/../../../..:/src $(SDK) //bin/bash -c \ - "cd /src/common/platforms/esp32/stubs && \ - $(XT_CC) -std=c99 -Wall -Werror -Os -DESP32 \ - -mtext-section-literals -mlongcalls -nostdlib -fno-builtin \ - -I. -I/src/common/platforms/esp \ - -I/opt/Espressif/esp-idf/components/esp32/include \ - -I/opt/Espressif/esp-idf/components/soc/esp32/include \ - -L/opt/Espressif/esp-idf -Wl,-static \ - -ffunction-sections -Wl,--gc-sections \ - -Tstub.ld -o $@ $^" - -wrap: $(STUB_JSON) - -$(STUB_JSON): $(STUB_ELF) $(COMMON_STUB_DIR)/esptool.py - @echo " WRAP $< -> $@" - @docker run --rm -i -v $(CURDIR)/../../../..:/src $(SDK) //bin/bash -c \ - "cd /src/common/platforms/esp32/stubs && \ - $(COMMON_STUB_DIR)/esptool.py wrap_stub $<" > $@ - -run: $(STUB_JSON) - @echo " RUN $< $(PARAMS) -> $(PORT)" - @docker run --rm -i --privileged -v $(CURDIR)/../../../..:/src $(SDK) //bin/bash -c \ - "cd /src/common/platforms/esp32/stubs && \ - $(COMMON_STUB_DIR)/esptool.py --port $(PORT) run_stub $< $(PARAMS)" - -clean: - @rm -rf $(BUILD_DIR) diff --git a/src/common/platforms/esp32/stubs/README.md b/src/common/platforms/esp32/stubs/README.md deleted file mode 100644 index 9265771237e7537965cf257836492bf9a49952c0..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/README.md +++ /dev/null @@ -1,13 +0,0 @@ -This is a ESP boot loader stub development environment. - -Code produced in this environment can be loaded and executed -in the bootloader environment. Usually it is used to implement -functionality not found in the bootloader. - -Stubs can be executed using the `run_stub` command of the modified esptool.py provided. -`wrap_stub` produces a JSON represenattion of the stub that can later be reused -or built into other tools. - -Example usage: - $ make run STUB=stub_flash_size.c PORT=/dev/ttyUSB0 - $ make run STUB=stub_md5.c PORT=/dev/ttyUSB0 PARAMS="0x11000 10000 1" diff --git a/src/common/platforms/esp32/stubs/led.c b/src/common/platforms/esp32/stubs/led.c deleted file mode 100644 index dfa692107348eb52c10b5b2bab699eaf845c87fe..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/led.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "soc/gpio_reg.h" - -void led_setup(int io) { - if (io < 32) { - WRITE_PERI_REG(GPIO_ENABLE_W1TS_REG, 1 << io); - } else { - WRITE_PERI_REG(GPIO_ENABLE1_W1TS_REG, 1 << (io - 32)); - } -} - -void led_on(int io) { - if (io < 32) { - WRITE_PERI_REG(GPIO_OUT_W1TS_REG, 1 << io); - } else { - WRITE_PERI_REG(GPIO_OUT1_W1TS_REG, 1 << (io - 32)); - } -} - -void led_off(int io) { - if (io < 32) { - WRITE_PERI_REG(GPIO_OUT_W1TC_REG, 1 << io); - } else { - WRITE_PERI_REG(GPIO_OUT1_W1TC_REG, 1 << (io - 32)); - } -} - -void led_toggle(int io) { - if (READ_PERI_REG(GPIO_OUT_REG & (1 << io))) { - WRITE_PERI_REG(GPIO_OUT_W1TC_REG, 1 << io); - } else { - WRITE_PERI_REG(GPIO_OUT_W1TS_REG, 1 << io); - } -} diff --git a/src/common/platforms/esp32/stubs/led.h b/src/common/platforms/esp32/stubs/led.h deleted file mode 100644 index e79733d9283d3de66441d42273fccd8ac3693e07..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/led.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -void led_setup(int io); -void led_on(int io); -void led_off(int io); -void led_toggle(int io); diff --git a/src/common/platforms/esp32/stubs/rom_functions.h b/src/common/platforms/esp32/stubs/rom_functions.h deleted file mode 100644 index 1b2eee4d67164a46999ba558c61a46a5f4e0e413..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/rom_functions.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef CS_COMMON_PLATFORMS_ESP32_STUBS_ROM_FUNCTIONS_H_ -#define CS_COMMON_PLATFORMS_ESP32_STUBS_ROM_FUNCTIONS_H_ - -#include "rom/ets_sys.h" -#include "rom/spi_flash.h" -#include "rom/md5_hash.h" -#include "rom/uart.h" -#include "rom/rtc.h" - -#endif /* CS_COMMON_PLATFORMS_ESP32_STUBS_ROM_FUNCTIONS_H_ */ diff --git a/src/common/platforms/esp32/stubs/sdkconfig.h b/src/common/platforms/esp32/stubs/sdkconfig.h deleted file mode 100644 index 0ecac13179eaeb77215e7e2b67c051cbf396b3d3..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/sdkconfig.h +++ /dev/null @@ -1 +0,0 @@ -#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 diff --git a/src/common/platforms/esp32/stubs/stub.ld b/src/common/platforms/esp32/stubs/stub.ld deleted file mode 100644 index 84085bb36ffe802588f03da3e978bab1cf00f5ea..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/stub.ld +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2016 Cesanta Software Limited - * All rights reserved - */ - -MEMORY { - iram : org = 0x40090000, len = 0x10000 - /* DRAM startin at 0x3FFC0000 gets stomped by something before mem_finish - * and is thus not suitable for initialized data, but works fine for BSS. */ - dram_bss : org = 0x3FFC0000, len = 0x10000 - dram : org = 0x3FFD0000, len = 0x10000 -} - -ENTRY(stub_main) - -SECTIONS { - .params 0x40090000 : { - _params_start = ABSOLUTE(.); - *(.params) - _params_end = ABSOLUTE(.); - } > iram - - .text : ALIGN(4) { - _code_start = ABSOLUTE(.); - *(.literal) - *(.text .text.*) - } > iram - - .bss : ALIGN(4) { - _bss_start = ABSOLUTE(.); - *(.bss) - _bss_end = ABSOLUTE(.); - } > dram - - .data : ALIGN(4) { - _data_start = ABSOLUTE(.); - *(.data) - *(.rodata .rodata.*) - } > dram -} - -INCLUDE "components/esp32/ld/esp32.rom.ld" -INCLUDE "components/esp32/ld/esp32.rom.spiram_incompatible_fns.ld" - -PROVIDE(ets_isr_mask = 0x400067fc); -PROVIDE(ets_isr_unmask = 0x40006808); -PROVIDE(MD5Init = 0x4005da7c); -PROVIDE(MD5Update = 0x4005da9c); -PROVIDE(MD5Final = 0x4005db1c); -PROVIDE(esp_rom_spiflash_attach = 0x40062a6c); -PROVIDE(esp_rom_spiflash_config_clk = 0x40062bc8); diff --git a/src/common/platforms/esp32/stubs/stub_hello.c b/src/common/platforms/esp32/stubs/stub_hello.c deleted file mode 100644 index 3f64a406001b6938baaf2aa30b9cbc1ad07aa2ee..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/stub_hello.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <inttypes.h> -#include <string.h> -#include "slip.h" - -/* Define the args vector and put it into the ".params" section. */ -uint32_t params[3] __attribute__((section(".params"))); - -/* Define a function called stub_main. Do not return or reboot. - * Use send_packet to communicate to the host. */ - -const char *hello = "Hello"; - -static char buf[1024]; -extern uint32_t _bss_start, _bss_end; - -void stub_main(void) { - uint32_t greeting = 0x4941484f; - SLIP_send(&greeting, 4); - memset(&_bss_start, 0, (&_bss_end - &_bss_start)); - buf[1] = 123; - SLIP_send(hello, 5); - while (1) { - } -} diff --git a/src/common/platforms/esp32/stubs/uart.c b/src/common/platforms/esp32/stubs/uart.c deleted file mode 100644 index d6d1faad038c5a276fd56aea647db19e1cb21b36..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/uart.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "uart.h" - -#include "rom_functions.h" - -uint32_t set_baud_rate(uint32_t uart_no, uint32_t old_baud_rate, - uint32_t new_baud_rate) { - uint32_t uart_reg = REG_READ(UART_CLKDIV_REG(uart_no)); - uint32_t uart_div = uart_reg & UART_CLKDIV_M; - uint32_t fraction = (uart_reg >> UART_CLKDIV_FRAG_S) & UART_CLKDIV_FRAG_V; - uart_div = (uart_div << 4) + fraction; - uint32_t master_freq = uart_div * old_baud_rate; - uart_div_modify(uart_no, master_freq / new_baud_rate); - return uart_div; -} diff --git a/src/common/platforms/esp32/stubs/uart.h b/src/common/platforms/esp32/stubs/uart.h deleted file mode 100644 index 99e351ac1315a3d7099ae891241b35fa77d2f45c..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp32/stubs/uart.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CS_COMMON_PLATFORMS_ESP32_STUBS_UART_H_ -#define CS_COMMON_PLATFORMS_ESP32_STUBS_UART_H_ - -#include <stdint.h> - -uint32_t set_baud_rate(uint32_t uart_no, uint32_t old_baud_rate, - uint32_t new_baud_rate); - -#endif /* CS_COMMON_PLATFORMS_ESP32_STUBS_UART_H_ */ diff --git a/src/common/platforms/esp8266/common.mk b/src/common/platforms/esp8266/common.mk deleted file mode 100644 index 8ce894eda96d7120bca4dec9ccd05a396ff73b52..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/common.mk +++ /dev/null @@ -1,77 +0,0 @@ -CFLAGS_EXTRA ?= - -XTENSA_TOOLS_ROOT ?= /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin -SDK_PATH ?= /opt/Espressif/ESP8266_SDK -ESPTOOL ?= esptool.py -ESPPORT ?= /dev/ttyACM0 -ESPSPEED ?= 230400 -# For flash = > 16Mbit -ESPFLASHARGS = --flash_mode dio --flash_size 32m - -VERBOSE ?= 0 - -CC := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc -CXX := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-g++ -AR := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-ar -LD := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc -OBJCOPY := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-objcopy -NM := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-nm -CC_WRAPPER ?= - -define link -$(vecho) "LD $@" -$(Q) $(CC_WRAPPER) $(LD) $(LIBDIRS) -T$(LD_SCRIPT) $(LDFLAGS) -o $@ \ --Wl,-Map=$@.map -Wl,--start-group $1 -Wl,--end-group -endef - -define compile_params -$(vecho) "$5 $1" -$(Q) $(CC_WRAPPER) $3 -MD -MP $(INCDIRS) $4 -c $1 -o $2 -endef - -define compile -$(call compile_params,$<,$@, $(CC), $(CFLAGS),"CC") -endef - -define compile_cxx -$(call compile_params,$<,$@, $(CXX), $(CXXFLAGS),"CXX") -endef - -# some of these flags works around for gdb 7.5.x stacktrace issue -# while still allowing -Os to remove padding between data in .rodata -# section, allowing us to gain about 1k of ram. -# text section is 4k bigger, but we care more about ram at the moment. -# TODO(mkm): figure out which flag(s). -NO_Os_FLAGS= -fno-expensive-optimizations -fno-thread-jumps \ - -fno-align-functions -fno-align-jumps \ - -fno-align-loops -fno-align-labels -fno-caller-saves \ - -fno-crossjumping -fno-cse-follow-jumps -fno-cse-skip-blocks \ - -fno-delete-null-pointer-checks -fno-devirtualize \ - -fno-gcse -fno-gcse-lm -fno-hoist-adjacent-loads \ - -fno-inline-small-functions -fno-indirect-inlining -fno-partial-inlining \ - -fno-ipa-cp -fno-ipa-sra -fno-peephole2 -fno-optimize-sibling-calls -fno-optimize-strlen \ - -fno-reorder-blocks -fno-reorder-blocks-and-partition -fno-reorder-functions \ - -fno-sched-interblock -fno-sched-spec -fno-rerun-cse-after-loop \ - -fno-schedule-insns -fno-schedule-insns2 -fno-strict-aliasing -fno-strict-overflow \ - -fno-tree-builtin-call-dce -fno-tree-switch-conversion -fno-tree-tail-merge \ - -fno-tree-pre -fno-tree-vrp - -C_CXX_FLAGS = -W -Wall -Werror -Wundef -Wno-comment -Wno-variadic-macros -Wpointer-arith \ - -Wno-missing-field-initializers \ - -pipe -Os $(NO_Os_FLAGS) -g3 \ - -Wl,-EL -fno-inline-functions \ - -D_XOPEN_SOURCE=500 \ - -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DSTATIC=static \ - -Wno-parentheses \ - -DIRAM='__attribute__((section(".fast.text")))' \ - -DICACHE_RAM_ATTR=IRAM \ - -DNOINSTR='__attribute__((no_instrument_function))' \ - -DCS_PLATFORM=3 \ - -ffunction-sections -fdata-sections - -CFLAGS = -std=gnu99 $(C_CXX_FLAGS) -CXXFLAGS = -std=gnu++11 -fno-exceptions $(C_CXX_FLAGS) - -# linker flags used to generate the main object file -LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start \ - -Wl,-static -Wl,--gc-sections diff --git a/src/common/platforms/esp8266/esp_crypto.c b/src/common/platforms/esp8266/esp_crypto.c deleted file mode 100644 index ab8e97e2a618376a0d1638a8b9dd9eceef1d288f..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/esp_crypto.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <stdbool.h> -#include <stdint.h> -#include <stdlib.h> - -#include "mongoose.h" - -#ifdef RTOS_SDK -#include "esp_libc.h" -#else -#include "osapi.h" -#endif - -extern int sha1_vector(size_t num_msgs, const uint8_t *msgs[], - const size_t *msg_lens, uint8_t *digest); - -extern int md5_vector(size_t num_msgs, const uint8_t *msgs[], - const size_t *msg_lens, uint8_t *digest); - -/* For digest auth. */ -void mg_hash_md5_v(size_t num_msgs, const uint8_t *msgs[], - const size_t *msg_lens, uint8_t *digest) { - (void) md5_vector(num_msgs, msgs, msg_lens, digest); -} - -/* For WebSocket handshake. */ -void mg_hash_sha1_v(size_t num_msgs, const uint8_t *msgs[], - const size_t *msg_lens, uint8_t *digest) { - (void) sha1_vector(num_msgs, msgs, msg_lens, digest); -} diff --git a/src/common/platforms/esp8266/esp_hw_wdt_register.h b/src/common/platforms/esp8266/esp_hw_wdt_register.h deleted file mode 100644 index 681d31acb194dabe35541483390bda00d1eec2b3..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/esp_hw_wdt_register.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CS_COMMON_PLATFORMS_ESP8266_ESP_HW_WDT_REGISTER_H_ -#define CS_COMMON_PLATFORMS_ESP8266_ESP_HW_WDT_REGISTER_H_ - -#ifdef RTOS_SDK -#include <esp_common.h> -#else -#include <user_interface.h> -#endif - -#define REG_WDT_BASE 0x60000900 - -#define WDT_CTL (REG_WDT_BASE + 0x0) -#define WDT_CTL_ENABLE (BIT(0)) -#define WDT_CTL_STAGE1_NO_RESET (BIT(1)) -#define WDT_CTL_STAGE1_DISABLE (BIT(2)) -#define WDT_CTL_UNK3 (BIT(3)) -#define WDT_CTL_UNK4 (BIT(4)) -#define WDT_CTL_UNK5 (BIT(5)) - -/* Bits 3, 4, 5 - ???; set to 1 by ROM. */ - -#define WDT_RELOAD_STAGE0 (REG_WDT_BASE + 0x4) -#define WDT_RELOAD_STAGE0_V (0xf) -#define WDT_RELOAD_STAGE0_S (0) - -#define WDT_RELOAD_STAGE1 (REG_WDT_BASE + 0x8) -#define WDT_RELOAD_STAGE1_V (0xf) -#define WDT_RELOAD_STAGE1_S (0) - -#define WDT_COUNT (REG_WDT_BASE + 0xc) /* Counts at CPU_CLK (80 MHz) */ -#define WDT_COUNT_V (0xffffffff) -#define WDT_COUNT_S (0) - -#define WDT_STAGE (REG_WDT_BASE + 0x10) -#define WDT_STAGE_V (1) -#define WDT_STAGE_S (0) - -#define WDT_RESET (REG_WDT_BASE + 0x14) -#define WDT_RESET_V (0xff) -#define WDT_RESET_S (0) - -#define WDT_RESET_STAGE (REG_WDT_BASE + 0x18) -#define WDT_RESET_STAGE_V (0xff) -#define WDT_RESET_STAGE_S (0) - -#define WDT_RESET_VALUE 0x73 - -#endif /* CS_COMMON_PLATFORMS_ESP8266_ESP_HW_WDT_REGISTER_H_ */ diff --git a/src/common/platforms/esp8266/esp_missing_includes.h b/src/common/platforms/esp8266/esp_missing_includes.h deleted file mode 100644 index e6ef8e7cce7757db833ef30e944eb70d934f7b7a..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/esp_missing_includes.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CS_COMMON_PLATFORMS_ESP8266_ESP_MISSING_INCLUDES_H_ -#define CS_COMMON_PLATFORMS_ESP8266_ESP_MISSING_INCLUDES_H_ - -#include <stdint.h> -#include <stdlib.h> - -void pp_soft_wdt_init(void); -void pp_soft_wdt_stop(void); -void pp_soft_wdt_feed(void); -void pp_soft_wdt_restart(void); -void system_soft_wdt_stop(void); /* Alias for pp_soft_wdt_stop */ - -void Cache_Read_Disable(void); -void Cache_Read_Enable(uint32_t, uint32_t, uint32_t); -void Cache_Read_Disable_2(void); -void Cache_Read_Enable_2(void); -void Cache_Read_Enable_New(void); - -int SPIEraseBlock(uint32_t block); -uint32_t SPIRead(uint32_t addr, void *dst, uint32_t size); - -#ifndef RTOS_SDK - -#include <ets_sys.h> - -/* There are no declarations for these anywhere in the SDK (as of 1.2.0). */ -void ets_isr_mask(unsigned intr); -void ets_isr_unmask(unsigned intr); -void system_restart_local(void); -int os_printf_plus(const char *format, ...); - -void ets_wdt_init(void); -void ets_wdt_enable(uint32_t mode, uint32_t arg1, uint32_t arg2); -void ets_wdt_disable(void); -void ets_wdt_restore(uint32_t mode); -uint32_t ets_wdt_get_mode(void); - -void _xtos_l1int_handler(void); -void _xtos_set_exception_handler(); -void xthal_set_intenable(unsigned); - -/* These are present in mem.h but are commented out. */ -void *pvPortMalloc(size_t xWantedSize, const char *file, int line); -void vPortFree(void *pv, const char *file, int line); -void *pvPortZalloc(size_t size, const char *file, int line); -void *pvPortRealloc(void *pv, size_t size, const char *file, int line); - -#else /* !RTOS_SDK */ - -#define BIT(nr) (1UL << (nr)) -void system_soft_wdt_feed(void); -void system_soft_wdt_restart(void); -void ets_putc(char c); - -#endif /* RTOS_SDK */ - -void _ResetVector(void); - -#endif /* CS_COMMON_PLATFORMS_ESP8266_ESP_MISSING_INCLUDES_H_ */ diff --git a/src/common/platforms/esp8266/esp_ssl_krypton.h b/src/common/platforms/esp8266/esp_ssl_krypton.h deleted file mode 100644 index 75a2353b06dc8e5bd339d485ccdda599c8d2c42b..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/esp_ssl_krypton.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CS_COMMON_PLATFORMS_ESP8266_ESP_SSL_KRYPTON_H_ -#define CS_COMMON_PLATFORMS_ESP8266_ESP_SSL_KRYPTON_H_ - -#include "krypton/krypton.h" - -struct mg_connection; - -void mg_lwip_ssl_do_hs(struct mg_connection *nc); -void mg_lwip_ssl_send(struct mg_connection *nc); -void mg_lwip_ssl_recv(struct mg_connection *nc); - -#endif /* CS_COMMON_PLATFORMS_ESP8266_ESP_SSL_KRYPTON_H_ */ diff --git a/src/common/platforms/esp8266/esp_umm_malloc.c b/src/common/platforms/esp8266/esp_umm_malloc.c deleted file mode 100644 index 15869a712f18aac872d9712516eee86a9c16b753..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/esp_umm_malloc.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <string.h> -#include <stdio.h> -#include "common/umm_malloc/umm_malloc.h" -#include "esp_umm_malloc.h" - -#if ESP_UMM_ENABLE - -/* - * ESP-specific glue for the `umm_malloc`. - * - * In SDK (https://github.com/cesanta/esp-open-sdk), there is an archive - * `sdk/lib/libmain.a` which contains some files, including `mem_manager.o`. - * - * The `mem_manager.o` contains all the heap-related functions: `pvPortMalloc`, - * etc. We have weaken all symbols from `mem_manager.o` by - * `xtensa-lx106-elf-objcopy` (see exact commands in Dockerfile: - * `docker/esp8266/Dockerfile-esp8266-build-oss`), and provide our own - * implementations in this file. - * - * ------------------------------------ - * - * NOTE that not all public functions from `mem_manager.o` need to be replaced: - * some of them are used only internally: - * - * - system_show_malloc() - * - pvShowMalloc() - * - prvInsertBlockIntoUsedList() - * - prvRemoveBlockFromUsedList() - * - check_memleak_debug_enable() - * - vPortInitialiseBlocks() - * - * So when we replace all the rest (`pvPortMalloc`, etc), we can check with - * `objdump` that resulting binary (for SJ, it's `fw.out`) doesn't contain - * any of the "internal" functions. - * - * ------------------------------------ - * - * NOTE that to make linker actually consider implementations in this file, - * you should explicitly reference some function from it. This is what - * `esp_umm_init()` is for: it is a dummy no-op function that must be called - * from somewhere outside. - * - * If you don't do this, linker will merely garbage-collect this file, and - * will use heap implementation from SDK. - */ - -void *pvPortMalloc(size_t size, const char *file, unsigned line) { - (void) file; - (void) line; - - return umm_malloc(size); -} - -void *pvPortCalloc(size_t num, size_t size, const char *file, unsigned line) { - (void) file; - (void) line; - - return umm_calloc(num, size); -} - -void *pvPortZalloc(size_t size, const char *file, unsigned line) { - void *ret; - - (void) file; - (void) line; - - ret = umm_malloc(size); - if (ret != NULL) memset(ret, 0, size); - return ret; -} - -void *pvPortRealloc(void *ptr, size_t size, const char *file, unsigned line) { - (void) file; - (void) line; - - return umm_realloc(ptr, size); -} - -void vPortFree(void *ptr, const char *file, unsigned line) { - (void) file; - (void) line; - - umm_free(ptr); -} - -size_t xPortGetFreeHeapSize(void) { - return umm_free_heap_size(); -} - -size_t xPortWantedSizeAlign(void) { - return 4; -} - -void esp_umm_init(void) { - /* Nothing to do, see header for details */ -} - -void esp_umm_oom_cb(size_t size, size_t blocks_cnt) { - fprintf(stderr, "E:M %u (%u blocks)\n", (unsigned int) size, - (unsigned int) blocks_cnt); -} - -#endif /* ESP_UMM_ENABLE */ diff --git a/src/common/platforms/esp8266/esp_umm_malloc.h b/src/common/platforms/esp8266/esp_umm_malloc.h deleted file mode 100644 index f838e4f3daed85a4f03e268ed5d24aedd01a396e..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/esp_umm_malloc.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if ESP_UMM_ENABLE - -/* - * This is a no-op dummy function that is merely needed because we have to - * reference any function from the file `esp_umm_malloc.c`, so that linker - * won't garbage-collect the whole compilation unit. - */ -void esp_umm_init(void); - -/* - * Callback that gets called by umm_malloc in case of Out-of-memory error. - * - * `size` is the size requested by user, and `block_cnt` is a number of heap - * blocks that umm_malloc failed to allocate - */ -void esp_umm_oom_cb(size_t size, size_t blocks_cnt); - -#endif /* CS_COMMON_PLATFORMS_ESP8266_ESP_UMM_MALLOC_H_ */ diff --git a/src/common/platforms/esp8266/rboot/esptool2/Makefile b/src/common/platforms/esp8266/rboot/esptool2/Makefile deleted file mode 100644 index 4cccf2a7ee88868481782e1fafded651136a169c..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Makefile for esptool2 -# https://github.com/raburton/esp8266 -# - -CFLAGS = -O2 -Wall -CC = gcc -LD = gcc -BUILD_DIR = ../../build - -all: $(BUILD_DIR) $(BUILD_DIR)/esptool2 - -$(BUILD_DIR): - @mkdir -p $(BUILD_DIR) - -$(BUILD_DIR)/esptool2.o: esptool2.c esptool2.h esptool2_elf.h elf.h - @echo "CC $<" - $(CC) $(CFLAGS) -c $< -o $@ - -$(BUILD_DIR)/esptool2_elf.o: esptool2_elf.c esptool2.h esptool2_elf.h elf.h - @echo "CC $<" - $(CC) $(CFLAGS) -c $< -o $@ - -$(BUILD_DIR)/esptool2: $(BUILD_DIR)/esptool2.o $(BUILD_DIR)/esptool2_elf.o - @echo "LD $@" - $(LD) -o $@ $^ diff --git a/src/common/platforms/esp8266/rboot/esptool2/elf.h b/src/common/platforms/esp8266/rboot/esptool2/elf.h deleted file mode 100644 index a69971839ce1d037b1e558e07303f23daee52e6c..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/elf.h +++ /dev/null @@ -1,76 +0,0 @@ -// Based on a small portion of ELF.h from LLVM - -//===-- llvm/Support/ELF.h - ELF constants and data structures --*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. -// -//===----------------------------------------------------------------------===// -// -// This header contains common, non-processor-specific data structures and -// constants for the ELF file format. -// -// The details of the ELF32 bits in this file are largely based on the Tool -// Interface Standard (TIS) Executable and Linking Format (ELF) Specification -// Version 1.2, May 1995. The ELF64 stuff is based on ELF-64 Object File Format -// Version 1.5, Draft 2, May 1998 as well as OpenBSD header files. -// -//===----------------------------------------------------------------------===// - -#ifndef CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ELF_H_ -#define CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ELF_H_ - -typedef uint32_t Elf32_Addr; // Program address -typedef uint32_t Elf32_Off; // File offset -typedef uint16_t Elf32_Half; -typedef uint32_t Elf32_Word; -typedef int32_t Elf32_Sword; - -// e_ident size and indices -enum { - EI_MAG0 = 0, // File identification index. - EI_MAG1 = 1, // File identification index. - EI_MAG2 = 2, // File identification index. - EI_MAG3 = 3, // File identification index. - EI_CLASS = 4, // File class. - EI_DATA = 5, // Data encoding. - EI_VERSION = 6, // File version. - EI_OSABI = 7, // OS/ABI identification. - EI_ABIVERSION = 8, // ABI version. - EI_PAD = 9, // Start of padding bytes. - EI_NIDENT = 16 // Number of bytes in e_ident. -}; - -typedef struct { - unsigned char e_ident[EI_NIDENT]; // ELF Identification bytes - Elf32_Half e_type; // Type of file (see ET_* below) - Elf32_Half e_machine; // Required architecture for this file (see EM_*) - Elf32_Word e_version; // Must be equal to 1 - Elf32_Addr e_entry; // Address to jump to in order to start program - Elf32_Off e_phoff; // Program header table's file offset, in bytes - Elf32_Off e_shoff; // Section header table's file offset, in bytes - Elf32_Word e_flags; // Processor-specific flags - Elf32_Half e_ehsize; // Size of ELF header, in bytes - Elf32_Half e_phentsize; // Size of an entry in the program header table - Elf32_Half e_phnum; // Number of entries in the program header table - Elf32_Half e_shentsize; // Size of an entry in the section header table - Elf32_Half e_shnum; // Number of entries in the section header table - Elf32_Half e_shstrndx; // Sect hdr table index of sect name string table -} Elf32_Ehdr; - -typedef struct { - Elf32_Word sh_name; // Section name (index into string table) - Elf32_Word sh_type; // Section type (SHT_*) - Elf32_Word sh_flags; // Section flags (SHF_*) - Elf32_Addr sh_addr; // Address where section is to be loaded - Elf32_Off sh_offset; // File offset of section data, in bytes - Elf32_Word sh_size; // Size of section, in bytes - Elf32_Word sh_link; // Section type-specific header table index link - Elf32_Word sh_info; // Section type-specific extra information - Elf32_Word sh_addralign; // Section address alignment - Elf32_Word sh_entsize; // Size of records contained within the section -} Elf32_Shdr; - -#endif /* CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ELF_H_ */ diff --git a/src/common/platforms/esp8266/rboot/esptool2/esptool2.c b/src/common/platforms/esp8266/rboot/esptool2/esptool2.c deleted file mode 100644 index aa9b457c8d218677f3919728a056bf1a938d5281..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/esptool2.c +++ /dev/null @@ -1,561 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2015 Richard A Burton <richardaburton@gmail.com> -* -* This file is part of esptool2. -* -* esptool2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* esptool2 is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with esptool2. If not, see <http://www.gnu.org/licenses/>. -* -**********************************************************************************/ -/* clang-format off */ - -#include <stdlib.h> -#include <string.h> -#include <stdarg.h> - -#include "esptool2.h" -#include "esptool2_elf.h" - -#define IMAGE_PADDING 16 -#define SECTION_PADDING 4 -#define IROM_SECTION_PADDING 4096 -#define CHECKSUM_INIT 0xEF -#define BIN_MAGIC_IROM 0xEA -#define BIN_MAGIC_FLASH 0xE9 - -typedef struct { - Elf32_Addr addr; - Elf32_Word size; -} Section_Header; - -typedef struct { - unsigned char magic; - unsigned char count; - unsigned char byte2; - unsigned char byte3; - Elf32_Addr entry; -} Image_Header; - -static const char PADDING[IROM_SECTION_PADDING] = {0}; - -static bool debugon = false; -static bool quieton = false; - -// Print a standard info message (unless quiet mode) -void print(const char* format, ...) { - va_list args; - - if (!quieton) { - va_start(args, format); - vprintf(format, args); - va_end(args); - } -} - -// Print a debug message (if debug mode) -void debug(const char* format, ...) { - va_list args; - - if (debugon) { - va_start(args, format); - vprintf(format, args); - va_end(args); - } -} - -// Print an error message (always) -void error(const char* format, ...) { - va_list args; - - va_start(args, format); - vfprintf(stderr, format, args); - va_end(args); -} - -// Write an elf section (by name) to an existing file. -// Parameters: -// headed - add a header to the output -// zeroaddr - force zero entry point in header (default is the real entry point) -// padded - output will be padded to multiple of SECTION_PADDING bytes -// chksum - pointer to existing checksum to add this data to (zero if not needed) -// Produces error message on failure (so caller doesn't need to). -bool WriteElfSection(MyElf_File *elf, FILE *outfile, char* name, bool headed, - bool zeroaddr, int padto, unsigned char *chksum) { - - int i, pad = 0; - bool ret = false; - unsigned char *bindata = 0; - Section_Header sechead; - MyElf_Section *sect; - - // get elf section header - sect = GetElfSection(elf, name); - if(!sect) { - error("Error: Section '%s' not found in elf file.\r\n", name); - goto end_function; - } - - // create image section header - sechead.addr = (zeroaddr ? 0 : sect->address); - sechead.size = sect->size; - - // do we need to pad the section? - if (padto) { - pad = sechead.size % padto; - if (pad > 0) { - pad = padto - pad; - sechead.size += pad; - } - } - - debug("Adding section '%s', addr: 0x%08x, size: %d (+%d bytes(s) padding).\r\n", - name, sect->address, sect->size, pad); - - // get elf section binary data - bindata = GetElfSectionData(elf, sect); - if (!bindata) { - goto end_function; - } - - // write section (and pad if required) - if((headed && fwrite(&sechead, 1, sizeof(sechead), outfile) != sizeof(sechead)) - || fwrite(bindata, 1, sect->size, outfile) != sect->size - || (pad > 0 && fwrite(PADDING, 1, pad, outfile) != pad)) { - error("Error: Failed to write section '%s' to image file.\r\n", name); - goto end_function; - } - - // include section data in the checksum - if(chksum) { - for(i = 0; i < (int)sect->size; i++) { - *chksum ^= bindata[i]; - } - } - - ret = true; - -end_function: - if (bindata) free(bindata); - return ret; -} - -// Load an elf file and export a section of it to a new file, without -// header, padding or checksum. For exporting the .irom0.text library. -// Produces error message on failure (so caller doesn't need to). -bool ExportElfSection(char *infile, char *outfile, char *name) { - - bool ret = false; - FILE *fd = 0; - MyElf_File *elf = 0; - - // load elf file - elf = LoadElf(infile); - if (!elf) { - goto end_function; - } - - // open output file - fd = fopen(outfile, "wb"); - if(!fd) { - error("Error: Can't open output file '%s' for writing.\r\n", outfile); - goto end_function; - } - - // actually do the export - ret = WriteElfSection(elf, fd, name, false, false, false, 0); - -end_function: - // clean up - if (fd) fclose(fd); - UnloadElf(elf); - - return ret; -} - -// Create the main binary firmware image, from specified elf sections. -// Can produce for standard standalone app (separate .irom0.text) -// or sdk bootloaded apps (integrated .irom0.text). -// Choice of type requires appropriately linked elf file. -// Produces error message on failure (so caller doesn't need to). -bool CreateHeaderFile(char *elffile, char *imagefile, char *sections[], int numsec) { - - bool ret = false; - int i; - unsigned int j, len; - FILE *outfile = 0; - MyElf_File *elf = 0; - MyElf_Section *sect; - unsigned char *bindata = 0; - char name[31]; - - // load elf file - elf = LoadElf(elffile); - if (!elf) { - goto end_function; - } - - // open output file - outfile = fopen(imagefile, "wb"); - if(outfile == NULL) { - error("Error: Failed to open output file '%s' for writing.\r\n", imagefile); - goto end_function; - } - - // add entry point - fprintf(outfile, "const uint32 entry_addr = 0x%08x;\r\n", elf->header.e_entry); - - // add sections - for (i = 0; i < numsec; i++) { - // get elf section header - sect = GetElfSection(elf, sections[i]); - if(!sect) { - error("Error: Section '%s' not found in elf file.\r\n", sections[i]); - goto end_function; - } - - // simple name fix name - strncpy(name, sect->name, 31); - len = strlen(name); - for (j = 0; j < len; j++) { - if (name[j] == '.') name[j] = '_'; - } - - // add address, length and start the data block - debug("Adding section '%s', addr: 0x%08x, size: %d.\r\n", sections[i], sect->address, sect->size); - fprintf(outfile, "\r\nconst uint32 %s_addr = 0x%08x;\r\nconst uint32 %s_len = %d;\r\nconst uint8 %s_data[] = {", - name, sect->address, name, sect->size, name); - - // get elf section binary data - bindata = GetElfSectionData(elf, sect); - if (!bindata) { - goto end_function; - } - - // add the data and finish off the block - for (j = 0; j < sect->size; j++) { - if (j % 16 == 0) fprintf(outfile, "\r\n 0x%02x,", bindata[j]); - else fprintf(outfile, " 0x%02x,", bindata[j]); - } - fprintf(outfile, "\r\n};\r\n"); - free(bindata); - bindata = 0; - } - - // if we got this far everything worked! - ret = true; - -end_function: - // clean up - if (outfile) fclose(outfile); - if (elf) UnloadElf(elf); - if (bindata) free(bindata); - - return ret; -} - -// Create the main binary firmware image, from specified elf sections. -// Can produce for standard standalone app (separate .irom0.text) -// or sdk bootloaded apps (integrated .irom0.text). -// Choice of type requires appropriately linked elf file. -// Produces error message on failure (so caller doesn't need to). -bool CreateBinFile(char *elffile, char *imagefile, int bootver, unsigned char mode, - unsigned char clock, unsigned char size, bool iromchksum, char *sections[], int numsec) { - - bool ret = false; - int i, pad, len; - unsigned char chksum = CHECKSUM_INIT; - unsigned char *data = 0; - FILE *outfile = 0; - MyElf_File *elf = 0; - Image_Header imghead; - - // load elf file - elf = LoadElf(elffile); - if (!elf) { - goto end_function; - } - - // open output file - outfile = fopen(imagefile, "wb"); - if(outfile == NULL) { - error("Error: Failed to open output file '%s' for writing.\r\n", imagefile); - goto end_function; - } - - // set options common to standard and boot v1.2+ headers - imghead.byte2 = mode; - //imghead.byte3 = (int)((int)size << 4 | clock) && 0xff; - imghead.byte3 = ((size << 4) | clock) & 0xff; - imghead.entry = elf->header.e_entry; - debug("Size = %02x\r\n", size); - debug("Byte2 = %02x\r\n", imghead.byte2); - debug("Byte3 = %02x\r\n", imghead.byte3); - debug("Entry = %08x\r\n", imghead.entry); - - // boot v1.2+ header - if (bootver == 2) { - // extra header - imghead.magic = BIN_MAGIC_IROM; - imghead.count = 4; // probably a version number here, not a count - if(fwrite(&imghead, 1, sizeof(imghead), outfile) != sizeof(imghead)) { - error("Error: Failed to write header to image file.\r\n"); - goto end_function; - } - if(!WriteElfSection(elf, outfile, ".irom0.text", true, true, IROM_SECTION_PADDING, (iromchksum ? &chksum : 0))) { - goto end_function; - } - } - - // standard header - imghead.magic = BIN_MAGIC_FLASH; - imghead.count = numsec; - // write header - if(fwrite(&imghead, 1, sizeof(imghead), outfile) != sizeof(imghead)) { - error("Error: Failed to write header to image file.\r\n"); - goto end_function; - } - - // add sections - for (i = 0; i < numsec; i++) { - if(!WriteElfSection(elf, outfile, sections[i], true, false, SECTION_PADDING, &chksum)) { - goto end_function; - } - } - - // get image length (plus a byte for the checksum) - len = ftell(outfile) + 1; - - // do we need to pad the image? - pad = len % IMAGE_PADDING; - if (pad > 0) { - pad = IMAGE_PADDING - pad; - debug("Padding image with %d byte(s).\r\n", pad); - if(fwrite(PADDING, 1, pad, outfile) != pad) { - error("Error: Failed to write padding to image file.\r\n"); - goto end_function; - } - } - - // write checksum - if(fwrite(&chksum, 1, 1, outfile) != 1) { - error("Error: Failed to write checksum to image file.\r\n"); - goto end_function; - } - - // boot v1.1 - if(bootver == 1) { - // write 'ff' padding up to the position of the library - len = 0x10000 - ftell(outfile); - debug("Adding boot v1.1 padding, %d bytes of '0xff'.\r\n", len); - data = (unsigned char*)malloc(len); - memset(data, 0xff, len); - if(fwrite(data, 1, len, outfile) != len) { - error("Error: Failed to write boot v1.1 spacer.\r\n"); - goto end_function; - } - - // write the library - if(!WriteElfSection(elf, outfile, ".irom0.text", false, false, 0, 0)) { - goto end_function; - } - } - - // if we got this far everything worked! - ret = true; - -end_function: - // clean up - if (outfile) fclose(outfile); - if (data) free(data); - if (elf) UnloadElf(elf); - - return ret; -} - -int main(int argc, char *argv[]) { - - int i; - char *infile; - char *outfile; - int numstr; - bool binfile = false; - bool libfile = false; - bool headerfile = false; - bool paramerror = false; - bool iromchksum = false; - int bootver = 0; - /* Overwrite-friendly by default */ - unsigned char mode = 0xff; - unsigned char size = 0xff; - unsigned char clock = 0; - int opts = 0; - - // parse options - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-bin")) { - binfile = true; - opts++; - } else if (!strcmp(argv[i], "-lib")) { - libfile = true; - opts++; - } else if (!strcmp(argv[i], "-header")) { - headerfile = true; - opts++; - } else if (!strcmp(argv[i], "-quiet")) { - quieton = true; - } else if (!strcmp(argv[i], "-debug")) { - debugon = true; - } else if (!strcmp(argv[i], "-boot0")) { - bootver = 0; - } else if (!strcmp(argv[i], "-boot1")) { - bootver = 1; - } else if (!strcmp(argv[i], "-boot2")) { - bootver = 2; - } else if (!strcmp(argv[i], "-qio")) { - mode = 0; - } else if (!strcmp(argv[i], "-qout")) { - mode = 1; - } else if (!strcmp(argv[i], "-dio")) { - mode = 2; - } else if (!strcmp(argv[i], "-dout")) { - mode = 3; - } else if (!strcmp(argv[i], "-256")) { - size = 1; - } else if (!strcmp(argv[i], "-512")) { - size = 0; - } else if (!strcmp(argv[i], "-1024")) { - size = 2; - } else if (!strcmp(argv[i], "-2048")) { - size = 3; - } else if (!strcmp(argv[i], "-4096")) { - size = 4; - } else if (!strcmp(argv[i], "-20")) { - clock = 2; - } else if (!strcmp(argv[i], "-26.7")) { - clock = 1; - } else if (!strcmp(argv[i], "-40")) { - clock = 0; - } else if (!strcmp(argv[i], "-80")) { - clock = 15; - } else if (!strcmp(argv[i], "-iromchksum")) { - iromchksum = true; - } else if (!strcmp(argv[i], "--")) { - i++; - break; - } else if (argv[i][0] == '-') { - paramerror = true; - break; - } else { - break; - } - } - - print("esptool2 v2.0.0 - (c) 2015 Richard A Burton <richardaburton@gmail.com>\r\n"); - print("This program is licensed under the GPL v3.\r\n"); - print("See the file LICENSE for details.\r\n\r\n"); - - if (paramerror) { - error("Error: Unrecognised option '%s'.\r\n", argv[i]); - return -1; - } - - if (argc < 2) { - print("Usage:\r\n"); - print("esptool2 -lib [options] <input_file> <output_file>\r\n"); - print("esptool2 -bin [options] <input_file> <output_file> <elf_section>...\r\n"); - print("esptool2 -header [options] <input_file> <output_file> <elf_section>...\r\n"); - print("\r\n"); - print(" -lib\r\n"); - print(" Export the sdk library (.irom0.text), for a standalone app.\r\n"); - print(" e.g. esptool2 -elf esp8266_iot.out out.bin\r\n"); - print("\r\n"); - print(" -header\r\n"); - print(" Export elf sections as bytes to a C header file.\r\n"); - print(" e.g. esptool2 -elf esp8266_iot.out out.h .text .data .rodata\r\n"); - print("\r\n"); - print(" -bin\r\n"); - print(" Create binary program image, for standalone and bootloaded apps, with\r\n"); - print(" specified elf sections. Includes sdk library for bootloaded apps.\r\n"); - print(" e.g. esptool2 -bin esp8266_iot.out out.bin .text .data .rodata\r\n"); - print(" Options:\r\n"); - print(" bootloader: -boot0 -boot1 -boot2 (default -boot0)\r\n"); - print(" -boot0 = standalone app, not built for bootloader use\r\n"); - print(" -boot1 = built for bootloader v1.1\r\n"); - print(" -boot2 = built for bootloader v1.2+ (use for rBoot roms)\r\n"); - print(" (elf file must have been linked appropriately for chosen option)\r\n"); - print(" spi size (kb): -256 -512 -1024 -2048 -4096 (default -512)\r\n"); - print(" spi mode: -qio -qout -dio -dout (default -qio)\r\n"); - print(" spi speed: -20 -26.7 -40 -80 (default -40)\r\n"); - print(" include irom in checksum: -iromchksum (also needs enabling in rBoot)\r\n"); - print("\r\n"); - print("General options:\r\n"); - print(" -quiet prints only error messages\r\n"); - print(" -debug print extra debug information\r\n"); - print(" -- no more options follow (needed if your elf file starts with a '-')\r\n"); - print("\r\n"); - print("Returns:\r\n"); - print(" 0 on success\r\n"); - print(" -1 on failure\r\n"); - print("\r\n"); - return -1; - } - - // validate command line options - if (opts != 1) { - error("Error: You must specify -bin OR -lib OR -header for build type.\r\n"); - return -1; - } - - if (quieton && debugon) { - error("Error: You cannot specify -quiet and -debug.\r\n"); - return -1; - } - - // check enough parameters - if ((libfile && i + 2 > argc) || ((binfile | headerfile) && i + 3 > argc)) { - error("Error: Not enough arguments supplied.\r\n"); - return -1; - } else if (libfile && i + 2 < argc) { - error("Error: Too many arguments supplied.\r\n"); - return -1; - } - - // get parameters - infile = argv[i++]; - outfile = argv[i++]; - numstr = argc - i; - - // do it - if (binfile) { - if (!CreateBinFile(infile, outfile, bootver, mode, clock, size, iromchksum, &argv[i], numstr)) { - remove(outfile); - return -1; - } - } else if (headerfile) { - if (!CreateHeaderFile(infile, outfile, &argv[i], numstr)) { - remove(outfile); - return -1; - } - } else { - if (!ExportElfSection(infile, outfile, ".irom0.text")) { - remove(outfile); - return -1; - } - - } - - print("Successfully created '%s'.\r\n", outfile); - return 0; - -} diff --git a/src/common/platforms/esp8266/rboot/esptool2/esptool2.h b/src/common/platforms/esp8266/rboot/esptool2/esptool2.h deleted file mode 100644 index b0eba084641988595ddb791179f5584c5e1255b0..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/esptool2.h +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2015 Richard A Burton <richardaburton@gmail.com> -* -* This file is part of esptool2. -* -* esptool2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* esptool2 is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with esptool2. If not, see <http://www.gnu.org/licenses/>. -* -**********************************************************************************/ - -#ifndef CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ESPTOOL2_H_ -#define CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ESPTOOL2_H_ - -#ifdef WIN32 -typedef signed __int8 int8_t; -typedef signed __int16 int16_t; -typedef signed __int32 int32_t; -typedef unsigned __int8 uint8_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -#else -#include <stdint.h> -#endif - -#define true 1 -#define false 0 -#define bool char - -void debug( const char* format, ... ); -void print( const char* format, ... ); -void error( const char* format, ... ); - -#endif /* CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ESPTOOL2_H_ */ diff --git a/src/common/platforms/esp8266/rboot/esptool2/esptool2_elf.c b/src/common/platforms/esp8266/rboot/esptool2/esptool2_elf.c deleted file mode 100644 index 88ede4e1d4215d8b1b622d71d53c08f4e4f4820c..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/esptool2_elf.c +++ /dev/null @@ -1,183 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2015 Richard A Burton <richardaburton@gmail.com> -* -* This file is part of esptool2. -* -* esptool2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* esptool2 is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with esptool2. If not, see <http://www.gnu.org/licenses/>. -* -**********************************************************************************/ - -#include <stdlib.h> -#include <string.h> - -#include "esptool2.h" -#include "esptool2_elf.h" - -// Find a section in an elf file by name. -// Returns pointer to section if found, else returns zero. -// Does not produce any messages. -MyElf_Section* GetElfSection(MyElf_File *elf, char *name) { - - int i; - - for(i = 0; i < elf->header.e_shnum - 1; i++) { - if(!strcmp(name, elf->sections[i].name)) { - debug("Found section '%s'.\r\n", name); - return &elf->sections[i]; - } - } - - debug("Could not find section '%s'.\r\n", name); - return 0; -} - -// Reads an elf section (actual data) from the elf file. -// Returns a pointer to newly allocated memory (or zero on error), -// which should be freed by the caller when finished with. -// Produces error message on failure (so caller doesn't need to). -unsigned char* GetElfSectionData(MyElf_File *elf, MyElf_Section *section) { - - unsigned char *data = 0; - - if (section->size && section->offset) { - - data = (unsigned char*)malloc(section->size); - if(!data) { - error("Error: Out of memory!\r\n"); - return 0; - } - - if(fseek(elf->fd, section->offset, SEEK_SET) || - fread(data, 1, section->size, elf->fd) != section->size) { - error("Error: Can't read section '%s' data from elf file.\r\n", section->name); - free(data); - return 0; - } - - } else { - error("Error: Section '%s' has no data to read.\r\n", section->name); - } - - return data; -} - -// Opens an elf file and reads the string table and file & section headers. -// Returns a pointer to a MyElf_File structure (or zero on error). -// UnloadElf should be called to dispose of the MyElf_File structure. -// Produces error message on failure (so caller doesn't need to). -MyElf_File* LoadElf(char *infile) { - - int i; - MyElf_File *elf; - Elf32_Shdr temp; - - // allocate the elf structure - elf = (MyElf_File*)malloc(sizeof(MyElf_File)); - if(!elf) { - error("Error: Out of memory!\r\n"); - goto error_exit; - } - memset(elf, 0, sizeof(MyElf_File)); - - // open the file - elf->fd = fopen(infile, "rb"); - if(!elf->fd) { - error("Error: Can't open elf file '%s'.\r\n", infile); - goto error_exit; - } - - // read the header - if(fread(&elf->header, 1, sizeof(Elf32_Ehdr), elf->fd) != sizeof(Elf32_Ehdr)) { - error("Error: Can't read elf file header.\r\n"); - goto error_exit; - } - - // check the file header - if (memcmp(elf->header.e_ident, "\x7f" "ELF", 4)) { - error("Error: Input files doesn't look like an elf file (bad header).\r\n"); - goto error_exit; - } - - // is there a string table section (we need one) - if(!elf->header.e_shstrndx) { - error("Error: Elf file does not contain a string table.\r\n"); - goto error_exit; - } - - // get the string table section header - if(fseek(elf->fd, elf->header.e_shoff + (elf->header.e_shentsize * elf->header.e_shstrndx), SEEK_SET) || - fread(&temp, 1, sizeof(Elf32_Shdr), elf->fd) != sizeof(Elf32_Shdr)) { - - error("Error: Can't read string table section from elf file.\r\n"); - goto error_exit; - } - - // read the actual string table - if(!temp.sh_size) { - error("Error: Elf file contains an empty string table.\r\n"); - goto error_exit; - } - elf->strings = (char*)malloc(temp.sh_size); - if(!elf->strings) { - error("Error: Out of memory!\r\n"); - goto error_exit; - } - if(fseek(elf->fd, temp.sh_offset, SEEK_SET) || - fread(elf->strings, 1, temp.sh_size, elf->fd) != temp.sh_size) { - error("Error: Failed to read string stable from elf file.\r\n"); - goto error_exit; - } - - // read section headers - elf->sections = (MyElf_Section*)malloc(sizeof(MyElf_Section) * elf->header.e_shnum); - if(!elf->sections) { - error("Error: Out of memory!\r\n"); - goto error_exit; - } - for(i = 1; i < elf->header.e_shnum; i++) { - if(fseek(elf->fd, elf->header.e_shoff + (elf->header.e_shentsize * i), SEEK_SET) - || fread(&temp, 1, sizeof(Elf32_Shdr), elf->fd) != sizeof(Elf32_Shdr)) { - error("Error: Can't read section %d from elf file.\r\n", i); - break; - } - debug("Read section %d '%s'.\r\n", i, elf->strings + temp.sh_name); - elf->sections[i-1].address = temp.sh_addr; - elf->sections[i-1].offset = temp.sh_offset; - elf->sections[i-1].size = temp.sh_size; - elf->sections[i-1].name = elf->strings + temp.sh_name; - } - - return elf; - -error_exit: - if (elf) { - if (elf->fd) fclose(elf->fd); - if (elf->strings) free(elf->strings); - free(elf); - } - return 0; - -} - -// Close an elf file and dispose of the MyElf_File structure. -void UnloadElf(MyElf_File *elf) { - if (elf) { - debug("Unloading elf file.\r\n"); - if(elf->fd) fclose(elf->fd); - if(elf->strings) free(elf->strings); - if(elf->sections) free(elf->sections); - free(elf); - } -} diff --git a/src/common/platforms/esp8266/rboot/esptool2/esptool2_elf.h b/src/common/platforms/esp8266/rboot/esptool2/esptool2_elf.h deleted file mode 100644 index ef9851161a944484100fa0be9cecc21643c84a80..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/esptool2_elf.h +++ /dev/null @@ -1,48 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2015 Richard A Burton <richardaburton@gmail.com> -* -* This file is part of esptool2. -* -* esptool2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* esptool2 is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with esptool2. If not, see <http://www.gnu.org/licenses/>. -* -**********************************************************************************/ - -#ifndef CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ESPTOOL2_ELF_H_ -#define CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ESPTOOL2_ELF_H_ - -#include <stdio.h> - -#include "elf.h" - -typedef struct { - Elf32_Off offset; - Elf32_Addr address; - Elf32_Word size; - char *name; -} MyElf_Section; - -typedef struct { - FILE *fd; - Elf32_Ehdr header; - char *strings; - MyElf_Section *sections; -} MyElf_File; - -MyElf_File* LoadElf(char *infile); -void UnloadElf(MyElf_File *e_object); -MyElf_Section* GetElfSection(MyElf_File *e_object, char *name); -unsigned char* GetElfSectionData(MyElf_File *e_object, MyElf_Section *section); - -#endif /* CS_COMMON_PLATFORMS_ESP8266_RBOOT_ESPTOOL2_ESPTOOL2_ELF_H_ */ diff --git a/src/common/platforms/esp8266/rboot/esptool2/license.txt b/src/common/platforms/esp8266/rboot/esptool2/license.txt deleted file mode 100644 index 94a9ed024d3859793618152ea559a168bbcbb5e2..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/license.txt +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/src/common/platforms/esp8266/rboot/esptool2/readme.txt b/src/common/platforms/esp8266/rboot/esptool2/readme.txt deleted file mode 100644 index eb9f0ef24aa585745969a60ddc3a7883ec2d1440..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/esptool2/readme.txt +++ /dev/null @@ -1,19 +0,0 @@ -Esptool2 -richardaburton@gmail.com -http://richard.burtons.org/ - -Esptool2 is a tool for creating rom images for the ESP8266. It is an alternative -to using the SDK supplied shell script/Makefile/python script combo, which is a -mess. It was inspired by the windows esptool v0.0.2 by mamalala and found on -www.esp8266.com but made somewhat simpler in code and usage. It also adds -support for boot loader v1.2+ rom types, which was the main reason I wrote it. - -It was written for my own use and the name was simply to distinguish it for the -other version on my system. The 2 is not intended to imply it is better than the -original. The original has since been updated to v0.0.3 which can write to the -flash, but I currently have no intention to add that to esptool2, it is purely a -rom creating utility. It has become an integral part of my build process now and -has added functionality needed for building the rBoot boot loader. Since I have -released rBoot I needed to release this as well. - -Run tool for full usage instructions, or look at the code. diff --git a/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-api.c b/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-api.c deleted file mode 100644 index 2d2e83db7ad450712d1ab2750bb79b5bd8956cdf..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-api.c +++ /dev/null @@ -1,152 +0,0 @@ -////////////////////////////////////////////////// -// rBoot OTA and config API for ESP8266. -// Copyright 2015 Richard A Burton -// richardaburton@gmail.com -// See license.txt for license terms. -// OTA code based on SDK sample from Espressif. -////////////////////////////////////////////////// - -#ifdef RBOOT_INTEGRATION -#include <rboot-integration.h> -#endif - -#include <c_types.h> -#include <stdlib.h> -#include <string.h> - -#ifdef RTOS_SDK -#include "spi_flash.h" -#else -#include <user_interface.h> -#endif - -#include "rboot-api.h" -#include "../rboot-private.h" -#include "esp_missing_includes.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// get the rboot config -rboot_config ICACHE_FLASH_ATTR rboot_get_config(void) { - rboot_config conf; - spi_flash_read(BOOT_CONFIG_SECTOR * SECTOR_SIZE, (uint32*)&conf, sizeof(rboot_config)); - return conf; -} - -// write the rboot config -// preserves the contents of the rest of the sector, -// so the rest of the sector can be used to store user data -// updates checksum automatically (if enabled) -bool ICACHE_FLASH_ATTR rboot_set_config(rboot_config *conf) { - uint32_t buffer[sizeof(*conf) / sizeof(uint32_t) + 1]; -#ifdef BOOT_CONFIG_CHKSUM - uint8 chksum; - uint8 *ptr; -#endif - -#ifdef BOOT_CONFIG_CHKSUM - chksum = CHKSUM_INIT; - for (ptr = (uint8*)conf; ptr < &conf->chksum; ptr++) { - chksum ^= *ptr; - } - conf->chksum = chksum; -#endif - - memset(buffer, 0xff, sizeof(buffer)); - memcpy(buffer, conf, sizeof(*conf)); - if (spi_flash_erase_sector(BOOT_CONFIG_SECTOR) != SPI_FLASH_RESULT_OK || - spi_flash_write(BOOT_CONFIG_SECTOR * SECTOR_SIZE, buffer, sizeof(buffer)) != SPI_FLASH_RESULT_OK) { - return false; - } - return true; -} - -// get current boot rom -uint8 ICACHE_FLASH_ATTR rboot_get_current_rom(void) { - rboot_config conf; - conf = rboot_get_config(); - return conf.current_rom; -} - -// set current boot rom -bool ICACHE_FLASH_ATTR rboot_set_current_rom(uint8 rom) { - rboot_config conf; - conf = rboot_get_config(); - if (rom >= conf.count) return false; - conf.current_rom = rom; - return rboot_set_config(&conf); -} - -// create the write status struct, based on supplied start address -rboot_write_status ICACHE_FLASH_ATTR rboot_write_init(uint32 start_addr) { - rboot_write_status status = {0}; - status.start_addr = start_addr; - status.start_sector = start_addr / SECTOR_SIZE; - //status.max_sector_count = 200; - //os_printf("init addr: 0x%08x\r\n", start_addr); - - return status; -} - -// function to do the actual writing to flash -// call repeatedly with more data (max len per write is the flash sector size (4k)) -bool ICACHE_FLASH_ATTR rboot_write_flash(rboot_write_status *status, uint8 *data, uint16 len) { - - bool ret = false; - uint8 *buffer; - - if (data == NULL || len == 0) { - return true; - } - - // get a buffer - buffer = (uint8 *) calloc(1, len + status->extra_count); - if (!buffer) { - //os_printf("No ram!\r\n"); - return false; - } - - // copy in any remaining bytes from last chunk - memcpy(buffer, status->extra_bytes, status->extra_count); - // copy in new data - memcpy(buffer + status->extra_count, data, len); - - // calculate length, must be multiple of 4 - // save any remaining bytes for next go - len += status->extra_count; - status->extra_count = len % 4; - len -= status->extra_count; - memcpy(status->extra_bytes, buffer + len, status->extra_count); - - // check data will fit - //if (status->start_addr + len < (status->start_sector + status->max_sector_count) * SECTOR_SIZE) { - - if (len > SECTOR_SIZE) { - // to support larger writes we would need to erase current - // (if not already done), next and possibly later sectors too - } else { - // check if the sector the write finishes in has been erased yet, - // this is fine as long as data len < sector size - if (status->last_sector_erased != (status->start_addr + len) / SECTOR_SIZE) { - status->last_sector_erased = (status->start_addr + len) / SECTOR_SIZE; - spi_flash_erase_sector(status->last_sector_erased); - } - } - - // write current chunk - //os_printf("write addr: 0x%08x, len: 0x%04x\r\n", status->start_addr, len); - if (spi_flash_write(status->start_addr, (uint32 *)buffer, len) == SPI_FLASH_RESULT_OK) { - ret = true; - status->start_addr += len; - } - //} - - free(buffer); - return ret; -} - -#ifdef __cplusplus -} -#endif diff --git a/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-api.h b/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-api.h deleted file mode 100644 index c4601d30332b8ef7bbe30ca8a7b52750e2e16934..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-api.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_APPCODE_RBOOT_API_H_ -#define CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_APPCODE_RBOOT_API_H_ - -////////////////////////////////////////////////// -// rBoot OTA and config API for ESP8266. -// Copyright 2015 Richard A Burton -// richardaburton@gmail.com -// See license.txt for license terms. -// OTA code based on SDK sample from Espressif. -////////////////////////////////////////////////// - -#include "../rboot.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - uint32 start_addr; - uint32 start_sector; - //uint32 max_sector_count; - uint32 last_sector_erased; - uint8 extra_count; - uint8 extra_bytes[4]; -} rboot_write_status; - -rboot_config ICACHE_FLASH_ATTR rboot_get_config(void); -bool ICACHE_FLASH_ATTR rboot_set_config(rboot_config *conf); -uint8 ICACHE_FLASH_ATTR rboot_get_current_rom(void); -bool ICACHE_FLASH_ATTR rboot_set_current_rom(uint8 rom); -rboot_write_status ICACHE_FLASH_ATTR rboot_write_init(uint32 start_addr); -bool ICACHE_FLASH_ATTR rboot_write_flash(rboot_write_status *status, uint8 *data, uint16 len); - -#ifdef __cplusplus -} -#endif - -#endif /* CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_APPCODE_RBOOT_API_H_ */ diff --git a/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-bigflash.c b/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-bigflash.c deleted file mode 100644 index cd8a180bf5dfe6d0ec9a6c6354a860abf7e885de..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/appcode/rboot-bigflash.c +++ /dev/null @@ -1,61 +0,0 @@ -////////////////////////////////////////////////// -// rBoot open source boot loader for ESP8266. -// Copyright 2015 Richard A Burton -// richardaburton@gmail.com -// See license.txt for license terms. -////////////////////////////////////////////////// - -/* clang-format off */ - -#ifdef RBOOT_INTEGRATION -#include <rboot-integration.h> -#endif - -typedef unsigned int uint32; -typedef unsigned char uint8; - -#include <rboot.h> - -#if 0 //def BOOT_BIG_FLASH - -// plain sdk defaults to iram -#ifndef IRAM_ATTR -#define IRAM_ATTR -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -extern void Cache_Read_Disable(); -extern uint32 SPIRead(uint32, void*, uint32); -extern void Cache_Read_Enable(uint32, uint32, uint32); - -uint8 rBoot_mmap_1 = 0xff; -uint8 rBoot_mmap_2 = 0xff; - -// this function must remain in iram -IRAM NOINSTR void __wrap_Cache_Read_Enable_New(void) { - if (rBoot_mmap_1 == 0xff) { - uint32 addr; - rboot_config conf; - - Cache_Read_Disable(); - - SPIRead(BOOT_CONFIG_SECTOR * SECTOR_SIZE, &conf, sizeof(rboot_config)); - - addr = conf.roms[conf.current_rom]; - addr /= 0x100000; - - rBoot_mmap_2 = addr / 2; - rBoot_mmap_1 = addr % 2; - } - - Cache_Read_Enable(rBoot_mmap_1, rBoot_mmap_2, 1); -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/common/platforms/esp8266/rboot/rboot/firmware/rboot.bin b/src/common/platforms/esp8266/rboot/rboot/firmware/rboot.bin deleted file mode 100644 index a928e0b0e8fb3b8f63ad57135a110795e3570d3e..0000000000000000000000000000000000000000 Binary files a/src/common/platforms/esp8266/rboot/rboot/firmware/rboot.bin and /dev/null differ diff --git a/src/common/platforms/esp8266/rboot/rboot/license.txt b/src/common/platforms/esp8266/rboot/rboot/license.txt deleted file mode 100644 index 04903d79e30e8402854b6db229ef35a26449ff58..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/license.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Richard A Burton (richardaburton@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot-private.h b/src/common/platforms/esp8266/rboot/rboot/rboot-private.h deleted file mode 100644 index 5b4d52ff23b8ca0710ba5b78ff680e644dcfbd1a..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot-private.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_PRIVATE_H_ -#define CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_PRIVATE_H_ - -////////////////////////////////////////////////// -// rBoot open source boot loader for ESP8266. -// Copyright 2015 Richard A Burton -// richardaburton@gmail.com -// See license.txt for license terms. -////////////////////////////////////////////////// - -typedef int int32; -typedef unsigned int uint32; -typedef unsigned char uint8; - -#include "rboot.h" - -#define NOINLINE __attribute__ ((noinline)) - -#define ROM_MAGIC 0xe9 -#define ROM_MAGIC_NEW1 0xea -#define ROM_MAGIC_NEW2 0x04 - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -// buffer size, must be at least 0x10 (size of rom_header_new structure) -#define BUFFER_SIZE 0x100 - -// esp8266 built in rom functions -extern void ets_printf(const char*, ...); -extern uint32 SPIRead(uint32 addr, void *outptr, uint32 len); -extern uint32 SPIEraseSector(int); -extern uint32 SPIWrite(uint32 addr, void *inptr, uint32 len); - -// functions we'll call by address -typedef void stage2a(uint32); -typedef void usercode(void); - -// standard rom header -typedef struct { - // general rom header - uint8 magic; - uint8 count; - uint8 flags1; - uint8 flags2; - usercode* entry; -} rom_header; - -typedef struct { - uint8* address; - uint32 length; -} section_header; - -// new rom header (irom section first) there is -// another 8 byte header straight afterward the -// standard header -typedef struct { - // general rom header - uint8 magic; - uint8 count; // second magic for new header - uint8 flags1; - uint8 flags2; - uint32 entry; - // new type rom, lib header - uint32 add; // zero - uint32 len; // length of irom section -} rom_header_new; - -#endif /* CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_PRIVATE_H_ */ diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot-stage2a.c b/src/common/platforms/esp8266/rboot/rboot/rboot-stage2a.c deleted file mode 100644 index 9df98a81e45a25c9f2d02e58312e1d79dde7b923..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot-stage2a.c +++ /dev/null @@ -1,80 +0,0 @@ -////////////////////////////////////////////////// -// rBoot open source boot loader for ESP8266. -// Copyright 2015 Richard A Burton -// richardaburton@gmail.com -// See license.txt for license terms. -////////////////////////////////////////////////// - -#ifdef RBOOT_INTEGRATION -#include <rboot-integration.h> -#endif - -#include "rboot-private.h" - -usercode* NOINLINE load_rom(uint32 readpos) { - - uint8 buffer[BUFFER_SIZE]; - uint8 sectcount; - uint8 *writepos; - uint32 remaining; - usercode* usercode; - - rom_header *header = (rom_header*)buffer; - section_header *section = (section_header*)buffer; - - // read rom header - SPIRead(readpos, header, sizeof(rom_header)); - readpos += sizeof(rom_header); - - // create function pointer for entry point - usercode = header->entry; - - // copy all the sections - for (sectcount = header->count; sectcount > 0; sectcount--) { - - // read section header - SPIRead(readpos, section, sizeof(section_header)); - readpos += sizeof(section_header); - - // get section address and length - writepos = section->address; - remaining = section->length; - - while (remaining > 0) { - // work out how much to read, up to 16 bytes at a time - uint32 readlen = (remaining < BUFFER_SIZE) ? remaining : BUFFER_SIZE; - // read the block - SPIRead(readpos, buffer, readlen); - readpos += readlen; - // copy the block - ets_memcpy(writepos, buffer, readlen); - // increment next write position - writepos += readlen; - // decrement remaining count - remaining -= readlen; - } - } - - return usercode; -} - -#ifdef BOOT_NO_ASM - -void call_user_start(uint32 readpos) { - usercode* user; - user = load_rom(readpos); - user(); -} - -#else - -void call_user_start(uint32 readpos) { - __asm volatile ( - "mov a15, a0\n" // store return addr, we already splatted a15! - "call0 load_rom\n" // load the rom - "mov a0, a15\n" // restore return addr - "jx a2\n" // now jump to the rom code - ); -} - -#endif diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot-stage2a.ld b/src/common/platforms/esp8266/rboot/rboot/rboot-stage2a.ld deleted file mode 100644 index 7af83eaf8d1269832a6f1ca5cfac03f526467882..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot-stage2a.ld +++ /dev/null @@ -1,211 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP . */ -/* Linker Script for ld -N */ -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x4010FC00, len = 0x400 - irom0_0_seg : org = 0x40240000, len = 0x3C000 -} - -PHDRS -{ - dport0_0_phdr PT_LOAD; - dram0_0_phdr PT_LOAD; - dram0_0_bss_phdr PT_LOAD; - iram1_0_phdr PT_LOAD; - irom0_0_phdr PT_LOAD; -} - - -/* Default entry point: */ -ENTRY(call_user_start) -EXTERN(_DebugExceptionVector) -EXTERN(_DoubleExceptionVector) -EXTERN(_KernelExceptionVector) -EXTERN(_NMIExceptionVector) -EXTERN(_UserExceptionVector) -PROVIDE(_memmap_vecbase_reset = 0x40000000); -/* Various memory-map dependent cache attribute settings: */ -_memmap_cacheattr_wb_base = 0x00000110; -_memmap_cacheattr_wt_base = 0x00000110; -_memmap_cacheattr_bp_base = 0x00000220; -_memmap_cacheattr_unused_mask = 0xFFFFF00F; -_memmap_cacheattr_wb_trapnull = 0x2222211F; -_memmap_cacheattr_wba_trapnull = 0x2222211F; -_memmap_cacheattr_wbna_trapnull = 0x2222211F; -_memmap_cacheattr_wt_trapnull = 0x2222211F; -_memmap_cacheattr_bp_trapnull = 0x2222222F; -_memmap_cacheattr_wb_strict = 0xFFFFF11F; -_memmap_cacheattr_wt_strict = 0xFFFFF11F; -_memmap_cacheattr_bp_strict = 0xFFFFF22F; -_memmap_cacheattr_wb_allvalid = 0x22222112; -_memmap_cacheattr_wt_allvalid = 0x22222112; -_memmap_cacheattr_bp_allvalid = 0x22222222; -PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull); - -SECTIONS -{ - - .dport0.rodata : ALIGN(4) - { - _dport0_rodata_start = ABSOLUTE(.); - *(.dport0.rodata) - *(.dport.rodata) - _dport0_rodata_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .dport0.literal : ALIGN(4) - { - _dport0_literal_start = ABSOLUTE(.); - *(.dport0.literal) - *(.dport.literal) - _dport0_literal_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .dport0.data : ALIGN(4) - { - _dport0_data_start = ABSOLUTE(.); - *(.dport0.data) - *(.dport.data) - _dport0_data_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .data : ALIGN(4) - { - _data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - *(.jcr) - _data_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .rodata : ALIGN(4) - { - _rodata_start = ABSOLUTE(.); - *(.rodata) - *(.rodata.*) - *(.gnu.linkonce.r.*) - *(.rodata1) - __XT_EXCEPTION_TABLE__ = ABSOLUTE(.); - *(.xt_except_table) - *(.gcc_except_table) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - *(.eh_frame) - /* C++ constructor and destructor tables, properly ordered: */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - /* C++ exception handlers table: */ - __XT_EXCEPTION_DESCS__ = ABSOLUTE(.); - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - . = ALIGN(4); /* this table MUST be 4-byte aligned */ - _bss_table_start = ABSOLUTE(.); - LONG(_bss_start) - LONG(_bss_end) - _bss_table_end = ABSOLUTE(.); - _rodata_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .bss ALIGN(8) (NOLOAD) : ALIGN(4) - { - . = ALIGN (8); - _bss_start = ABSOLUTE(.); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN (8); - _bss_end = ABSOLUTE(.); - _heap_start = ABSOLUTE(.); -/* _stack_sentry = ALIGN(0x8); */ - } >dram0_0_seg :dram0_0_bss_phdr -/* __stack = 0x3ffc8000; */ - - .text : ALIGN(4) - { - _stext = .; - _text_start = ABSOLUTE(.); - *(.UserEnter.text) - . = ALIGN(16); - *(.DebugExceptionVector.text) - . = ALIGN(16); - *(.NMIExceptionVector.text) - . = ALIGN(16); - *(.KernelExceptionVector.text) - LONG(0) - LONG(0) - LONG(0) - LONG(0) - . = ALIGN(16); - *(.UserExceptionVector.text) - LONG(0) - LONG(0) - LONG(0) - LONG(0) - . = ALIGN(16); - *(.DoubleExceptionVector.text) - LONG(0) - LONG(0) - LONG(0) - LONG(0) - . = ALIGN (16); - *(.entry.text) - *(.init.literal) - *(.init) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *(.fini.literal) - *(.fini) - *(.gnu.version) - _text_end = ABSOLUTE(.); - _etext = .; - } >iram1_0_seg :iram1_0_phdr - - .lit4 : ALIGN(4) - { - _lit4_start = ABSOLUTE(.); - *(*.lit4) - *(.lit4.*) - *(.gnu.linkonce.lit4.*) - _lit4_end = ABSOLUTE(.); - } >iram1_0_seg :iram1_0_phdr - - .irom0.text : ALIGN(4) - { - _irom0_text_start = ABSOLUTE(.); - *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text) - _irom0_text_end = ABSOLUTE(.); - } >irom0_0_seg :irom0_0_phdr - -} - -/* get ROM code address */ -INCLUDE "rboot_rom.ld" diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot.c b/src/common/platforms/esp8266/rboot/rboot/rboot.c deleted file mode 100644 index 6f752142341a4464546f9ba77cad5f60125a927f..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot.c +++ /dev/null @@ -1,428 +0,0 @@ -////////////////////////////////////////////////// -// rBoot open source boot loader for ESP8266. -// Copyright 2015 Richard A Burton -// richardaburton@gmail.com -// See license.txt for license terms. -////////////////////////////////////////////////// -/* clang-format off */ - -#ifdef RBOOT_INTEGRATION -#include <rboot-integration.h> -#endif - -#include "rboot-private.h" -#include <rboot-hex2a.h> - -static uint32 check_image(uint32 readpos) { - - uint8 buffer[BUFFER_SIZE]; - uint8 sectcount; - uint8 sectcurrent; - uint8 *writepos; - uint8 chksum = CHKSUM_INIT; - uint32 loop; - uint32 remaining; - uint32 romaddr; - - rom_header_new *header = (rom_header_new*)buffer; - section_header *section = (section_header*)buffer; - - if (readpos == 0 || readpos == 0xffffffff) { - return 0; - } - - // read rom header - if (SPIRead(readpos, header, sizeof(rom_header_new)) != 0) { - return 0; - } - - // check header type - if (header->magic == ROM_MAGIC) { - // old type, no extra header or irom section to skip over - romaddr = readpos; - readpos += sizeof(rom_header); - sectcount = header->count; - } else if (header->magic == ROM_MAGIC_NEW1 && header->count == ROM_MAGIC_NEW2) { - // new type, has extra header and irom section first - romaddr = readpos + header->len + sizeof(rom_header_new); -#ifdef BOOT_IROM_CHKSUM - // we will set the real section count later, when we read the header - sectcount = 0xff; - // just skip the first part of the header - // rest is processed for the chksum - readpos += sizeof(rom_header); -#else - // skip the extra header and irom section - readpos = romaddr; - // read the normal header that follows - if (SPIRead(readpos, header, sizeof(rom_header)) != 0) { - return 0; - } - sectcount = header->count; - readpos += sizeof(rom_header); -#endif - } else { - return 0; - } - - // test each section - for (sectcurrent = 0; sectcurrent < sectcount; sectcurrent++) { - - // read section header - if (SPIRead(readpos, section, sizeof(section_header)) != 0) { - return 0; - } - readpos += sizeof(section_header); - - // get section address and length - writepos = section->address; - remaining = section->length; - - while (remaining > 0) { - // work out how much to read, up to BUFFER_SIZE - uint32 readlen = (remaining < BUFFER_SIZE) ? remaining : BUFFER_SIZE; - // read the block - if (SPIRead(readpos, buffer, readlen) != 0) { - return 0; - } - // increment next read and write positions - readpos += readlen; - writepos += readlen; - // decrement remaining count - remaining -= readlen; - // add to chksum - for (loop = 0; loop < readlen; loop++) { - chksum ^= buffer[loop]; - } - } - -#ifdef BOOT_IROM_CHKSUM - if (sectcount == 0xff) { - // just processed the irom section, now - // read the normal header that follows - if (SPIRead(readpos, header, sizeof(rom_header)) != 0) { - return 0; - } - sectcount = header->count + 1; - readpos += sizeof(rom_header); - } -#endif - } - - // round up to next 16 and get checksum - readpos = readpos | 0x0f; - if (SPIRead(readpos, buffer, 1) != 0) { - return 0; - } - - // compare calculated and stored checksums - if (buffer[0] != chksum) { - return 0; - } - - return romaddr; -} - -#define ETS_UNCACHED_ADDR(addr) (addr) -#define READ_PERI_REG(addr) (*((volatile uint32 *)ETS_UNCACHED_ADDR(addr))) -#define WRITE_PERI_REG(addr, val) (*((volatile uint32 *)ETS_UNCACHED_ADDR(addr))) = (uint32)(val) -#define PERIPHS_RTC_BASEADDR 0x60000700 -#define REG_RTC_BASE PERIPHS_RTC_BASEADDR -#define RTC_GPIO_OUT (REG_RTC_BASE + 0x068) -#define RTC_GPIO_ENABLE (REG_RTC_BASE + 0x074) -#define RTC_GPIO_IN_DATA (REG_RTC_BASE + 0x08C) -#define RTC_GPIO_CONF (REG_RTC_BASE + 0x090) -#define PAD_XPD_DCDC_CONF (REG_RTC_BASE + 0x0A0) -static uint32 get_gpio16(void) { - // set output level to 1 - WRITE_PERI_REG(RTC_GPIO_OUT, (READ_PERI_REG(RTC_GPIO_OUT) & (uint32)0xfffffffe) | (uint32)(1)); - - // read level - WRITE_PERI_REG(PAD_XPD_DCDC_CONF, (READ_PERI_REG(PAD_XPD_DCDC_CONF) & 0xffffffbc) | (uint32)0x1); // mux configuration for XPD_DCDC and rtc_gpio0 connection - WRITE_PERI_REG(RTC_GPIO_CONF, (READ_PERI_REG(RTC_GPIO_CONF) & (uint32)0xfffffffe) | (uint32)0x0); //mux configuration for out enable - WRITE_PERI_REG(RTC_GPIO_ENABLE, READ_PERI_REG(RTC_GPIO_ENABLE) & (uint32)0xfffffffe); //out disable - - uint32 x = (READ_PERI_REG(RTC_GPIO_IN_DATA) & 1); - - return x; -} - -#ifdef BOOT_CONFIG_CHKSUM -// calculate checksum for block of data -// from start up to (but excluding) end -static uint8 calc_chksum(uint8 *start, uint8 *end) { - uint8 chksum = CHKSUM_INIT; - while(start < end) { - chksum ^= *start; - start++; - } - return chksum; -} -#endif - -#define UART_CLKDIV_80MHZ(B) (80000000 + B / 2) / B -#define UART_CLKDIV_52MHZ(B) (52000000 + B / 2) / B - -// prevent this function being placed inline with main -// to keep main's stack size as small as possible -// don't mark as static or it'll be optimised out when -// using the assembler stub -uint32 NOINLINE find_image(void) { - - uint8 flag; - uint32 runAddr; - uint32 flashsize; - int32 romToBoot; - uint8 gpio_boot = FALSE; - uint8 updateConfig = FALSE; - uint8 buffer[SECTOR_SIZE]; - - rboot_config *romconf = (rboot_config*)buffer; - rom_header *header = (rom_header*)buffer; - - // delay to slow boot (help see messages when debugging) - //ets_delay_us(2000000); - - /* - * UART divider depends on the APB frequency. Cold boot starts with 52MHz APB, - * SDK configures PLL, sets it to 80 and it persists across soft reset - * so on soft reset a different divider should be used. What we really want to - * know is if the PLL is running but since that is completely undocumented - * we use CPU frequency bit as a workaround: mos sets CPU to 160 MHz on startup - * so we assume that if frequency is preserved, then it's soft reset, PLL is - * running and APB is at 80 MHz. - */ - if (READ_PERI_REG(0x3ff00014) & 1) { - uart_div_modify(0, UART_CLKDIV_80MHZ(115200)); - } else { - uart_div_modify(0, UART_CLKDIV_52MHZ(115200)); - } - ets_delay_us(1000); - - ets_printf("\r\nrBoot v1.2.1-cesanta1 - richardaburton@gmail.com\r\n"); - - // read rom header - SPIRead(0, header, sizeof(rom_header)); - - // print and get flash size - ets_printf("Flash Size: "); - flag = header->flags2 >> 4; - if (flag == 0) { - ets_printf("4 Mbit\r\n"); - flashsize = 0x80000; - } else if (flag == 1) { - ets_printf("2 Mbit\r\n"); - flashsize = 0x40000; - } else if (flag == 2) { - ets_printf("8 Mbit\r\n"); - flashsize = 0x100000; - } else { -#ifdef BOOT_BIG_FLASH - if (flag == 3) { - ets_printf("16 Mbit\r\n"); - flashsize = 0x200000; - } else if (flag == 4) { - ets_printf("32 Mbit\r\n"); - flashsize = 0x400000; - } else if (flag == 8) { - ets_printf("64 Mbit\r\n"); - flashsize = 0x800000; - } else if (flag == 9) { - ets_printf("128 Mbit\r\n"); - flashsize = 0x1000000; - } else { - ets_printf("unknown\r\n"); - flashsize = 0x100000; // assume 8Mbit - } -#else - ets_printf("8 Mbit\r\n"); - flashsize = 0x100000; // limit to 8Mbit -#endif - } - - // print spi mode - ets_printf("Flash Mode: "); - if (header->flags1 == 0) { - ets_printf("QIO\r\n"); - } else if (header->flags1 == 1) { - ets_printf("QOUT\r\n"); - } else if (header->flags1 == 2) { - ets_printf("DIO\r\n"); - } else if (header->flags1 == 3) { - ets_printf("DOUT\r\n"); - } else { - ets_printf("unknown\r\n"); - } - - // print spi speed - ets_printf("Flash Speed: "); - flag = header->flags2 & 0x0f; - if (flag == 0) ets_printf("40 MHz\r\n"); - else if (flag == 1) ets_printf("26.7 MHz\r\n"); - else if (flag == 2) ets_printf("20 MHz\r\n"); - else if (flag == 0x0f) ets_printf("80 MHz\r\n"); - else ets_printf("unknown\r\n"); - - // print enabled options -#ifdef BOOT_BIG_FLASH - ets_printf("rBoot Option: Big flash\r\n"); -#endif -#ifdef BOOT_CONFIG_CHKSUM - ets_printf("rBoot Option: Config chksum\r\n"); -#endif -#ifdef BOOT_IROM_CHKSUM - ets_printf("rBoot Option: irom chksum\r\n"); -#endif - - ets_printf("\r\n"); - - // read boot config - SPIRead(BOOT_CONFIG_SECTOR * SECTOR_SIZE, buffer, SECTOR_SIZE); - // fresh install or old version? - if (romconf->magic != BOOT_CONFIG_MAGIC || romconf->version != BOOT_CONFIG_VERSION -#ifdef BOOT_CONFIG_CHKSUM - || romconf->chksum != calc_chksum((uint8*)romconf, (uint8*)&romconf->chksum) -#endif - ) { - /* Modified by Cesanta */ - ets_printf("Writing default boot config @ 0x%x.\r\n", BOOT_CONFIG_SECTOR * SECTOR_SIZE); - ets_memset(romconf, 0x00, sizeof(rboot_config)); - romconf->magic = BOOT_CONFIG_MAGIC; - romconf->version = BOOT_CONFIG_VERSION; - romconf->count = 2; - romconf->mode = MODE_STANDARD; - /* FWx_ADDR, FWx_FS_ADDR and FS_SIZE, FW_SIZE must be defined by -D */ - romconf->roms[0] = FW1_ADDR; - romconf->roms[1] = FW2_ADDR; - romconf->fs_addresses[0] = FW1_FS_ADDR; - romconf->fs_addresses[1] = FW2_FS_ADDR; - romconf->fs_sizes[0] = romconf->fs_sizes[1] = FS_SIZE; - romconf->roms_sizes[0] = romconf->roms_sizes[1] = FW_SIZE; -#ifdef BOOT_CONFIG_CHKSUM - romconf->chksum = calc_chksum((uint8*)romconf, (uint8*)&romconf->chksum); -#endif - // write new config sector - SPIEraseSector(BOOT_CONFIG_SECTOR); - SPIWrite(BOOT_CONFIG_SECTOR * SECTOR_SIZE, buffer, SECTOR_SIZE); - } - - // if gpio mode enabled check status of the gpio - if ((romconf->mode & MODE_GPIO_ROM) && (get_gpio16() == 0)) { - ets_printf("Booting GPIO-selected.\r\n"); - romToBoot = romconf->previous_rom; - /* - * Modified by Cesanta - * Make FD current - */ - updateConfig = TRUE; - romconf->fw_updated = 0; - romconf->is_first_boot = 0; - gpio_boot = TRUE; - } else if (romconf->current_rom >= romconf->count) { - // if invalid rom selected try rom 0 - ets_printf("Invalid rom selected, defaulting.\r\n"); - romToBoot = 0; - romconf->current_rom = 0; - romconf->fw_updated = 0; - romconf->is_first_boot = 0; - updateConfig = TRUE; - } else { - /* Modified by Cesanta */ - if (romconf->is_first_boot != 0) { - ets_printf("First boot, attempt %d\n", romconf->boot_attempts); - /* boot is unconfirmed */ - if (romconf->boot_attempts == 0) { - /* haven't try to load yes */ - ets_printf("Boot is unconfirmed\r\n"); - romconf->boot_attempts++; - } else { - ets_printf("Boot failed, fallback to fw #%d\r\n", - romconf->previous_rom); - romconf->current_rom = romconf->previous_rom; - /* clear fw update flag, to avoid post-update acttions */ - romconf->fw_updated = 0; - romconf->boot_attempts = 0; - } - - updateConfig = TRUE; - } - /* End of Cesanta modifications */ - // try rom selected in the config - romToBoot = romconf->current_rom; - } - - // try to find a good rom - do { - runAddr = check_image(romconf->roms[romToBoot]); - if (runAddr == 0) { - ets_printf("Rom %d is bad.\r\n", romToBoot); - if (gpio_boot) { - // don't switch to backup for gpio-selected rom - ets_printf("GPIO boot failed.\r\n"); - return 0; - } else { - // for normal mode try each previous rom - // until we find a good one or run out - updateConfig = TRUE; - romToBoot--; - if (romToBoot < 0) romToBoot = romconf->count - 1; - if (romToBoot == romconf->current_rom) { - // tried them all and all are bad! - ets_printf("No good rom available.\r\n"); - return 0; - } - } - } - } while (runAddr == 0); - - // re-write config, if required - if (updateConfig) { - romconf->current_rom = romToBoot; -#ifdef BOOT_CONFIG_CHKSUM - romconf->chksum = calc_chksum((uint8*)romconf, (uint8*)&romconf->chksum); -#endif - SPIEraseSector(BOOT_CONFIG_SECTOR); - SPIWrite(BOOT_CONFIG_SECTOR * SECTOR_SIZE, buffer, SECTOR_SIZE); - } - - ets_printf("Booting rom %d (0x%x).\r\n", romToBoot, romconf->roms[romToBoot]); - // copy the loader to top of iram - ets_memcpy((void*)_text_addr, _text_data, _text_len); - // return address to load from - return runAddr; - -} - -#ifdef BOOT_NO_ASM - -// small stub method to ensure minimum stack space used -void call_user_start(void) { - uint32 addr; - stage2a *loader; - - addr = find_image(); - if (addr != 0) { - loader = (stage2a*)entry_addr; - loader(addr); - } -} - -#else - -// assembler stub uses no stack space -// works with gcc -void call_user_start(void) { - __asm volatile ( - "mov a15, a0\n" // store return addr, hope nobody wanted a15! - "call0 find_image\n" // find a good rom to boot - "mov a0, a15\n" // restore return addr - "bnez a2, 1f\n" // ?success - "ret\n" // no, return - "1:\n" // yes... - "movi a3, entry_addr\n" // actually gives us a pointer to entry_addr - "l32i a3, a3, 0\n" // now really load entry_addr - "jx a3\n" // now jump to it - ); -} - -#endif diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot.h b/src/common/platforms/esp8266/rboot/rboot/rboot.h deleted file mode 100644 index 3949d74e55af6f0b3af147f85be675433a71676c..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_H_ -#define CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_H_ - -////////////////////////////////////////////////// -// rBoot open source boot loader for ESP8266. -// Copyright 2015 Richard A Burton -// richardaburton@gmail.com -// See license.txt for license terms. -////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif - -// uncomment to use only c code -// if you aren't using gcc you may need to do this -//#define BOOT_NO_ASM - -// uncomment to have a checksum on the boot config -//#define BOOT_CONFIG_CHKSUM - -// uncomment to enable big flash support (>1MB) -//#define BOOT_BIG_FLASH - -// uncomment to include .irom0.text section in the checksum -// roms must be built with esptool2 using -iromchksum option -//#define BOOT_IROM_CHKSUM - -// increase if required -#define MAX_ROMS 4 - -#define CHKSUM_INIT 0xef - -#define SECTOR_SIZE 0x1000 - -#ifndef BOOT_CONFIG_ADDR -#define BOOT_CONFIG_ADDR 0x1000 -#endif - -#define BOOT_CONFIG_SECTOR (BOOT_CONFIG_ADDR / SECTOR_SIZE) - -#define BOOT_CONFIG_MAGIC 0xe1 -#define BOOT_CONFIG_VERSION 0x01 - -#define MODE_STANDARD 0x00 -#define MODE_GPIO_ROM 0x01 - -// boot config structure -// rom addresses must be multiples of 0x1000 (flash sector aligned) -// without BOOT_BIG_FLASH only the first 8Mbit of the chip will be memory mapped -// so rom slots containing .irom0.text sections must remain below 0x100000 -// slots beyond this will only be accessible via spi read calls, so -// use these for stored resources, not code -// with BOOT_BIG_FLASH the flash will be mapped in chunks of 8MBit, so roms can -// be anywhere, but must not straddle two 8MBit blocks -typedef struct { - uint8 magic; // our magic - uint8 version; // config struct version - uint8 mode; // boot loader mode - uint8 current_rom; // currently selected rom - uint8 gpio_rom; // rom to use for gpio boot - uint8 count; // number of roms in use - uint8 previous_rom; // previously selected rom - uint8 is_first_boot; - uint8 boot_attempts; - uint8 fw_updated; - uint8 padding[2]; - uint32 roms[MAX_ROMS]; // flash addresses of the roms - uint32 roms_sizes[MAX_ROMS]; // sizes of the roms - uint32 fs_addresses[MAX_ROMS]; // file system addresses - uint32 fs_sizes[MAX_ROMS]; // file system sizes - uint32 user_flags; -#ifdef BOOT_CONFIG_CHKSUM - uint8 chksum; // config chksum -#endif -} rboot_config; - -#ifdef __cplusplus -} -#endif - -#endif /* CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_H_ */ diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot.ld b/src/common/platforms/esp8266/rboot/rboot/rboot.ld deleted file mode 100644 index 5e257404fb1017a2f828f8ca8ad26841a7473b09..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot.ld +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "eagle.app.v6.ld" -INCLUDE "rboot_rom.ld" diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot.mk b/src/common/platforms/esp8266/rboot/rboot/rboot.mk deleted file mode 100644 index 419ba5a8dff9b268f4f6f09ab7cbddb90cc99484..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot.mk +++ /dev/null @@ -1,89 +0,0 @@ -# -# Makefile for rBoot -# https://github.com/raburton/esp8266 -# - -ESPTOOL2 ?= ../../build/esptool2 -SDK_BASE ?= /opt/Espressif/ESP8266_SDK -SPI_SIZE ?= -RBOOT_INTEGRATION ?= -RBOOT_EXTRA_INCDIR ?= - -# RBOOT_BUILD_BASE and RBOOT_GEN_BASE should be provided via makefile parameters -RBOOT_BUILD_BASE ?= -# RBOOT_GEN_BASE is the directory for generated inputs -RBOOT_GEN_BASE ?= - -ifndef XTENSA_BINDIR -CC := xtensa-lx106-elf-gcc -LD := xtensa-lx106-elf-gcc -else -CC := $(addprefix $(XTENSA_BINDIR)/,xtensa-lx106-elf-gcc) -LD := $(addprefix $(XTENSA_BINDIR)/,xtensa-lx106-elf-gcc) -endif -CC_WRAPPER ?= - -CFLAGS = -Os -Wpointer-arith -Wundef -Werror -Wl,-EL \ - -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals \ - -D__ets__ -DIRAM='__attribute__((section(".fast.text")))' \ - -DNOINSTR='__attribute__((no_instrument_function))' \ - -DICACHE_FLASH $(CFLAGS_EXTRA) - -LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -L $(SDK_BASE)/ld/ - -LD_SCRIPT = rboot.ld - -E2_OPTS = -quiet -bin -boot0 - -ifeq ($(RBOOT_BIG_FLASH),1) - CFLAGS += -DBOOT_BIG_FLASH -endif -ifeq ($(RBOOT_INTEGRATION),1) - CFLAGS += -DRBOOT_INTEGRATION -endif -ifeq ($(SPI_SIZE), 256K) - E2_OPTS += -256 -else ifeq ($(SPI_SIZE), 512K) - E2_OPTS += -512 -else ifeq ($(SPI_SIZE), 1M) - E2_OPTS += -1024 -else ifeq ($(SPI_SIZE), 2M) - E2_OPTS += -2048 -else ifeq ($(SPI_SIZE), 4M) - E2_OPTS += -4096 -endif - -RBOOT_EXTRA_INCDIR := $(addprefix -I,$(RBOOT_EXTRA_INCDIR)) - -.SECONDARY: - -all: $(RBOOT_BUILD_BASE)/rboot.bin - -$(RBOOT_BUILD_BASE)/rboot-stage2a.o: rboot-stage2a.c rboot-private.h rboot.h - @echo "CC $<" - @$(CC_WRAPPER) $(CC) $(CFLAGS) $(RBOOT_EXTRA_INCDIR) -c $< -o $@ - -$(RBOOT_BUILD_BASE)/rboot-stage2a.elf: $(RBOOT_BUILD_BASE)/rboot-stage2a.o - @echo "LD $@" - @$(CC_WRAPPER) $(LD) -Trboot-stage2a.ld $(LDFLAGS) -Wl,--start-group $^ -Wl,--end-group -o $@ - -$(RBOOT_GEN_BASE)/rboot-hex2a.h: $(RBOOT_BUILD_BASE)/rboot-stage2a.elf - @echo "E2 $@" - @$(ESPTOOL2) -quiet -header $< $@ .text - -$(RBOOT_BUILD_BASE)/rboot.o: rboot.c rboot-private.h rboot.h $(RBOOT_GEN_BASE)/rboot-hex2a.h - @echo "CC $<" - @$(CC) $(CFLAGS) -I$(RBOOT_GEN_BASE) $(RBOOT_EXTRA_INCDIR) -c $< -o $@ - -$(RBOOT_BUILD_BASE)/%.o: %.c %.h - @echo "CC $<" - @$(CC) $(CFLAGS) $(RBOOT_EXTRA_INCDIR) -c $< -o $@ - -$(RBOOT_BUILD_BASE)/%.elf: $(RBOOT_BUILD_BASE)/%.o - @echo "LD $@" - @$(LD) -T$(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $^ -Wl,--end-group -o $@ - -$(RBOOT_BUILD_BASE)/%.bin: $(RBOOT_BUILD_BASE)/%.elf - @echo "E2 $@" - @$(ESPTOOL2) $(E2_OPTS) $< $@ .text .rodata - diff --git a/src/common/platforms/esp8266/rboot/rboot/rboot_rom.ld b/src/common/platforms/esp8266/rboot/rboot/rboot_rom.ld deleted file mode 100644 index 69e862cc826b190d14c66ff4f681a23367ac51a3..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/rboot_rom.ld +++ /dev/null @@ -1,8 +0,0 @@ -PROVIDE ( ets_delay_us = 0x40002ecc ); -PROVIDE ( ets_memcpy = 0x400018b4 ); -PROVIDE ( ets_memset = 0x400018a4 ); -PROVIDE ( ets_printf = 0x400024cc ); -PROVIDE ( SPIEraseSector = 0x40004a00 ); -PROVIDE ( SPIRead = 0x40004b1c ); -PROVIDE ( SPIWrite = 0x40004a4c ); -PROVIDE ( uart_div_modify = 0x400039d8 ); diff --git a/src/common/platforms/esp8266/rboot/rboot/readme-api.txt b/src/common/platforms/esp8266/rboot/rboot/readme-api.txt deleted file mode 100644 index 230474819fe8a401dca7187f9bb57220d520faf4..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/readme-api.txt +++ /dev/null @@ -1,40 +0,0 @@ -rBoot - User API for rBoot on the ESP8266 ------------------------------------------- -by Richard A Burton, richardaburton@gmail.com -http://richard.burtons.org/ - -This provides a few simple APIs for getting & setting rBoot config and for -writing data from OTA updates. API source files are in the appcode directory. - -Actual OTA network code is implementation specific and no longer included in -rBoot itself, see the rBoot sample projects for this code (which you can then -use in your own projects). - - rboot_config rboot_get_config(); - Returns rboot_config (defined in rboot.h) allowing you to modify any values - in it, including the rom layout. - - bool rboot_set_config(rboot_config *conf); - Saves the rboot_config structure back to sector 2 of the flash, while - maintaining the contents of the rest of the sector. You can use the rest of - this sector for your app settings, as long as you protect this structure - when you do so. - - uint8 rboot_get_current_rom(); - Get the currently selected boot rom (the currently running rom, as long as - you haven't changed it since boot). - - bool rboot_set_current_rom(uint8 rom); - Set the current boot rom, which will be used when next restarted. - - rboot_write_status rboot_write_init(uint32 start_addr); - Call once before starting to pass data to write to the flash. start_addr is - the address on the SPI flash to write from. Returns a status structure which - must be passed back on each write. The contents of the structure should not - be modified by the calling code. - - bool rboot_write_flash(rboot_write_status *status, uint8 *data, uint16 len); - Call repeatedly to write data to the flash, starting at the address - specified on the prior call to rboot_write_init. Current write position is - tracked automatically. This method is likely to be called each time a packet - of OTA data is received over the network. diff --git a/src/common/platforms/esp8266/rboot/rboot/readme.txt b/src/common/platforms/esp8266/rboot/rboot/readme.txt deleted file mode 100644 index 944e1f21dcbea7fe182ec4af0ad6affc55a48f70..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rboot/rboot/readme.txt +++ /dev/null @@ -1,218 +0,0 @@ -rBoot - An open source boot loader for the ESP8266 --------------------------------------------------- -by Richard A Burton, richardaburton@gmail.com -http://richard.burtons.org/ - - -rBoot is designed to be a flexible open source boot loader, a replacement for -the binary blob supplied with the SDK. It has the following advantages over the -Espressif loader: - - - Open source (written in C). - - Supports up to 256 roms. - - Roms can be variable size. - - Able to test multiple roms to find a valid backup (without resetting). - - Flash layout can be changed on the fly (with care and appropriately linked - rom images). - - GPIO support for rom selection. - - Wastes no stack space (SDK boot loader uses 144 bytes). - - Documented config structure to allow easy editing from user code. - - Can validate .irom0.text section with checksum. - -Limitations ------------ -The ESP8266 can only map 8Mbits (1MB) of flash to memory, but which 8Mbits to -map is selectable. This allows individual roms to be up to 1MB in size, so long -as they do not straddle an 8Mbit boundary on the flash. This means you could -have four 1MB roms or 8 512KB roms on a 32Mbit flash (such as on the ESP-12), or -a combination. Note, however, that you could not have, for example, a 512KB rom -followed immediately by a 1MB rom because the 2nd rom would then straddle an -8MBit boundary. By default support for using more than the first 8Mbit of the -flash is disabled, because it requires several steps to get it working. See -below for instructions. - -Building --------- -A Makefile is included, which should work with the gcc xtensa cross compiler. -There are two source files, the first is compiled and included as data in the -second. When run this code is copied to memory and executed (there is a good -reason for this, see my blog for an explanation). The make file will handle this -for you, but you'll need my esptool2 (see github). - -To use the Makefile set SDK_BASE to point to the root of the Espressif SDK and -either set XTENSA_BINDIR to the gcc xtensa bin directory or include it in your -PATH. These can be set as environment variables or by editing the Makefile. - -Two small assembler stub functions allow the bootloader to launch the user code -without reserving any space on the stack (while the SDK boot loader uses 144 -bytes). This compiles fine with GCC, but if you use another compiler and it -will not compile/work for you then uncomment the #define BOOT_NO_ASM in rboot.h -to use a C version of these functions (this uses 32 bytes). - -Tested with SDK v1.3 and GCC v4.8.2. - -Installation ------------- -Simply write rboot.bin to the first sector of the flash. Remember to set your -flash size correctly with your chosen flash tool (e.g. for esptool.py use the --fs option). When run rBoot will create it's own config at the start of sector -two for a simple two rom system. You can can then write your two roms to flash -addresses 0x2000 and (half chip size + 0x2000). E.g. for 8Mbit flash: - esptool.py -fs 8m 0x0000 rboot.bin 0x2000 user1.bin 0x82000 user2.bin - -Note: your device may need other options specified. E.g. The nodemcu devkit v1.0 -(commonly, but incorrectly, sold as v2) also needs the "-fm dio" option. - -For more interesting rom layouts you'll need to write an rBoot config sector -manually, see next step. - -The two testload bin files can be flashed in place of normal user roms for -testing rBoot. You do not need these for normal use. - -rBoot Config ------------- -typedef struct { - uint8 magic; // our magic - uint8 version; // config struct version - uint8 mode; // boot loader mode - uint8 current_rom; // currently selected rom - uint8 gpio_rom; // rom to use for gpio boot - uint8 count; // number of roms in use - uint8 unused[2]; // padding - uint32 roms[MAX_ROMS]; // flash addresses of the roms -#ifdef BOOT_CONFIG_CHKSUM - uint8 chksum; // boot config chksum -#endif -} rboot_config; - -Write a config structure as above to address 0x1000 on the flash. If you want -more than 4 roms (default) just increase MAX_ROMS when you compile rBoot. -Think about how you intend to layout your flash before you start! -Rom addresses must be sector aligned i.e start on a multiple of 4096. - - - magic should have value 0xe1 (defined as BOOT_CONFIG_MAGIC). - - version is used in case the config structure changes after deployment. It is - defined as 0x01 (BOOT_CONFIG_VERSION). I don't intend to increase this, but - you should if you choose to reflash the bootloader after deployment and - the config structure has changed. - - mode can be 0x00 (MODE_STANDARD) or 0x01 (MODE_GPIO_ROM). If you set GPIO - you will need to set gpio_rom as well. The sample GPIO code uses GPIO 16 on - a nodemcu dev board, if you want to use a different GPIO you'll need to - adapt the code in rBoot slightly. - - current_rom is the rom to boot, numbered 0 to count-1. - - gpio_rom is the rom to boot when the GPIO is triggered at boot. - - count is the number of roms available (may be less than MAX_ROMS, but not - more). - - unused[2] is padding so the uint32 rom addresses are 4 bytes aligned. - - roms is the array of flash address for the roms. The default generated - config will contain two entries: 0x00002000 and 0x00082000. - - chksum (if enabled, not by deafult) should be the xor of 0xef followed by - each of the bytes of the config structure up to (but obviously not - including) the chksum byte itself. - -Linking user code ------------------ -Each rom will need to be linked with an appropriate linker file, specifying -where it will reside on the flash. If you are only flashing one rom to multiple -places on the flash it must be linked multiple times to produce the set of rom -images. This is the same as with the SDK loader. - -Because there are endless possibilities for layout with this loader I don't -supply sample linker files. Instead I'll tell you how to make them. - -For each rom slot on the flash take a copy of the eagle.app.v6.ld linker script -from the sdk. You then need to modify just one line in it for each rom: - irom0_0_seg : org = 0x40240000, len = 0x3C000 - -Change the org address to be 0x40200000 (base memory mapped location of the -flash) + flash address + 0x10 (offset of data after the header). -The logical place for your first rom is the third sector, address 0x2000. - 0x40200000 + 0x2000 + 0x10 = 0x40202010 -If you use the default generated config the loader will expect to find the -second rom at flash address half-chip-size + 0x2000 (e.g. 0x82000 on an 8MBit -flash) so the irom0_0_seg should be: - 0x40200000 + 0x82000 + 0x10 = 0x40282010 -Due to the limitation of mapped flash (max 8MBit) if you use a larger chip and -do not have big flash support enabled the second rom in the default config will -still be placed at 0x082000, not truly half-chip-size + 0x2000. -Ideally you should also adjust the len to help detect over sized sections at -link time, but more important is the overall size of the rom which you need to -ensure fits in the space you have allocated for it in your flash layout plan. - -Then simply compile and link as you would normally for OTA updates with the SDK -boot loader, except using the linker scripts you've just prepared rather than -the ones supplied with the SDK. Remember when building roms to create them as -'new' type roms (for use with SDK boot loader v1.2+). Or if using my esptool2 -use the -boot2 option. Note: the test loads included with rBoot are built with --boot0 because they do not contain a .irom0.text section (and so the value of -irom0_0_seg in the linker file is irrelevant to them) but 'normal' user apps -always do. - -irom checksum -------------- -The SDK boot loader checksum only covers sections loaded into ram (data and some -code). Most of the SDK and user code remains on the flash and that is not -included in the checksum. This means you could attempt to boot a corrupt rom -and, because it looks ok to the boot loader, there will be no attempt to switch -to a backup rom. rBoot improves on this by allowing the .irom0.text section to -be included in the checksum. To enable this uncomment #define BOOT_IROM_CHKSUM -in rboot.h and build your roms with esptool2 using the -iromchksum option. - -Big flash support ------------------ -This only needs to be enabled if you wish to be able to memory map more than the -first 8MBit of the flash. Note you can still only map 8Mbit at a time. Use this -if you want to have multiple 1MB roms, or more smaller roms than will fit in -8Mbits. If you have a large flash but only need, for example, two 512KB roms you -do not need to enable this mode. - -Support in rBoot is enabled by uncommenting the #define BOOT_BIG_FLASH in -rboot.h. - -Thinking about your linker files is either simpler or more complicated, -depending on your usage of the flash. If you intend to use multiple 1MB roms you -will only need one linker file and you only need to link once for OTA updates. -Although when you perform an OTA update the rom will be written to a different -position on the flash, each 8Mbit of flash is mapped (separately) to 0x40200000. -So when any given rom is run the code will appear at the same place in memory -regardless of where it is on the flash. Your base address for the linker would -be 0x40202010. (Actually all but the first rom could base at 0x40200010 (because -they don't need to leave space for rBoot and config) but then you're just making -it more complicated again!) -If you wanted eight 512KB roms you would need two linker files - one for the -first half of any given 8Mbits of flash and another for the second half. Just -remember you are really laying out within a single 8MBit area, which can then be -replicated multiple times on the flash. - -Now the clever bit - rBoot needs to hijack the memory mapping code to select -which 8Mbits gets mapped. There is no API for this, but we can override the SDK -function. First we need to slightly modify the SDK library libmain.a, like so: - - xtensa-lx106-elf-objcopy -W Cache_Read_Enable_New libmain.a libmain2.a - -This produces a version of libmain with a 'weakened' Cache_Read_Enable_New -function, which we can then override with our own. Modify your Makefile to link -against the library main2 instead of main. -Next add rboot-bigflash.c (from the appcode directory) & rboot.h to your project -- this adds the replacement Cache_Read_Enable_New to your code. - -Getting gcc to apply the override correctly can be slightly tricky (I'm not sure -why, it shouldn't be). One option is to add "-u Cache_Read_Enable_New" to your -LD_FLAGS and change the order of objects on the LD command so your objects/.a -file is before the libraries. Another way that seems easier was to #include -rboot-bigflash.c into the main .c file, rather than compiling it to a separate -object file. I can't make any sense of that, but I suggest you uncomment the -message in the Cache_Read_Enable_New function when you first build with it, to -make sure you are getting your version into the rom. - -Now when rBoot starts your rom, the SDK code linked in it that normally performs -the memory mapping will delegate part of that task to rBoot code (linked in your -rom, not in rBoot itself) to choose which part of the flash to map. - -Integration into other frameworks ---------------------------------- -If you wish to integrate rBoot into a development framework (e.g. Sming) you -can set the define RBOOT_INTEGRATION and at compile time the file -rboot-integration.h will be included into the source. This should allow you to -set some platform specific options without having to modify the source of rBoot -which makes it easier to integrate and maintain. diff --git a/src/common/platforms/esp8266/rom/.gitattributes b/src/common/platforms/esp8266/rom/.gitattributes deleted file mode 100644 index b2dd2258c3c4edbbb3bff339a3b861ada74c08e3..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rom/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -rom.bin -nodiff -rom.elf -nodiff diff --git a/src/common/platforms/esp8266/rom/disasm.sh b/src/common/platforms/esp8266/rom/disasm.sh deleted file mode 100755 index 50c06f2fe8c789ee7fb7449644e56f906d4dd0ff..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rom/disasm.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -xtensa-lx106-elf-gcc -Wl,-N,-Ttext,0x40000000 -nostdlib rom.S -o rom.elf && \ - xtensa-lx106-elf-objdump -d rom.elf > ESP8266_ROM.txt diff --git a/src/common/platforms/esp8266/rom/rom.S b/src/common/platforms/esp8266/rom/rom.S deleted file mode 100644 index ac275960e9ae19984f5abe2ffa7b09d149b9eb8d..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rom/rom.S +++ /dev/null @@ -1,101 +0,0 @@ -.text -.org 0 -.globl _start - -// xtensa-esp108-elf-gcc -Wl,-N,-Ttext,0x40000000 -nostdlib rom.S -o rom.elf - -here = . -#define PROVIDE(name, addr) name = here + addr - 0x40000000 - -#include "rom_functions.S" - -PROVIDE(SPI_chip_erase, 0x40004080) -PROVIDE(SPIFlashModeConfig, 0x40004568) - -PROVIDE(_c_0x80000000, 0x400003a4) -PROVIDE(_c_0x00400000, 0x40000414) -PROVIDE(_c_0x00ffffff, 0x40000418) -PROVIDE(_p_user_start, 0x40000fb8) // 0x3fffdcd0 -PROVIDE(_c_0x60000200, 0x40000fc4) -PROVIDE(_s_ets_build, 0x40000fc8) // Jan 8 2013 -PROVIDE(_s_ets_banner, 0x40000fcc) // ets %s,rst cause:%d, boot mode:(%d,%d) -PROVIDE(_s_format_s_s, 0x40000fd0) // %s %s -PROVIDE(_s_ets_main_c, 0x40000fd4) // ets_main.c -PROVIDE(_s_user_code_done, 0x40000fe0) // user code done -PROVIDE(_s_wdt_reset, 0x40000fe4) // wdt reset -PROVIDE(_s_unk_reset, 0x40000fe8) // unknown reset -PROVIDE(_l_boot_mode_6, 0x40001044) -PROVIDE(_l_boot_mode_0_1_2_3, 0x4000104a) -PROVIDE(_l_rst_cause_ge_3, 0x40001075) -PROVIDE(_l_rst_cause_ge_3_lt_7, 0x40001084) -PROVIDE(_l_rst_cause_3_soft_wdt, 0x4000108a) -PROVIDE(_l_load_from_flash, 0x400010a8) -PROVIDE(_l_run_user_code, 0x400010be) -PROVIDE(_l_wdt_reset, 0x40001118) -PROVIDE(_l_rst_cause_1_2, 0x40001121) -PROVIDE(_l_rst_cause_unknown, 0x40001130) -PROVIDE(_l_boot_mode_7, 0x40001148) -PROVIDE(_l_boot_mode_4, 0x40001150) -PROVIDE(_c_0x60000600, 0x4000115c) -PROVIDE(_s_waiting_for_host, 0x4000119c) // waiting for host -PROVIDE(_x_unk1160, 0x40001160) -PROVIDE(_c_0x3fffa000_uart_buf, 0x400011a0) -PROVIDE(_c_0x2000, 0x400011a4) -PROVIDE(_c_0x40100000, 0x400011a8) // default user_start -PROVIDE(_x_boot2, 0x400011ac) // arg: 0x3fffdcd0 (&user_start) -PROVIDE(_l_strapping_2_eq_0, 0x400011d2) -PROVIDE(_l_124d, 0x4000124d) -PROVIDE(_l_boot_mode2_eq_2, 0x40001265) -PROVIDE(_l_boot_mode_eq_2, 0x40001268) -PROVIDE(_l_boot_mode_eq_1, 0x4000127a) -PROVIDE(_l_setup_uart, 0x40001291) -PROVIDE(_l_boot_mode_eq_3, 0x400012b0) -PROVIDE(_x_load_from_flash, 0x40001308) -PROVIDE(_c_0x00001000, 0x40001994) -PROVIDE(_c_0xffdfffff, 0x400025dc) -PROVIDE(_l_rr_not_dsleep, 0x40002624) -PROVIDE(_c_100000, 0x40002664) -PROVIDE(_c_0x3feffe00, 0x40002e5c) -PROVIDE(_p_cpu_freq, 0x40002ec8) -PROVIDE(_x_wdt_interval, 0x40002f14) // arg: 3 -> 11, 6 -> 12, 12 -> 13 -PROVIDE(_p_wdt_cfg, 0x40002f30) -PROVIDE(_wdt_soft_timer_fn2, 0x40002f3c) -PROVIDE(_l_wdt_soft_timer_fn2_exit, 0x40002f59) -PROVIDE(_l_wdt_soft_timer_fn2_feed, 0x40002f60) -PROVIDE(_l_wdt_soft_timer_fn2_mode2_stage1_feed, 0x40002f74) -PROVIDE(_wdt_soft_timer_fn, 0x40002f88) -PROVIDE(_p_wdt_soft_timer_fn, 0x40002f98) -PROVIDE(_p_wdt_soft_timer, 0x40002f9c) // 0x3fffdde0 -PROVIDE(_l_skip_wdt_imask, 0x40002fc4) -PROVIDE(_l_wdt_enable_and_exit, 0x40002fea) -PROVIDE(_l_wdt_mode_1, 0x4000309c) -PROVIDE(_l_wdt_mode_2_4, 0x4000300a) -PROVIDE(_l_wdt_mode_3, 0x40003060) -PROVIDE(_l_recv_req, 0x400033a1) -PROVIDE(_l_send_response, 0x400033be) -PROVIDE(_l_send_resp_pkt, 0x400033da) -PROVIDE(_l_process_req, 0x40003424) -PROVIDE(_l_34a3, 0x400034a3) -PROVIDE(_l_34b9, 0x400034b9) -PROVIDE(_c_0x00001800, 0x40003534) -PROVIDE(_c_0x60000a00, 0x40003f54) -PROVIDE(_c_0x01000000, 0x400040bc) -PROVIDE(_x_SPI_erase_sector, 0x400040c0) -PROVIDE(_l_SPI_erase_sector_align_ok, 0x400040dc) -PROVIDE(_c_0x00800000, 0x4000411c) -PROVIDE(_x_SPI_erase_block, 0x40004120) -PROVIDE(_c_0x20000000, 0x4000416c) -PROVIDE(_c_0x08000000, 0x400043c4) -PROVIDE(_c_0x04000000, 0x400043fc) -PROVIDE(_c_0x40000000, 0x40004438) -PROVIDE(_p_flashchip, 0x40004874) -PROVIDE(_s_bootup, 0x400054cc) // bootup , addr 0x%08x -PROVIDE(_p_sip_ctx, 0x40005130) -PROVIDE(_l_sip_cmd_out, 0x4000550a) -PROVIDE(_c_0x00010000, 0x40005de0) - -.text - -_start: -.incbin "rom.bin" -_end: diff --git a/src/common/platforms/esp8266/rom/rom.bin b/src/common/platforms/esp8266/rom/rom.bin deleted file mode 100644 index fe4d1956655081254d74cee85fc9341e84765e60..0000000000000000000000000000000000000000 Binary files a/src/common/platforms/esp8266/rom/rom.bin and /dev/null differ diff --git a/src/common/platforms/esp8266/rom/rom.elf b/src/common/platforms/esp8266/rom/rom.elf deleted file mode 100755 index 6a21116b321780589032452c7854e66d5b333804..0000000000000000000000000000000000000000 Binary files a/src/common/platforms/esp8266/rom/rom.elf and /dev/null differ diff --git a/src/common/platforms/esp8266/rom/rom_functions.S b/src/common/platforms/esp8266/rom/rom_functions.S deleted file mode 100644 index bf86dad464689c86feb4e23803f2101af878f6c8..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/rom/rom_functions.S +++ /dev/null @@ -1,347 +0,0 @@ -PROVIDE ( Cache_Read_Disable , 0x400047f0 ); -PROVIDE ( Cache_Read_Enable , 0x40004678 ); -PROVIDE ( FilePacketSendReqMsgProc , 0x400035a0 ); -PROVIDE ( FlashDwnLdParamCfgMsgProc , 0x4000368c ); -PROVIDE ( FlashDwnLdStartMsgProc , 0x40003538 ); -PROVIDE ( FlashDwnLdStopReqMsgProc , 0x40003658 ); -PROVIDE ( GetUartDevice , 0x40003f4c ); -PROVIDE ( MD5Final , 0x40009900 ); -PROVIDE ( MD5Init , 0x40009818 ); -PROVIDE ( MD5Update , 0x40009834 ); -PROVIDE ( MemDwnLdStartMsgProc , 0x400036c4 ); -PROVIDE ( MemDwnLdStopReqMsgProc , 0x4000377c ); -PROVIDE ( MemPacketSendReqMsgProc , 0x400036f0 ); -PROVIDE ( RcvMsg , 0x40003eac ); -PROVIDE ( SHA1Final , 0x4000b648 ); -PROVIDE ( SHA1Init , 0x4000b584 ); -PROVIDE ( SHA1Transform , 0x4000a364 ); -PROVIDE ( SHA1Update , 0x4000b5a8 ); -PROVIDE ( SPI_read_status , 0x400043c8 ); -PROVIDE ( SPI_write_status , 0x40004400 ); -PROVIDE ( SPI_write_enable , 0x4000443c ); -PROVIDE ( Wait_SPI_Idle , 0x4000448c ); -PROVIDE ( SPIEraseArea , 0x40004b44 ); -PROVIDE ( SPIEraseBlock , 0x400049b4 ); -PROVIDE ( SPIEraseChip , 0x40004984 ); -PROVIDE ( SPIEraseSector , 0x40004a00 ); -PROVIDE ( SPILock , 0x400048a8 ); -PROVIDE ( SPIParamCfg , 0x40004c2c ); -PROVIDE ( SPIRead , 0x40004b1c ); -PROVIDE ( SPIReadModeCnfig , 0x400048ec ); -PROVIDE ( SPIUnlock , 0x40004878 ); -PROVIDE ( SPIWrite , 0x40004a4c ); -PROVIDE ( SelectSpiFunction , 0x40003f58 ); -PROVIDE ( SendMsg , 0x40003cf4 ); -PROVIDE ( UartConnCheck , 0x40003230 ); -PROVIDE ( UartConnectProc , 0x400037a0 ); -PROVIDE ( UartDwnLdProc , 0x40003368 ); -PROVIDE ( UartGetCmdLn , 0x40003ef4 ); -PROVIDE ( UartRegReadProc , 0x4000381c ); -PROVIDE ( UartRegWriteProc , 0x400037ac ); -PROVIDE ( UartRxString , 0x40003c30 ); -PROVIDE ( Uart_Init , 0x40003a14 ); -PROVIDE ( _DebugExceptionVector , 0x40000010 ); -PROVIDE ( _DoubleExceptionVector , 0x40000070 ); -PROVIDE ( _KernelExceptionVector , 0x40000030 ); -PROVIDE ( _NMIExceptionVector , 0x40000020 ); -PROVIDE ( _ResetHandler , 0x400000a4 ); -PROVIDE ( _ResetVector , 0x40000080 ); -PROVIDE ( _UserExceptionVector , 0x40000050 ); -PROVIDE ( __adddf3 , 0x4000c538 ); -PROVIDE ( __addsf3 , 0x4000c180 ); -PROVIDE ( __divdf3 , 0x4000cb94 ); -PROVIDE ( __divdi3 , 0x4000ce60 ); -PROVIDE ( __divsi3 , 0x4000dc88 ); -PROVIDE ( __extendsfdf2 , 0x4000cdfc ); -PROVIDE ( __fixdfsi , 0x4000ccb8 ); -PROVIDE ( __fixunsdfsi , 0x4000cd00 ); -PROVIDE ( __fixunssfsi , 0x4000c4c4 ); -PROVIDE ( __floatsidf , 0x4000e2f0 ); -PROVIDE ( __floatsisf , 0x4000e2ac ); -PROVIDE ( __floatunsidf , 0x4000e2e8 ); -PROVIDE ( __floatunsisf , 0x4000e2a4 ); -PROVIDE ( __muldf3 , 0x4000c8f0 ); -PROVIDE ( __muldi3 , 0x40000650 ); -PROVIDE ( __mulsf3 , 0x4000c3dc ); -PROVIDE ( __subdf3 , 0x4000c688 ); -PROVIDE ( __subsf3 , 0x4000c268 ); -PROVIDE ( __truncdfsf2 , 0x4000cd5c ); -PROVIDE ( __udivdi3 , 0x4000d310 ); -PROVIDE ( __udivsi3 , 0x4000e21c ); -PROVIDE ( __umoddi3 , 0x4000d770 ); -PROVIDE ( __umodsi3 , 0x4000e268 ); -PROVIDE ( __umulsidi3 , 0x4000dcf0 ); -PROVIDE ( _rom_store , 0x4000e388 ); -PROVIDE ( _rom_store_table , 0x4000e328 ); -PROVIDE ( _start , 0x4000042c ); -PROVIDE ( _xtos_alloca_handler , 0x4000dbe0 ); -PROVIDE ( _xtos_c_wrapper_handler , 0x40000598 ); -PROVIDE ( _xtos_cause3_handler , 0x40000590 ); -PROVIDE ( _xtos_ints_off , 0x4000bda4 ); -PROVIDE ( _xtos_ints_on , 0x4000bd84 ); -PROVIDE ( _xtos_l1int_handler , 0x4000048c ); -PROVIDE ( _xtos_p_none , 0x4000dbf8 ); -PROVIDE ( _xtos_restore_intlevel , 0x4000056c ); -PROVIDE ( _xtos_return_from_exc , 0x4000dc54 ); -PROVIDE ( _xtos_set_exception_handler , 0x40000454 ); -PROVIDE ( _xtos_set_interrupt_handler , 0x4000bd70 ); -PROVIDE ( _xtos_set_interrupt_handler_arg , 0x4000bd28 ); -PROVIDE ( _xtos_set_intlevel , 0x4000dbfc ); -PROVIDE ( _xtos_set_min_intlevel , 0x4000dc18 ); -PROVIDE ( _xtos_set_vpri , 0x40000574 ); -PROVIDE ( _xtos_syscall_handler , 0x4000dbe4 ); -PROVIDE ( _xtos_unhandled_exception , 0x4000dc44 ); -PROVIDE ( _xtos_unhandled_interrupt , 0x4000dc3c ); -PROVIDE ( aes_decrypt , 0x400092d4 ); -PROVIDE ( aes_decrypt_deinit , 0x400092e4 ); -PROVIDE ( aes_decrypt_init , 0x40008ea4 ); -PROVIDE ( aes_unwrap , 0x40009410 ); -PROVIDE ( base64_decode , 0x40009648 ); -PROVIDE ( base64_encode , 0x400094fc ); -PROVIDE ( bzero , 0x4000de84 ); -PROVIDE ( cmd_parse , 0x40000814 ); -PROVIDE ( conv_str_decimal , 0x40000b24 ); -PROVIDE ( conv_str_hex , 0x40000cb8 ); -PROVIDE ( convert_para_str , 0x40000a60 ); -PROVIDE ( dtm_get_intr_mask , 0x400026d0 ); -PROVIDE ( dtm_params_init , 0x4000269c ); -PROVIDE ( dtm_set_intr_mask , 0x400026c8 ); -PROVIDE ( dtm_set_params , 0x400026dc ); -PROVIDE ( eprintf , 0x40001d14 ); -PROVIDE ( eprintf_init_buf , 0x40001cb8 ); -PROVIDE ( eprintf_to_host , 0x40001d48 ); -PROVIDE ( est_get_printf_buf_remain_len , 0x40002494 ); -PROVIDE ( est_reset_printf_buf_len , 0x4000249c ); -PROVIDE ( ets_bzero , 0x40002ae8 ); -PROVIDE ( ets_char2xdigit , 0x40002b74 ); -PROVIDE ( ets_delay_us , 0x40002ecc ); -PROVIDE ( ets_enter_sleep , 0x400027b8 ); -PROVIDE ( ets_external_printf , 0x40002578 ); -PROVIDE ( ets_get_cpu_frequency , 0x40002f0c ); -PROVIDE ( ets_getc , 0x40002bcc ); -PROVIDE ( ets_install_external_printf , 0x40002450 ); -PROVIDE ( ets_install_putc1 , 0x4000242c ); -PROVIDE ( ets_install_putc2 , 0x4000248c ); -PROVIDE ( ets_install_uart_printf , 0x40002438 ); -PROVIDE ( ets_intr_lock , 0x40000f74 ); -PROVIDE ( ets_intr_unlock , 0x40000f80 ); -PROVIDE ( ets_isr_attach , 0x40000f88 ); -PROVIDE ( ets_isr_mask , 0x40000f98 ); -PROVIDE ( ets_isr_unmask , 0x40000fa8 ); -PROVIDE ( ets_memcmp , 0x400018d4 ); -PROVIDE ( ets_memcpy , 0x400018b4 ); -PROVIDE ( ets_memmove , 0x400018c4 ); -PROVIDE ( ets_memset , 0x400018a4 ); -PROVIDE ( ets_post , 0x40000e24 ); -PROVIDE ( ets_printf , 0x400024cc ); -PROVIDE ( ets_putc , 0x40002be8 ); -PROVIDE ( ets_rtc_int_register , 0x40002a40 ); -PROVIDE ( ets_run , 0x40000e04 ); -PROVIDE ( ets_set_idle_cb , 0x40000dc0 ); -PROVIDE ( ets_set_user_start , 0x40000fbc ); -PROVIDE ( ets_str2macaddr , 0x40002af8 ); -PROVIDE ( ets_strcmp , 0x40002aa8 ); -PROVIDE ( ets_strcpy , 0x40002a88 ); -PROVIDE ( ets_strlen , 0x40002ac8 ); -PROVIDE ( ets_strncmp , 0x40002ab8 ); -PROVIDE ( ets_strncpy , 0x40002a98 ); -PROVIDE ( ets_strstr , 0x40002ad8 ); -PROVIDE ( ets_task , 0x40000dd0 ); -PROVIDE ( ets_timer_arm , 0x40002cc4 ); -PROVIDE ( ets_timer_disarm , 0x40002d40 ); -PROVIDE ( ets_timer_done , 0x40002d80 ); -PROVIDE ( ets_timer_handler_isr , 0x40002da8 ); -PROVIDE ( ets_timer_init , 0x40002e68 ); -PROVIDE ( ets_timer_setfn , 0x40002c48 ); -PROVIDE ( ets_uart_printf , 0x40002544 ); -PROVIDE ( ets_update_cpu_frequency , 0x40002f04 ); -PROVIDE ( ets_vprintf , 0x40001f00 ); -PROVIDE ( ets_wdt_disable , 0x400030f0 ); -PROVIDE ( ets_wdt_enable , 0x40002fa0 ); -PROVIDE ( ets_wdt_get_mode , 0x40002f34 ); -PROVIDE ( ets_wdt_init , 0x40003170 ); -PROVIDE ( ets_wdt_restore , 0x40003158 ); -PROVIDE ( ets_write_char , 0x40001da0 ); -PROVIDE ( get_first_seg , 0x4000091c ); -PROVIDE ( gpio_init , 0x40004c50 ); -PROVIDE ( gpio_input_get , 0x40004cf0 ); -PROVIDE ( gpio_intr_ack , 0x40004dcc ); -PROVIDE ( gpio_intr_handler_register , 0x40004e28 ); -PROVIDE ( gpio_intr_pending , 0x40004d88 ); -PROVIDE ( gpio_intr_test , 0x40004efc ); -PROVIDE ( gpio_output_set , 0x40004cd0 ); -PROVIDE ( gpio_pin_intr_state_set , 0x40004d90 ); -PROVIDE ( gpio_pin_wakeup_disable , 0x40004ed4 ); -PROVIDE ( gpio_pin_wakeup_enable , 0x40004e90 ); -PROVIDE ( gpio_register_get , 0x40004d5c ); -PROVIDE ( gpio_register_set , 0x40004d04 ); -PROVIDE ( hmac_md5 , 0x4000a2cc ); -PROVIDE ( hmac_md5_vector , 0x4000a160 ); -PROVIDE ( hmac_sha1 , 0x4000ba28 ); -PROVIDE ( hmac_sha1_vector , 0x4000b8b4 ); -PROVIDE ( lldesc_build_chain , 0x40004f40 ); -PROVIDE ( lldesc_num2link , 0x40005050 ); -PROVIDE ( lldesc_set_owner , 0x4000507c ); -PROVIDE ( main , 0x40000fec ); -PROVIDE ( md5_vector , 0x400097ac ); -PROVIDE ( mem_calloc , 0x40001c2c ); -PROVIDE ( mem_free , 0x400019e0 ); -PROVIDE ( mem_init , 0x40001998 ); -PROVIDE ( mem_malloc , 0x40001b40 ); -PROVIDE ( mem_realloc , 0x40001c6c ); -PROVIDE ( mem_trim , 0x40001a14 ); -PROVIDE ( mem_zalloc , 0x40001c58 ); -PROVIDE ( memcmp , 0x4000dea8 ); -PROVIDE ( memcpy , 0x4000df48 ); -PROVIDE ( memmove , 0x4000e04c ); -PROVIDE ( memset , 0x4000e190 ); -PROVIDE ( multofup , 0x400031c0 ); -PROVIDE ( pbkdf2_sha1 , 0x4000b840 ); -PROVIDE ( phy_get_romfuncs , 0x40006b08 ); -PROVIDE ( rand , 0x40000600 ); -PROVIDE ( rc4_skip , 0x4000dd68 ); -PROVIDE ( recv_packet , 0x40003d08 ); -PROVIDE ( remove_head_space , 0x40000a04 ); -PROVIDE ( rijndaelKeySetupDec , 0x40008dd0 ); -PROVIDE ( rijndaelKeySetupEnc , 0x40009300 ); -PROVIDE ( rom_abs_temp , 0x400060c0 ); -PROVIDE ( rom_ana_inf_gating_en , 0x40006b10 ); -PROVIDE ( rom_cal_tos_v50 , 0x40007a28 ); -PROVIDE ( rom_chip_50_set_channel , 0x40006f84 ); -PROVIDE ( rom_chip_v5_disable_cca , 0x400060d0 ); -PROVIDE ( rom_chip_v5_enable_cca , 0x400060ec ); -PROVIDE ( rom_chip_v5_rx_init , 0x4000711c ); -PROVIDE ( rom_chip_v5_sense_backoff , 0x4000610c ); -PROVIDE ( rom_chip_v5_tx_init , 0x4000718c ); -PROVIDE ( rom_dc_iq_est , 0x4000615c ); -PROVIDE ( rom_en_pwdet , 0x400061b8 ); -PROVIDE ( rom_get_bb_atten , 0x40006238 ); -PROVIDE ( rom_get_corr_power , 0x40006260 ); -PROVIDE ( rom_get_fm_sar_dout , 0x400062dc ); -PROVIDE ( rom_get_noisefloor , 0x40006394 ); -PROVIDE ( rom_get_power_db , 0x400063b0 ); -PROVIDE ( rom_i2c_readReg , 0x40007268 ); -PROVIDE ( rom_i2c_readReg_Mask , 0x4000729c ); -PROVIDE ( rom_i2c_writeReg , 0x400072d8 ); -PROVIDE ( rom_i2c_writeReg_Mask , 0x4000730c ); -PROVIDE ( rom_iq_est_disable , 0x40006400 ); -PROVIDE ( rom_iq_est_enable , 0x40006430 ); -PROVIDE ( rom_linear_to_db , 0x40006484 ); -PROVIDE ( rom_mhz2ieee , 0x400065a4 ); -PROVIDE ( rom_pbus_dco___SA2 , 0x40007bf0 ); -PROVIDE ( rom_pbus_debugmode , 0x4000737c ); -PROVIDE ( rom_pbus_enter_debugmode , 0x40007410 ); -PROVIDE ( rom_pbus_exit_debugmode , 0x40007448 ); -PROVIDE ( rom_pbus_force_test , 0x4000747c ); -PROVIDE ( rom_pbus_rd , 0x400074d8 ); -PROVIDE ( rom_pbus_set_rxgain , 0x4000754c ); -PROVIDE ( rom_pbus_set_txgain , 0x40007610 ); -PROVIDE ( rom_pbus_workmode , 0x40007648 ); -PROVIDE ( rom_pbus_xpd_rx_off , 0x40007688 ); -PROVIDE ( rom_pbus_xpd_rx_on , 0x400076cc ); -PROVIDE ( rom_pbus_xpd_tx_off , 0x400076fc ); -PROVIDE ( rom_pbus_xpd_tx_on , 0x40007740 ); -PROVIDE ( rom_pbus_xpd_tx_on__low_gain , 0x400077a0 ); -PROVIDE ( rom_phy_reset_req , 0x40007804 ); -PROVIDE ( rom_restart_cal , 0x4000781c ); -PROVIDE ( rom_rfcal_pwrctrl , 0x40007eb4 ); -PROVIDE ( rom_rfcal_rxiq , 0x4000804c ); -PROVIDE ( rom_rfcal_rxiq_set_reg , 0x40008264 ); -PROVIDE ( rom_rfcal_txcap , 0x40008388 ); -PROVIDE ( rom_rfcal_txiq , 0x40008610 ); -PROVIDE ( rom_rfcal_txiq_cover , 0x400088b8 ); -PROVIDE ( rom_rfcal_txiq_set_reg , 0x40008a70 ); -PROVIDE ( rom_rfpll_reset , 0x40007868 ); -PROVIDE ( rom_rfpll_set_freq , 0x40007968 ); -PROVIDE ( rom_rxiq_cover_mg_mp , 0x40008b6c ); -PROVIDE ( rom_rxiq_get_mis , 0x40006628 ); -PROVIDE ( rom_sar_init , 0x40006738 ); -PROVIDE ( rom_set_ana_inf_tx_scale , 0x4000678c ); -PROVIDE ( rom_set_channel_freq , 0x40006c50 ); -PROVIDE ( rom_set_loopback_gain , 0x400067c8 ); -PROVIDE ( rom_set_noise_floor , 0x40006830 ); -PROVIDE ( rom_set_rxclk_en , 0x40006550 ); -PROVIDE ( rom_set_txbb_atten , 0x40008c6c ); -PROVIDE ( rom_set_txclk_en , 0x4000650c ); -PROVIDE ( rom_set_txiq_cal , 0x40008d34 ); -PROVIDE ( rom_start_noisefloor , 0x40006874 ); -PROVIDE ( rom_start_tx_tone , 0x400068b4 ); -PROVIDE ( rom_stop_tx_tone , 0x4000698c ); -PROVIDE ( rom_tx_mac_disable , 0x40006a98 ); -PROVIDE ( rom_tx_mac_enable , 0x40006ad4 ); -PROVIDE ( rom_txtone_linear_pwr , 0x40006a1c ); -PROVIDE ( rom_write_rfpll_sdm , 0x400078dc ); -PROVIDE ( roundup2 , 0x400031b4 ); -PROVIDE ( rtc_enter_sleep , 0x40002870 ); -PROVIDE ( rtc_get_reset_reason , 0x400025e0 ); -PROVIDE ( rtc_intr_handler , 0x400029ec ); -PROVIDE ( rtc_set_sleep_mode , 0x40002668 ); -PROVIDE ( save_rxbcn_mactime , 0x400027a4 ); -PROVIDE ( save_tsf_us , 0x400027ac ); -PROVIDE ( send_packet , 0x40003c80 ); -PROVIDE ( sha1_prf , 0x4000ba48 ); -PROVIDE ( sha1_vector , 0x4000a2ec ); -PROVIDE ( sip_alloc_to_host_evt , 0x40005180 ); -PROVIDE ( sip_get_ptr , 0x400058a8 ); -PROVIDE ( sip_get_state , 0x40005668 ); -PROVIDE ( sip_init_attach , 0x4000567c ); -PROVIDE ( sip_install_rx_ctrl_cb , 0x4000544c ); -PROVIDE ( sip_install_rx_data_cb , 0x4000545c ); -PROVIDE ( sip_post , 0x400050fc ); -PROVIDE ( sip_post_init , 0x400056c4 ); -PROVIDE ( sip_reclaim_from_host_cmd , 0x4000534c ); -PROVIDE ( sip_reclaim_tx_data_pkt , 0x400052c0 ); -PROVIDE ( sip_send , 0x40005808 ); -PROVIDE ( sip_to_host_chain_append , 0x40005864 ); -PROVIDE ( sip_to_host_evt_send_done , 0x40005234 ); -PROVIDE ( slc_add_credits , 0x400060ac ); -PROVIDE ( slc_enable , 0x40005d90 ); -PROVIDE ( slc_from_host_chain_fetch , 0x40005f24 ); -PROVIDE ( slc_from_host_chain_recycle , 0x40005e94 ); -PROVIDE ( slc_init_attach , 0x40005c50 ); -PROVIDE ( slc_init_credit , 0x4000608c ); -PROVIDE ( slc_pause_from_host , 0x40006014 ); -PROVIDE ( slc_reattach , 0x40005c1c ); -PROVIDE ( slc_resume_from_host , 0x4000603c ); -PROVIDE ( slc_select_tohost_gpio , 0x40005dc0 ); -PROVIDE ( slc_select_tohost_gpio_mode , 0x40005db8 ); -PROVIDE ( slc_send_to_host_chain , 0x40005de4 ); -PROVIDE ( slc_set_host_io_max_window , 0x40006068 ); -PROVIDE ( slc_to_host_chain_recycle , 0x40005f10 ); -PROVIDE ( software_reset , 0x4000264c ); -PROVIDE ( spi_flash_attach , 0x40004644 ); -PROVIDE ( srand , 0x400005f0 ); -PROVIDE ( strcmp , 0x4000bdc8 ); -PROVIDE ( strcpy , 0x4000bec8 ); -PROVIDE ( strlen , 0x4000bf4c ); -PROVIDE ( strncmp , 0x4000bfa8 ); -PROVIDE ( strncpy , 0x4000c0a0 ); -PROVIDE ( strstr , 0x4000e1e0 ); -PROVIDE ( timer_insert , 0x40002c64 ); -PROVIDE ( uartAttach , 0x4000383c ); -PROVIDE ( uart_baudrate_detect , 0x40003924 ); -PROVIDE ( uart_buff_switch , 0x400038a4 ); -PROVIDE ( uart_div_modify , 0x400039d8 ); -PROVIDE ( uart_rx_intr_handler , 0x40003bbc ); -PROVIDE ( uart_rx_one_char , 0x40003b8c ); -PROVIDE ( uart_rx_one_char_block , 0x40003b64 ); -PROVIDE ( uart_rx_readbuff , 0x40003ec8 ); -PROVIDE ( uart_tx_one_char , 0x40003b30 ); -PROVIDE ( wepkey_128 , 0x4000bc40 ); -PROVIDE ( wepkey_64 , 0x4000bb3c ); -PROVIDE ( xthal_bcopy , 0x40000688 ); -PROVIDE ( xthal_copy123 , 0x4000074c ); -PROVIDE ( xthal_get_ccompare , 0x4000dd4c ); -PROVIDE ( xthal_get_ccount , 0x4000dd38 ); -PROVIDE ( xthal_get_interrupt , 0x4000dd58 ); -PROVIDE ( xthal_get_intread , 0x4000dd58 ); -PROVIDE ( xthal_memcpy , 0x400006c4 ); -PROVIDE ( xthal_set_ccompare , 0x4000dd40 ); -PROVIDE ( xthal_set_intclear , 0x4000dd60 ); -PROVIDE ( xthal_spill_registers_into_stack_nw , 0x4000e320 ); -PROVIDE ( xthal_window_spill , 0x4000e324 ); -PROVIDE ( xthal_window_spill_nw , 0x4000e320 ); - -PROVIDE ( Te0 , 0x3fffccf0 ); -PROVIDE ( UartDev , 0x3fffde10 ); -PROVIDE ( flashchip , 0x3fffc714); diff --git a/src/common/platforms/esp8266/stubs/Makefile b/src/common/platforms/esp8266/stubs/Makefile deleted file mode 100644 index f7a761223097f5c350326d7e301c3d23d88d6728..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2015 Cesanta Software Limited -# All rights reserved -# - -STUB = stub_hello.c -LIBS = -PARAMS = -CFLAGS = -PORT = /dev/ttyUSB0 - -BUILD_DIR = .build -COMMON_STUB_DIR = ../../esp -STUB_ELF = $(BUILD_DIR)/$(patsubst %.c,%.elf,$(notdir $(STUB))) -STUB_JSON ?= $(BUILD_DIR)/$(patsubst %.c,%.json,$(notdir $(STUB))) -SDK = $(shell cat ../../../../fw/platforms/esp8266/sdk.version) -XT_CC = xtensa-lx106-elf-gcc - -.PHONY: all clean run wrap - -all: $(STUB_ELF) - -$(STUB_ELF): $(STUB) $(LIBS) - @echo " CC $^ -> $@" - @[ -d $(BUILD_DIR) ] || mkdir $(BUILD_DIR) - docker run --rm -i -v $(CURDIR)/../../../..:/src $(SDK) //bin/bash -c \ - "cd /src/common/platforms/esp8266/stubs && \ - $(XT_CC) -std=c99 -Wall -Werror -Os -DESP8266 \ - -mtext-section-literals -mlongcalls -nostdlib -fno-builtin \ - -I. -I/src/common/platforms/esp -I/src/common/platforms/esp8266 \ - -I/opt/Espressif/ESP8266_SDK \ - -Wl,-static -ffunction-sections -lgcc -Wl,--gc-sections \ - -Tstub.ld $(CFLAGS) -o $@ $^" - -wrap: $(STUB_JSON) - -$(STUB_JSON): $(STUB_ELF) $(COMMON_STUB_DIR)/esptool.py - @echo " WRAP $< -> $@" - @docker run --rm -i -v $(CURDIR)/../../../..:/src $(SDK) //bin/bash -c \ - "cd /src/common/platforms/esp8266/stubs && \ - $(COMMON_STUB_DIR)/esptool.py wrap_stub $<" > $@ - -run: $(STUB_JSON) - @echo " RUN $< $(PARAMS) -> $(PORT)" - @docker run --rm -i --privileged -v $(CURDIR)/../../../..:/src $(SDK) //bin/bash -c \ - "cd /src/common/platforms/esp8266/stubs && \ - $(COMMON_STUB_DIR)/esptool.py --port $(PORT) run_stub $< $(PARAMS)" - -clean: - @rm -rf $(BUILD_DIR) diff --git a/src/common/platforms/esp8266/stubs/README.md b/src/common/platforms/esp8266/stubs/README.md deleted file mode 100644 index 9265771237e7537965cf257836492bf9a49952c0..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/README.md +++ /dev/null @@ -1,13 +0,0 @@ -This is a ESP boot loader stub development environment. - -Code produced in this environment can be loaded and executed -in the bootloader environment. Usually it is used to implement -functionality not found in the bootloader. - -Stubs can be executed using the `run_stub` command of the modified esptool.py provided. -`wrap_stub` produces a JSON represenattion of the stub that can later be reused -or built into other tools. - -Example usage: - $ make run STUB=stub_flash_size.c PORT=/dev/ttyUSB0 - $ make run STUB=stub_md5.c PORT=/dev/ttyUSB0 PARAMS="0x11000 10000 1" diff --git a/src/common/platforms/esp8266/stubs/chop80.py b/src/common/platforms/esp8266/stubs/chop80.py deleted file mode 100755 index a488ba26577ff842851c54a6ff36fec597a415e5..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/chop80.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python - -import sys - -for line in open(sys.argv[1]): - i = 0 - while i < len(line): - n = len(line) - i - if n > 80: n = 80 - l = line[i:i+n] - if n == 80: - l += '\\' - print l - i += n diff --git a/src/common/platforms/esp8266/stubs/rom_functions.h b/src/common/platforms/esp8266/stubs/rom_functions.h deleted file mode 100644 index 82ea7468d03174ee2e4b8adccdf507148f4c559d..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/rom_functions.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef CS_COMMON_PLATFORMS_ESP8266_STUBS_ROM_FUNCTIONS_H_ -#define CS_COMMON_PLATFORMS_ESP8266_STUBS_ROM_FUNCTIONS_H_ - -#include <inttypes.h> - -#include "/opt/Espressif/ESP8266_NONOS_SDK/include/c_types.h" -#include "/opt/Espressif/ESP8266_NONOS_SDK/include/spi_flash.h" - -int uart_rx_one_char(uint8_t *ch); -uint8_t uart_rx_one_char_block(); -int uart_tx_one_char(char ch); -void uart_div_modify(uint32_t uart_no, uint32_t baud_div); - -int SendMsg(uint8_t *msg, uint8_t size); -int send_packet(uint8_t *packet, uint32_t size); -// recv_packet depends on global UartDev, better to avoid it. -// uint32_t recv_packet(void *packet, uint32_t len, uint8_t no_sync); - -void _putc1(char *ch); - -void ets_delay_us(uint32_t us); - -uint32_t SPILock(); -uint32_t SPIUnlock(); -uint32_t SPIRead(uint32_t addr, void *dst, uint32_t size); -uint32_t SPIWrite(uint32_t addr, const uint32_t *src, uint32_t size); -uint32_t SPIEraseChip(); -uint32_t SPIEraseBlock(uint32_t block_num); -uint32_t SPIEraseSector(uint32_t sector_num); - -extern SpiFlashChip *flashchip; -uint32_t Wait_SPI_Idle(SpiFlashChip *spi); -uint32_t SPI_chip_erase(SpiFlashChip *spi); -uint32_t SPI_read_status(SpiFlashChip *spi); -uint32_t SPI_write_enable(SpiFlashChip *spi); - -void spi_flash_attach(); - -/* ESP32 API compatibility */ -#define esp_rom_spiflash_unlock SPIUnlock -#define esp_rom_spiflash_erase_sector SPIEraseSector -#define esp_rom_spiflash_erase_block SPIEraseBlock -#define esp_rom_spiflash_erase_chip SPIEraseChip -#define esp_rom_spiflash_read SPIRead -#define esp_rom_spiflash_write SPIWrite -#define esp_rom_spiflash_config_param SPIParamCfg - -void SelectSpiFunction(); -void SPIFlashModeConfig(uint32_t a, uint32_t b); -void SPIReadModeCnfig(uint32_t a); -uint32_t SPIParamCfg(uint32_t deviceId, uint32_t chip_size, uint32_t block_size, - uint32_t sector_size, uint32_t page_size, - uint32_t status_mask); - -void Cache_Read_Disable(); - -void ets_delay_us(uint32_t delay_micros); - -void ets_isr_mask(uint32_t ints); -void ets_isr_unmask(uint32_t ints); -typedef void (*int_handler_t)(void *arg); - -void ets_intr_lock(); -void ets_intr_unlock(); -void ets_set_user_start(void (*user_start_fn)()); - -uint32_t rtc_get_reset_reason(); -void software_reset(); -void rom_phy_reset_req(); - -void uart_rx_intr_handler(void *arg); - -void _ResetVector(); - -/* Crypto functions are from wpa_supplicant. */ -int md5_vector(uint32_t num_msgs, const uint8_t *msgs[], - const uint32_t *msg_lens, uint8_t *digest); -int sha1_vector(uint32_t num_msgs, const uint8_t *msgs[], - const uint32_t *msg_lens, uint8_t *digest); - -struct MD5Context { - uint32_t buf[4]; - uint32_t bits[2]; - uint8_t in[64]; -}; - -void MD5Init(struct MD5Context *ctx); -void MD5Update(struct MD5Context *ctx, void *buf, uint32_t len); -void MD5Final(uint8_t digest[16], struct MD5Context *ctx); - -#endif /* CS_COMMON_PLATFORMS_ESP8266_STUBS_ROM_FUNCTIONS_H_ */ diff --git a/src/common/platforms/esp8266/stubs/stub.ld b/src/common/platforms/esp8266/stubs/stub.ld deleted file mode 100644 index 08c416c40b574d61f95bb023ac0f46e4cf782bf6..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/stub.ld +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2015 Cesanta Software Limited - * All rights reserved - */ - -MEMORY { - iram : org = 0x40100000, len = 0x8000 - dram : org = 0x3FFE8000, len = 0x14000 -} - -ENTRY(stub_main) - -SECTIONS { - .params 0x40100000 : { - _params_start = ABSOLUTE(.); - *(.params) - _params_end = ABSOLUTE(.); - } > iram - - .text : ALIGN(4) { - _code_start = ABSOLUTE(.); - *(.literal) - *(.text .text.*) - } > iram - - .bss : ALIGN(4) { - _bss_start = ABSOLUTE(.); - *(.bss) - _bss_end = ABSOLUTE(.); - } > dram - - .data : ALIGN(4) { - _data_start = ABSOLUTE(.); - *(.data) - *(.rodata .rodata.*) - } > dram -} - -INCLUDE "eagle.rom.addr.v6.ld" - -PROVIDE(SPIFlashModeConfig = 0x40004568); -PROVIDE(SPI_erase_sector = 0x400040c0); -PROVIDE(SPI_erase_block = 0x40004120); -PROVIDE(uart_div_modify = 0x400039d8); diff --git a/src/common/platforms/esp8266/stubs/stub_hello.c b/src/common/platforms/esp8266/stubs/stub_hello.c deleted file mode 100644 index 83c035c4880765a0405ad72e88baf4d9126f8276..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/stub_hello.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <inttypes.h> -#include "rom_functions.h" - -/* Define the args vector and put it into the ".params" section. */ -uint32_t params[3] __attribute__((section(".params"))); - -/* Define a function called stub_main. Do not return or reboot. - * Use send_packet to communicate to the host. */ - -const char *hello = "Hello"; - -void stub_main(void) { - send_packet(hello, 5); - _ResetVector(); -} diff --git a/src/common/platforms/esp8266/stubs/uart.c b/src/common/platforms/esp8266/stubs/uart.c deleted file mode 100644 index 39e28117a706d1210ce0a3c4726ce6d9373fe71a..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/uart.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "uart.h" -#include "ets_sys.h" - -#define UART_CLKDIV_M (UART_CLKDIV_CNT << UART_CLKDIV_S) - -void uart_div_modify(uint8_t uart_no, uint32_t div); - -uint32_t set_baud_rate(uint32_t uart_no, uint32_t old_baud_rate, - uint32_t new_baud_rate) { - uint32_t uart_reg = READ_PERI_REG(UART_CLKDIV_REG(uart_no)); - uint32_t uart_div = uart_reg & UART_CLKDIV_M; - uint32_t master_freq = uart_div * old_baud_rate; - uart_div_modify(uart_no, master_freq / new_baud_rate); - return uart_div; -} diff --git a/src/common/platforms/esp8266/stubs/uart.h b/src/common/platforms/esp8266/stubs/uart.h deleted file mode 100644 index 5afd9e380dea067ee8be3441ee265f3b6fe56ccd..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/stubs/uart.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CS_COMMON_PLATFORMS_ESP8266_STUBS_UART_H_ -#define CS_COMMON_PLATFORMS_ESP8266_STUBS_UART_H_ - -#include <stdint.h> - -#include "uart_register.h" - -uint32_t set_baud_rate(uint32_t uart_no, uint32_t old_baud_rate, - uint32_t new_baud_rate); - -#define UART_FIFO_REG(i) (REG_UART_BASE(i) + 0x0) -#define UART_CONF1_REG(i) (REG_UART_BASE(i) + 0x24) -#define UART_RX_TOUT_EN (BIT(31)) -#define UART_RX_TOUT_THRHD_S 24 -#define UART_RXFIFO_FULL_THRHD_S 0 -#define UART_INT_ST_REG(i) (REG_UART_BASE(i) + 0x8) -#define UART_INT_ENA_REG(i) (REG_UART_BASE(i) + 0xC) -#define UART_RXFIFO_TOUT_INT_ENA (BIT(8)) -#define UART_RXFIFO_FULL_INT_ENA (BIT(0)) - -#define UART_INT_CLR_REG(i) (REG_UART_BASE(i) + 0x10) - -#define UART_CLKDIV_REG(i) (REG_UART_BASE(i) + 0x14) - -#define UART_STATUS_REG(i) (REG_UART_BASE(i) + 0x1C) - -#define UART_CONF0_REG(i) (REG_UART_BASE(i) + 0x20) -#define UART_RXFIFO_RST (BIT(17)) - -#define ETS_UART0_INUM ETS_UART_INUM - -#endif /* CS_COMMON_PLATFORMS_ESP8266_STUBS_UART_H_ */ diff --git a/src/common/platforms/esp8266/uart_register.h b/src/common/platforms/esp8266/uart_register.h deleted file mode 100644 index e8fcda731fd85cec4cf65d797bd0cb530789ff02..0000000000000000000000000000000000000000 --- a/src/common/platforms/esp8266/uart_register.h +++ /dev/null @@ -1,136 +0,0 @@ -/* clang-format off */ -/* - * Copyright (c) 2010 - 2011 Espressif System - * - */ - -#ifndef CS_COMMON_PLATFORMS_ESP8266_UART_REGISTER_H_ -#define CS_COMMON_PLATFORMS_ESP8266_UART_REGISTER_H_ - -#define REG_UART_BASE(i) (0x60000000 + (i)*0xf00) -//version value:32'h062000 - -#define UART_FIFO(i) (REG_UART_BASE(i) + 0x0) -#define UART_RXFIFO_RD_BYTE 0x000000FF -#define UART_RXFIFO_RD_BYTE_S 0 - -#define UART_INT_RAW(i) (REG_UART_BASE(i) + 0x4) -#define UART_RXFIFO_TOUT_INT_RAW (BIT(8)) -#define UART_BRK_DET_INT_RAW (BIT(7)) -#define UART_CTS_CHG_INT_RAW (BIT(6)) -#define UART_DSR_CHG_INT_RAW (BIT(5)) -#define UART_RXFIFO_OVF_INT_RAW (BIT(4)) -#define UART_FRM_ERR_INT_RAW (BIT(3)) -#define UART_PARITY_ERR_INT_RAW (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_RAW (BIT(1)) -#define UART_RXFIFO_FULL_INT_RAW (BIT(0)) - -#define UART_INT_ST(i) (REG_UART_BASE(i) + 0x8) -#define UART_RXFIFO_TOUT_INT_ST (BIT(8)) -#define UART_BRK_DET_INT_ST (BIT(7)) -#define UART_CTS_CHG_INT_ST (BIT(6)) -#define UART_DSR_CHG_INT_ST (BIT(5)) -#define UART_RXFIFO_OVF_INT_ST (BIT(4)) -#define UART_FRM_ERR_INT_ST (BIT(3)) -#define UART_PARITY_ERR_INT_ST (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_ST (BIT(1)) -#define UART_RXFIFO_FULL_INT_ST (BIT(0)) - -#define UART_INT_ENA(i) (REG_UART_BASE(i) + 0xC) -#define UART_RXFIFO_TOUT_INT_ENA (BIT(8)) -#define UART_BRK_DET_INT_ENA (BIT(7)) -#define UART_CTS_CHG_INT_ENA (BIT(6)) -#define UART_DSR_CHG_INT_ENA (BIT(5)) -#define UART_RXFIFO_OVF_INT_ENA (BIT(4)) -#define UART_FRM_ERR_INT_ENA (BIT(3)) -#define UART_PARITY_ERR_INT_ENA (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_ENA (BIT(1)) -#define UART_RXFIFO_FULL_INT_ENA (BIT(0)) - -#define UART_INT_CLR(i) (REG_UART_BASE(i) + 0x10) -#define UART_RXFIFO_TOUT_INT_CLR (BIT(8)) -#define UART_BRK_DET_INT_CLR (BIT(7)) -#define UART_CTS_CHG_INT_CLR (BIT(6)) -#define UART_DSR_CHG_INT_CLR (BIT(5)) -#define UART_RXFIFO_OVF_INT_CLR (BIT(4)) -#define UART_FRM_ERR_INT_CLR (BIT(3)) -#define UART_PARITY_ERR_INT_CLR (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_CLR (BIT(1)) -#define UART_RXFIFO_FULL_INT_CLR (BIT(0)) - -#define UART_CLKDIV(i) (REG_UART_BASE(i) + 0x14) -#define UART_CLKDIV_CNT 0x000FFFFF -#define UART_CLKDIV_S 0 - -#define UART_AUTOBAUD(i) (REG_UART_BASE(i) + 0x18) -#define UART_GLITCH_FILT 0x000000FF -#define UART_GLITCH_FILT_S 8 -#define UART_AUTOBAUD_EN (BIT(0)) - -#define UART_STATUS(i) (REG_UART_BASE(i) + 0x1C) -#define UART_TXD (BIT(31)) -#define UART_RTSN (BIT(30)) -#define UART_DTRN (BIT(29)) -#define UART_TXFIFO_CNT 0x000000FF -#define UART_TXFIFO_CNT_S 16 -#define UART_RXD (BIT(15)) -#define UART_CTSN (BIT(14)) -#define UART_DSRN (BIT(13)) -#define UART_RXFIFO_CNT 0x000000FF -#define UART_RXFIFO_CNT_S 0 - -#define UART_CONF0(i) (REG_UART_BASE(i) + 0x20) -#define UART_DTR_INV (BIT(24)) -#define UART_RTS_INV (BIT(23)) -#define UART_TXD_INV (BIT(22)) -#define UART_DSR_INV (BIT(21)) -#define UART_CTS_INV (BIT(20)) -#define UART_RXD_INV (BIT(19)) -#define UART_TXFIFO_RST (BIT(18)) -#define UART_RXFIFO_RST (BIT(17)) -#define UART_IRDA_EN (BIT(16)) -#define UART_TX_FLOW_EN (BIT(15)) -#define UART_LOOPBACK (BIT(14)) -#define UART_IRDA_RX_INV (BIT(13)) -#define UART_IRDA_TX_INV (BIT(12)) -#define UART_IRDA_WCTL (BIT(11)) -#define UART_IRDA_TX_EN (BIT(10)) -#define UART_IRDA_DPLX (BIT(9)) -#define UART_TXD_BRK (BIT(8)) -#define UART_SW_DTR (BIT(7)) -#define UART_SW_RTS (BIT(6)) -#define UART_STOP_BIT_NUM 0x00000003 -#define UART_STOP_BIT_NUM_S 4 -#define UART_BIT_NUM 0x00000003 -#define UART_BIT_NUM_S 2 -#define UART_PARITY_EN (BIT(1)) -#define UART_PARITY (BIT(0)) - -#define UART_CONF1(i) (REG_UART_BASE(i) + 0x24) -#define UART_RX_TOUT_EN (BIT(31)) -#define UART_RX_TOUT_THRHD 0x0000007F -#define UART_RX_TOUT_THRHD_S 24 -#define UART_RX_FLOW_EN (BIT(23)) -#define UART_RX_FLOW_THRHD 0x0000007F -#define UART_RX_FLOW_THRHD_S 16 -#define UART_TXFIFO_EMPTY_THRHD 0x0000007F -#define UART_TXFIFO_EMPTY_THRHD_S 8 -#define UART_RXFIFO_FULL_THRHD 0x0000007F -#define UART_RXFIFO_FULL_THRHD_S 0 - -#define UART_LOWPULSE(i) (REG_UART_BASE(i) + 0x28) -#define UART_LOWPULSE_MIN_CNT 0x000FFFFF -#define UART_LOWPULSE_MIN_CNT_S 0 - -#define UART_HIGHPULSE(i) (REG_UART_BASE(i) + 0x2C) -#define UART_HIGHPULSE_MIN_CNT 0x000FFFFF -#define UART_HIGHPULSE_MIN_CNT_S 0 - -#define UART_PULSE_NUM(i) (REG_UART_BASE(i) + 0x30) -#define UART_PULSE_NUM_CNT 0x0003FF -#define UART_PULSE_NUM_CNT_S 0 - -#define UART_DATE(i) (REG_UART_BASE(i) + 0x78) -#define UART_ID(i) (REG_UART_BASE(i) + 0x7C) - -#endif /* CS_COMMON_PLATFORMS_ESP8266_UART_REGISTER_H_ */ diff --git a/src/common/platforms/lwip/mg_lwip.h b/src/common/platforms/lwip/mg_lwip.h index c15e2ee2db3a1d31eb07a54667c5ba4dc6380f50..e5324a52094b4da27b2d0c229657643acd25af2f 100644 --- a/src/common/platforms/lwip/mg_lwip.h +++ b/src/common/platforms/lwip/mg_lwip.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_LWIP_MG_LWIP_H_ #define CS_COMMON_PLATFORMS_LWIP_MG_LWIP_H_ diff --git a/src/common/platforms/lwip/mg_lwip_ev_mgr.c b/src/common/platforms/lwip/mg_lwip_ev_mgr.c index afff2dbd281d91d7aa79ff4cebc8b9a4f933f23f..f9a0e62ff1338a861344868e1b0b5f8ac626922d 100644 --- a/src/common/platforms/lwip/mg_lwip_ev_mgr.c +++ b/src/common/platforms/lwip/mg_lwip_ev_mgr.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL diff --git a/src/common/platforms/lwip/mg_lwip_net_if.c b/src/common/platforms/lwip/mg_lwip_net_if.c index 754ac2dfa386cb52fffa4901cdfdc16c93a54503..a38eaf1745a150aeae30c03995fbdfe28109618d 100644 --- a/src/common/platforms/lwip/mg_lwip_net_if.c +++ b/src/common/platforms/lwip/mg_lwip_net_if.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if MG_ENABLE_NET_IF_LWIP_LOW_LEVEL diff --git a/src/common/platforms/lwip/mg_lwip_net_if.h b/src/common/platforms/lwip/mg_lwip_net_if.h index d9827a90326df06186f5e0fb8e4fbb387dd9820d..350a6694b74e34346961632c40491a481f349082 100644 --- a/src/common/platforms/lwip/mg_lwip_net_if.h +++ b/src/common/platforms/lwip/mg_lwip_net_if.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_LWIP_MG_NET_IF_LWIP_H_ #define CS_COMMON_PLATFORMS_LWIP_MG_NET_IF_LWIP_H_ diff --git a/src/common/platforms/mbed/mbed_libc.c b/src/common/platforms/mbed/mbed_libc.c deleted file mode 100644 index ef8e6abbc60ef9e821584417a35e13e326f09423..0000000000000000000000000000000000000000 --- a/src/common/platforms/mbed/mbed_libc.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common/platform.h" - -#if CS_PLATFORM == CS_P_MBED - -long timezone; - -/* - * The GCC ARM toolchain for implements a weak - * gettimeofday stub that should be implemented - * to hook the OS time source. But mbed OS doesn't do it; - * the mbed doc only talks about C date and time functions: - * - * https://docs.mbed.com/docs/mbed-os-api-reference/en/5.1/APIs/tasks/Time/ - * - * gettimeof day is a BSD API. - */ -int _gettimeofday(struct timeval *tv, void *tzvp) { - tv->tv_sec = time(NULL); - tv->tv_usec = 0; - return 0; -} - -int inet_aton(const char *cp, struct in_addr *inp) { - /* We don't have aton, but have pton in mbed */ - return inet_pton(AF_INET, cp, inp); -} - -in_addr_t inet_addr(const char *cp) { - in_addr_t ret; - if (inet_pton(AF_INET, cp, &ret) != 1) { - return 0; - } - - return ret; -} - -#endif /* CS_PLATFORM == CS_P_MBED */ diff --git a/src/common/platforms/msp432/msp432_libc.c b/src/common/platforms/msp432/msp432_libc.c index de1e6ba858038b4b65d94b75c5cb76b0d2bb3340..3320bacc3fe800d0e25b81170de36834b02837bd 100644 --- a/src/common/platforms/msp432/msp432_libc.c +++ b/src/common/platforms/msp432/msp432_libc.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if CS_PLATFORM == CS_P_MSP432 diff --git a/src/common/platforms/nrf5/nrf5_libc.c b/src/common/platforms/nrf5/nrf5_libc.c index 65d05ed4133523b5ad4f24998cef5271e3105f54..524e0ff7bed7c7a83b01794b31b47baec3963fbb 100644 --- a/src/common/platforms/nrf5/nrf5_libc.c +++ b/src/common/platforms/nrf5/nrf5_libc.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if (CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52) && \ defined(__ARMCC_VERSION) diff --git a/src/common/platforms/pic32/pic32_net_if.c b/src/common/platforms/pic32/pic32_net_if.c index 49618c57e87d09dbcc5ed503b56df75c39469e2b..2eac7575e1eac72726fb20385e233abe47654533 100644 --- a/src/common/platforms/pic32/pic32_net_if.c +++ b/src/common/platforms/pic32/pic32_net_if.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if MG_ENABLE_NET_IF_PIC32 diff --git a/src/common/platforms/pic32/pic32_net_if.h b/src/common/platforms/pic32/pic32_net_if.h index 52ae891dcfe8099cc0f7eb04686df49508b220fb..a409a4f857cc33e5f94cf0dbcc3bf982fb5ba059 100644 --- a/src/common/platforms/pic32/pic32_net_if.h +++ b/src/common/platforms/pic32/pic32_net_if.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PIC32_NET_IF_H_ #define CS_COMMON_PLATFORMS_PIC32_NET_IF_H_ diff --git a/src/common/platforms/pic32/xc32.mk b/src/common/platforms/pic32/xc32.mk deleted file mode 100644 index aff6b4e557d38b68aafefa5be579651e0f7b17df..0000000000000000000000000000000000000000 --- a/src/common/platforms/pic32/xc32.mk +++ /dev/null @@ -1,51 +0,0 @@ -APP_LDFLAGS ?= -CC_WRAPPER ?= -GENFILES_LIST ?= -CC = $(XC32_PATH)/bin/xc32-gcc -AR = $(XC32_PATH)/bin/xc32-ar -LD = $(XC32_PATH)/bin/xc32-gcc -BIN2HEX = $(XC32_PATH)/bin/xc32-bin2hex - -CFLAGS = -fframe-base-loclist -mprocessor=32MZ2048EFM064 \ - -ffunction-sections -Wall -g -no-legacy-libc \ - -O1 - -CFLAGS += -DCS_ENABLE_DEBUG - -LDFLAGS = -mprocessor=32MZ2048EFM064 - -# TODO(dfrank) enable that conditionally -CFLAGS += -D__DEBUG -D__MPLAB_DEBUGGER_ICD3=1 -LDFLAGS += -mdebugger -D__MPLAB_DEBUGGER_ICD3=1 - -OBJCOPY = $(XC32_PATH)/bin/xc32-objcopy - -# cc flags,file -define cc - $(vecho) "XC32 $2 -> $@" - $(Q) $(CC_WRAPPER) $(CC) -c $1 -o $@ $2 -endef - -# cc flags,file -define asm - $(vecho) "XC32 ASM $2 -> $@" - $(Q) $(CC) -c $1 -o $@ $2 -endef - -# ar files -define ar - $(vecho) "AR $@" - $(Q) $(AR) cru $@ $1 -endef - -# link script,flags,objs -define link - $(vecho) "LD $@ (ignoring linker script $1)" - $(Q) $(CC_WRAPPER) $(LD) -o $@ $2 $3 -no-legacy-libc \ - -Wl,--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,--defsym=__MPLAB_DEBUGGER_ICD3=1,--defsym=_min_heap_size=44960,--gc-sections -endef - -define bin2hex - $(vecho) "HEX $1 -> $@" - $(Q) $(BIN2HEX) $1 -endef diff --git a/src/common/platforms/platform_cc3100.h b/src/common/platforms/platform_cc3100.h index 8e847fcfdc083ca30cbff55b4e4e900b578295c4..5369b31951be08d61fb6cb4e19781172aa69899b 100644 --- a/src/common/platforms/platform_cc3100.h +++ b/src/common/platforms/platform_cc3100.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_CC3100_H_ #define CS_COMMON_PLATFORMS_PLATFORM_CC3100_H_ diff --git a/src/common/platforms/platform_cc3200.h b/src/common/platforms/platform_cc3200.h index 00ef9fa386196f4d1e9e8461b495362e7f536974..28c19d0b0fedf5de928ee6887b38d1fe3ec6f63c 100644 --- a/src/common/platforms/platform_cc3200.h +++ b/src/common/platforms/platform_cc3200.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_ #define CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_ diff --git a/src/common/platforms/platform_cc3220.h b/src/common/platforms/platform_cc3220.h index c5336e33d52f10cadb60e753dfb0a2228fd897ec..ddd59bbfb6be5024bf2b5e2ee584c323dd343bf5 100644 --- a/src/common/platforms/platform_cc3220.h +++ b/src/common/platforms/platform_cc3220.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_CC3220_H_ #define CS_COMMON_PLATFORMS_PLATFORM_CC3220_H_ diff --git a/src/common/platforms/platform_esp32.h b/src/common/platforms/platform_esp32.h index b1af9da524dc519b2c3cb65433f35b3a7abc2b73..fb8d42bb9b19385ef14594488a797169d5a4ebbd 100644 --- a/src/common/platforms/platform_esp32.h +++ b/src/common/platforms/platform_esp32.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_ESP32_H_ #define CS_COMMON_PLATFORMS_PLATFORM_ESP32_H_ diff --git a/src/common/platforms/platform_esp8266.h b/src/common/platforms/platform_esp8266.h index 3bef0441bf209bc779bf98c4599dcd0f7afb2c16..701f068ee246e8bd5950cb9666089e5fd84ae79f 100644 --- a/src/common/platforms/platform_esp8266.h +++ b/src/common/platforms/platform_esp8266.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_ESP8266_H_ #define CS_COMMON_PLATFORMS_PLATFORM_ESP8266_H_ diff --git a/src/common/platforms/platform_mbed.h b/src/common/platforms/platform_mbed.h index 5f37862a8ae2343e3c87e6338bfe874cafc1ae85..45601ab94d9fa8916904090283a405cc196579b1 100644 --- a/src/common/platforms/platform_mbed.h +++ b/src/common/platforms/platform_mbed.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_MBED_H_ #define CS_COMMON_PLATFORMS_PLATFORM_MBED_H_ diff --git a/src/common/platforms/platform_msp432.h b/src/common/platforms/platform_msp432.h index d9c5e18338265a100cb57465ad85375912be5553..f93105433cc32f0432f873122fa355086229f8c3 100644 --- a/src/common/platforms/platform_msp432.h +++ b/src/common/platforms/platform_msp432.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_ #define CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_ diff --git a/src/common/platforms/platform_nrf51.h b/src/common/platforms/platform_nrf51.h index 6f1357bd6566dae89dff6299b421733c70a2ca46..791c6d1b0428294b5ee0b35312905b291caceff3 100644 --- a/src/common/platforms/platform_nrf51.h +++ b/src/common/platforms/platform_nrf51.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_ #if CS_PLATFORM == CS_P_NRF51 diff --git a/src/common/platforms/platform_nrf52.h b/src/common/platforms/platform_nrf52.h index 2b8b882fcc16187ec2818293b1497e08d03e6c6f..c8054dd9842dba6a1bb49bf4c0b6e70b2c9b735d 100644 --- a/src/common/platforms/platform_nrf52.h +++ b/src/common/platforms/platform_nrf52.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_ #if CS_PLATFORM == CS_P_NRF52 diff --git a/src/common/platforms/platform_nxp_kinetis.h b/src/common/platforms/platform_nxp_kinetis.h index d9265e91000a51a74c9c466d129a3b2f50bc548a..13c50ba35b46b8d40179faa337f8985cd9292916 100644 --- a/src/common/platforms/platform_nxp_kinetis.h +++ b/src/common/platforms/platform_nxp_kinetis.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_ diff --git a/src/common/platforms/platform_nxp_lpc.h b/src/common/platforms/platform_nxp_lpc.h index 7bb12c5ee02ddff2f319cd0a704603dadda5bd5d..5a29d68ff1e6a89b101b557c8b93de47ccdd3644 100644 --- a/src/common/platforms/platform_nxp_lpc.h +++ b/src/common/platforms/platform_nxp_lpc.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_NXP_LPC_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NXP_LPC_H_ diff --git a/src/common/platforms/platform_pic32.h b/src/common/platforms/platform_pic32.h index f2072c3e1631822eef5fd861d4ea3dea98f148c8..af84ca153854475e15c9d29e69577428e03783d1 100644 --- a/src/common/platforms/platform_pic32.h +++ b/src/common/platforms/platform_pic32.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_ #define CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_ diff --git a/src/common/platforms/platform_rs14100.h b/src/common/platforms/platform_rs14100.h index 5e9618e572a8d4288e247d72c983dabe47f07109..1484089d0027d8af56962c13c732e0d3de83d842 100644 --- a/src/common/platforms/platform_rs14100.h +++ b/src/common/platforms/platform_rs14100.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2019 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_RS14100_H_ #define CS_COMMON_PLATFORMS_PLATFORM_RS14100_H_ diff --git a/src/common/platforms/platform_stm32.h b/src/common/platforms/platform_stm32.h index d5b891923802e3aa07cabdaee8f979bf018fad2d..eafc76dc7891315c201168d15a2b917ef2fb6156 100644 --- a/src/common/platforms/platform_stm32.h +++ b/src/common/platforms/platform_stm32.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_STM32_H_ #define CS_COMMON_PLATFORMS_PLATFORM_STM32_H_ diff --git a/src/common/platforms/platform_tm4c129.h b/src/common/platforms/platform_tm4c129.h index dc75d79db2107ed6374d94381e30b8df3d618178..e46987e0c1fda62c7e7bca6fe8c1e3bd9feac5eb 100644 --- a/src/common/platforms/platform_tm4c129.h +++ b/src/common/platforms/platform_tm4c129.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_PLATFORM_TM4C129_H_ #define CS_COMMON_PLATFORMS_PLATFORM_TM4C129_H_ diff --git a/src/common/platforms/simplelink/cs_simplelink.h b/src/common/platforms/simplelink/cs_simplelink.h index 71af2dcbeaf3553183c53e9deca1a9be0f95b01c..a2a4364560570e85ab5e49dbc43e42e205bdfd8d 100644 --- a/src/common/platforms/simplelink/cs_simplelink.h +++ b/src/common/platforms/simplelink/cs_simplelink.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_ #define CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_ diff --git a/src/common/platforms/simplelink/sl_fs.c b/src/common/platforms/simplelink/sl_fs.c index bc055c1f550380ae267a0518488c12bbfd12c4c5..d577f9d94ac76bffdb47f63f3b3d844bd6b3f7a3 100644 --- a/src/common/platforms/simplelink/sl_fs.c +++ b/src/common/platforms/simplelink/sl_fs.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if MG_NET_IF == MG_NET_IF_SIMPLELINK && \ (defined(MG_FS_SLFS) || defined(MG_FS_SPIFFS)) diff --git a/src/common/platforms/simplelink/sl_fs_slfs.c b/src/common/platforms/simplelink/sl_fs_slfs.c index 7dcff3080ba4f4b19ba3372f359299345d2ffb73..12db484c8b4c8db54868f9241ff4bd0283c0f179 100644 --- a/src/common/platforms/simplelink/sl_fs_slfs.c +++ b/src/common/platforms/simplelink/sl_fs_slfs.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ /* Standard libc interface to TI SimpleLink FS. */ diff --git a/src/common/platforms/simplelink/sl_fs_slfs.h b/src/common/platforms/simplelink/sl_fs_slfs.h index 4e4cb57b057ba702c644a95a75e9528751b5c4ce..588554006a210f90048dc70a5f273663afe4c440 100644 --- a/src/common/platforms/simplelink/sl_fs_slfs.h +++ b/src/common/platforms/simplelink/sl_fs_slfs.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_SIMPLELINK_SL_FS_SLFS_H_ #define CS_COMMON_PLATFORMS_SIMPLELINK_SL_FS_SLFS_H_ diff --git a/src/common/platforms/simplelink/sl_net_if.c b/src/common/platforms/simplelink/sl_net_if.c index 1a000ce7f8d445e48766f5ebb0cb32c73b59d262..0f51cc5e1093706d8b7f1927cccc462d345bf93b 100644 --- a/src/common/platforms/simplelink/sl_net_if.c +++ b/src/common/platforms/simplelink/sl_net_if.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #include "common/platforms/simplelink/sl_net_if.h" diff --git a/src/common/platforms/simplelink/sl_net_if.h b/src/common/platforms/simplelink/sl_net_if.h index c72bd28b18e76ab7bc35aac22f9b76aaf68ef411..5536d454bdf136676a75a216488b47ca188ffaa0 100644 --- a/src/common/platforms/simplelink/sl_net_if.h +++ b/src/common/platforms/simplelink/sl_net_if.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifndef CS_COMMON_PLATFORMS_SIMPLELINK_SL_NET_IF_H_ #define CS_COMMON_PLATFORMS_SIMPLELINK_SL_NET_IF_H_ diff --git a/src/common/platforms/simplelink/sl_socket.c b/src/common/platforms/simplelink/sl_socket.c index 101fb636e7cd23f4b8bd1373587184196a28aaad..e323c9e528a4a6a671941110db48fda4b321ebda 100644 --- a/src/common/platforms/simplelink/sl_socket.c +++ b/src/common/platforms/simplelink/sl_socket.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if MG_NET_IF == MG_NET_IF_SIMPLELINK diff --git a/src/common/platforms/simplelink/sl_ssl_if.c b/src/common/platforms/simplelink/sl_ssl_if.c index 92453e3dbf70f43b45b76c8b4f68c2464d5a2155..d2c275feea71e4b811c52172cfc11429bf9134d0 100644 --- a/src/common/platforms/simplelink/sl_ssl_if.c +++ b/src/common/platforms/simplelink/sl_ssl_if.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #if MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_SIMPLELINK diff --git a/src/common/platforms/wince/wince_libc.c b/src/common/platforms/wince/wince_libc.c index c0f5192832611e49c34a0ec4b2228ce0afaec0b3..d2a5f595d479f990d07c9f783bf4d87d088e1211 100644 --- a/src/common/platforms/wince/wince_libc.c +++ b/src/common/platforms/wince/wince_libc.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifdef WINCE diff --git a/src/common/platforms/windows/windows_direct.c b/src/common/platforms/windows/windows_direct.c index 796a416d907864097319cf24b776ca2e41c8f0c7..8bb96a308790dc107b88c8169a666b4f373a0562 100644 --- a/src/common/platforms/windows/windows_direct.c +++ b/src/common/platforms/windows/windows_direct.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014-2018 Cesanta Software Limited - * All rights reserved - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ #ifdef _WIN32 diff --git a/src/common/queue.h b/src/common/queue.h new file mode 100644 index 0000000000000000000000000000000000000000..f12d8cae858a2b001a4727691a90a2969660eded --- /dev/null +++ b/src/common/queue.h @@ -0,0 +1,752 @@ +/* clang-format off */ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + * $FreeBSD$ + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines four types of data structures: singly-linked lists, + * singly-linked tail queues, lists and tail queues. + * + * A singly-linked list is headed by a single forward pointer. The elements + * are singly linked for minimum space and pointer manipulation overhead at + * the expense of O(n) removal for arbitrary elements. New elements can be + * added to the list after an existing element or at the head of the list. + * Elements being removed from the head of the list should use the explicit + * macro for this purpose for optimum efficiency. A singly-linked list may + * only be traversed in the forward direction. Singly-linked lists are ideal + * for applications with large datasets and few or no removals or for + * implementing a LIFO queue. + * + * A singly-linked tail queue is headed by a pair of pointers, one to the + * head of the list and the other to the tail of the list. The elements are + * singly linked for minimum space and pointer manipulation overhead at the + * expense of O(n) removal for arbitrary elements. New elements can be added + * to the list after an existing element, at the head of the list, or at the + * end of the list. Elements being removed from the head of the tail queue + * should use the explicit macro for this purpose for optimum efficiency. + * A singly-linked tail queue may only be traversed in the forward direction. + * Singly-linked tail queues are ideal for applications with large datasets + * and few or no removals or for implementing a FIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may be traversed in either direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * For details on the use of these macros, see the queue(3) manual page. + * + * + * SLIST LIST STAILQ TAILQ + * _HEAD + + + + + * _CLASS_HEAD + + + + + * _HEAD_INITIALIZER + + + + + * _ENTRY + + + + + * _CLASS_ENTRY + + + + + * _INIT + + + + + * _EMPTY + + + + + * _FIRST + + + + + * _NEXT + + + + + * _PREV - + - + + * _LAST - - + + + * _FOREACH + + + + + * _FOREACH_FROM + + + + + * _FOREACH_SAFE + + + + + * _FOREACH_FROM_SAFE + + + + + * _FOREACH_REVERSE - - - + + * _FOREACH_REVERSE_FROM - - - + + * _FOREACH_REVERSE_SAFE - - - + + * _FOREACH_REVERSE_FROM_SAFE - - - + + * _INSERT_HEAD + + + + + * _INSERT_BEFORE - + - + + * _INSERT_AFTER + + + + + * _INSERT_TAIL - - + + + * _CONCAT - - + + + * _REMOVE_AFTER + - + - + * _REMOVE_HEAD + - + - + * _REMOVE + + + + + * _SWAP + + + + + * + */ +#ifdef QUEUE_MACRO_DEBUG +/* Store the last 2 places the queue element or head was altered */ +struct qm_trace { + unsigned long lastline; + unsigned long prevline; + const char *lastfile; + const char *prevfile; +}; + +#define TRACEBUF struct qm_trace trace; +#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } , +#define TRASHIT(x) do {(x) = (void *)-1;} while (0) +#define QMD_SAVELINK(name, link) void **name = (void *)&(link) + +#define QMD_TRACE_HEAD(head) do { \ + (head)->trace.prevline = (head)->trace.lastline; \ + (head)->trace.prevfile = (head)->trace.lastfile; \ + (head)->trace.lastline = __LINE__; \ + (head)->trace.lastfile = __FILE__; \ +} while (0) + +#define QMD_TRACE_ELEM(elem) do { \ + (elem)->trace.prevline = (elem)->trace.lastline; \ + (elem)->trace.prevfile = (elem)->trace.lastfile; \ + (elem)->trace.lastline = __LINE__; \ + (elem)->trace.lastfile = __FILE__; \ +} while (0) + +#else +#define QMD_TRACE_ELEM(elem) +#define QMD_TRACE_HEAD(head) +#define QMD_SAVELINK(name, link) +#define TRACEBUF +#define TRACEBUF_INITIALIZER +#define TRASHIT(x) +#endif /* QUEUE_MACRO_DEBUG */ + +#ifdef __cplusplus +/* + * In C++ there can be structure lists and class lists: + */ +#define QUEUE_TYPEOF(type) type +#else +#define QUEUE_TYPEOF(type) struct type +#endif + +/* + * Singly-linked List declarations. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_CLASS_HEAD(name, type) \ +struct name { \ + class type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +#define SLIST_CLASS_ENTRY(type) \ +struct { \ + class type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List functions. + */ +#define SLIST_EMPTY(head) ((head)->slh_first == NULL) + +#define SLIST_FIRST(head) ((head)->slh_first) + +#define SLIST_FOREACH(var, head, field) \ + for ((var) = SLIST_FIRST((head)); \ + (var); \ + (var) = SLIST_NEXT((var), field)) + +#define SLIST_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \ + (var); \ + (var) = SLIST_NEXT((var), field)) + +#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = SLIST_FIRST((head)); \ + (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ + for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \ + (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ + for ((varp) = &SLIST_FIRST((head)); \ + ((var) = *(varp)) != NULL; \ + (varp) = &SLIST_NEXT((var), field)) + +#define SLIST_INIT(head) do { \ + SLIST_FIRST((head)) = NULL; \ +} while (0) + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ + SLIST_NEXT((slistelm), field) = (elm); \ +} while (0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ + SLIST_FIRST((head)) = (elm); \ +} while (0) + +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ + if (SLIST_FIRST((head)) == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \ + while (SLIST_NEXT(curelm, field) != (elm)) \ + curelm = SLIST_NEXT(curelm, field); \ + SLIST_REMOVE_AFTER(curelm, field); \ + } \ + TRASHIT(*oldnext); \ +} while (0) + +#define SLIST_REMOVE_AFTER(elm, field) do { \ + SLIST_NEXT(elm, field) = \ + SLIST_NEXT(SLIST_NEXT(elm, field), field); \ +} while (0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ +} while (0) + +#define SLIST_SWAP(head1, head2, type) do { \ + QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \ + SLIST_FIRST(head1) = SLIST_FIRST(head2); \ + SLIST_FIRST(head2) = swap_first; \ +} while (0) + +/* + * Singly-linked Tail queue declarations. + */ +#define STAILQ_HEAD(name, type) \ +struct name { \ + struct type *stqh_first;/* first element */ \ + struct type **stqh_last;/* addr of last next element */ \ +} + +#define STAILQ_CLASS_HEAD(name, type) \ +struct name { \ + class type *stqh_first; /* first element */ \ + class type **stqh_last; /* addr of last next element */ \ +} + +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + +#define STAILQ_ENTRY(type) \ +struct { \ + struct type *stqe_next; /* next element */ \ +} + +#define STAILQ_CLASS_ENTRY(type) \ +struct { \ + class type *stqe_next; /* next element */ \ +} + +/* + * Singly-linked Tail queue functions. + */ +#define STAILQ_CONCAT(head1, head2) do { \ + if (!STAILQ_EMPTY((head2))) { \ + *(head1)->stqh_last = (head2)->stqh_first; \ + (head1)->stqh_last = (head2)->stqh_last; \ + STAILQ_INIT((head2)); \ + } \ +} while (0) + +#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) + +#define STAILQ_FIRST(head) ((head)->stqh_first) + +#define STAILQ_FOREACH(var, head, field) \ + for((var) = STAILQ_FIRST((head)); \ + (var); \ + (var) = STAILQ_NEXT((var), field)) + +#define STAILQ_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ + (var); \ + (var) = STAILQ_NEXT((var), field)) + +#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = STAILQ_FIRST((head)); \ + (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ + for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ + (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define STAILQ_INIT(head) do { \ + STAILQ_FIRST((head)) = NULL; \ + (head)->stqh_last = &STAILQ_FIRST((head)); \ +} while (0) + +#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ + if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ + (head)->stqh_last = &STAILQ_NEXT((elm), field); \ + STAILQ_NEXT((tqelm), field) = (elm); \ +} while (0) + +#define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ + (head)->stqh_last = &STAILQ_NEXT((elm), field); \ + STAILQ_FIRST((head)) = (elm); \ +} while (0) + +#define STAILQ_INSERT_TAIL(head, elm, field) do { \ + STAILQ_NEXT((elm), field) = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &STAILQ_NEXT((elm), field); \ +} while (0) + +#define STAILQ_LAST(head, type, field) \ + (STAILQ_EMPTY((head)) ? NULL : \ + __containerof((head)->stqh_last, \ + QUEUE_TYPEOF(type), field.stqe_next)) + +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + +#define STAILQ_REMOVE(head, elm, type, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ + if (STAILQ_FIRST((head)) == (elm)) { \ + STAILQ_REMOVE_HEAD((head), field); \ + } \ + else { \ + QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \ + while (STAILQ_NEXT(curelm, field) != (elm)) \ + curelm = STAILQ_NEXT(curelm, field); \ + STAILQ_REMOVE_AFTER(head, curelm, field); \ + } \ + TRASHIT(*oldnext); \ +} while (0) + +#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ + if ((STAILQ_NEXT(elm, field) = \ + STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ + (head)->stqh_last = &STAILQ_NEXT((elm), field); \ +} while (0) + +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if ((STAILQ_FIRST((head)) = \ + STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ + (head)->stqh_last = &STAILQ_FIRST((head)); \ +} while (0) + +#define STAILQ_SWAP(head1, head2, type) do { \ + QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \ + QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \ + STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ + (head1)->stqh_last = (head2)->stqh_last; \ + STAILQ_FIRST(head2) = swap_first; \ + (head2)->stqh_last = swap_last; \ + if (STAILQ_EMPTY(head1)) \ + (head1)->stqh_last = &STAILQ_FIRST(head1); \ + if (STAILQ_EMPTY(head2)) \ + (head2)->stqh_last = &STAILQ_FIRST(head2); \ +} while (0) + + +/* + * List declarations. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_CLASS_HEAD(name, type) \ +struct name { \ + class type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +#define LIST_CLASS_ENTRY(type) \ +struct { \ + class type *le_next; /* next element */ \ + class type **le_prev; /* address of previous next element */ \ +} + +/* + * List functions. + */ + +#if (defined(_KERNEL) && defined(INVARIANTS)) +#define QMD_LIST_CHECK_HEAD(head, field) do { \ + if (LIST_FIRST((head)) != NULL && \ + LIST_FIRST((head))->field.le_prev != \ + &LIST_FIRST((head))) \ + panic("Bad list head %p first->prev != head", (head)); \ +} while (0) + +#define QMD_LIST_CHECK_NEXT(elm, field) do { \ + if (LIST_NEXT((elm), field) != NULL && \ + LIST_NEXT((elm), field)->field.le_prev != \ + &((elm)->field.le_next)) \ + panic("Bad link elm %p next->prev != elm", (elm)); \ +} while (0) + +#define QMD_LIST_CHECK_PREV(elm, field) do { \ + if (*(elm)->field.le_prev != (elm)) \ + panic("Bad link elm %p prev->next != elm", (elm)); \ +} while (0) +#else +#define QMD_LIST_CHECK_HEAD(head, field) +#define QMD_LIST_CHECK_NEXT(elm, field) +#define QMD_LIST_CHECK_PREV(elm, field) +#endif /* (_KERNEL && INVARIANTS) */ + +#define LIST_EMPTY(head) ((head)->lh_first == NULL) + +#define LIST_FIRST(head) ((head)->lh_first) + +#define LIST_FOREACH(var, head, field) \ + for ((var) = LIST_FIRST((head)); \ + (var); \ + (var) = LIST_NEXT((var), field)) + +#define LIST_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ + (var); \ + (var) = LIST_NEXT((var), field)) + +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = LIST_FIRST((head)); \ + (var) && ((tvar) = LIST_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define LIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ + for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ + (var) && ((tvar) = LIST_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define LIST_INIT(head) do { \ + LIST_FIRST((head)) = NULL; \ +} while (0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + QMD_LIST_CHECK_NEXT(listelm, field); \ + if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ + LIST_NEXT((listelm), field)->field.le_prev = \ + &LIST_NEXT((elm), field); \ + LIST_NEXT((listelm), field) = (elm); \ + (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ +} while (0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + QMD_LIST_CHECK_PREV(listelm, field); \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + LIST_NEXT((elm), field) = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ +} while (0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + QMD_LIST_CHECK_HEAD((head), field); \ + if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ + LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ + LIST_FIRST((head)) = (elm); \ + (elm)->field.le_prev = &LIST_FIRST((head)); \ +} while (0) + +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + +#define LIST_PREV(elm, head, type, field) \ + ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ + __containerof((elm)->field.le_prev, \ + QUEUE_TYPEOF(type), field.le_next)) + +#define LIST_REMOVE(elm, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.le_next); \ + QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ + QMD_LIST_CHECK_NEXT(elm, field); \ + QMD_LIST_CHECK_PREV(elm, field); \ + if (LIST_NEXT((elm), field) != NULL) \ + LIST_NEXT((elm), field)->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = LIST_NEXT((elm), field); \ + TRASHIT(*oldnext); \ + TRASHIT(*oldprev); \ +} while (0) + +#define LIST_SWAP(head1, head2, type, field) do { \ + QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \ + LIST_FIRST((head1)) = LIST_FIRST((head2)); \ + LIST_FIRST((head2)) = swap_tmp; \ + if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ + swap_tmp->field.le_prev = &LIST_FIRST((head1)); \ + if ((swap_tmp = LIST_FIRST((head2))) != NULL) \ + swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ +} while (0) + +/* + * Tail queue declarations. + */ +#define TAILQ_HEAD(name, type) \ +struct name { \ + struct type *tqh_first; /* first element */ \ + struct type **tqh_last; /* addr of last next element */ \ + TRACEBUF \ +} + +#define TAILQ_CLASS_HEAD(name, type) \ +struct name { \ + class type *tqh_first; /* first element */ \ + class type **tqh_last; /* addr of last next element */ \ + TRACEBUF \ +} + +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } + +#define TAILQ_ENTRY(type) \ +struct { \ + struct type *tqe_next; /* next element */ \ + struct type **tqe_prev; /* address of previous next element */ \ + TRACEBUF \ +} + +#define TAILQ_CLASS_ENTRY(type) \ +struct { \ + class type *tqe_next; /* next element */ \ + class type **tqe_prev; /* address of previous next element */ \ + TRACEBUF \ +} + +/* + * Tail queue functions. + */ +#if (defined(_KERNEL) && defined(INVARIANTS)) +#define QMD_TAILQ_CHECK_HEAD(head, field) do { \ + if (!TAILQ_EMPTY(head) && \ + TAILQ_FIRST((head))->field.tqe_prev != \ + &TAILQ_FIRST((head))) \ + panic("Bad tailq head %p first->prev != head", (head)); \ +} while (0) + +#define QMD_TAILQ_CHECK_TAIL(head, field) do { \ + if (*(head)->tqh_last != NULL) \ + panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \ +} while (0) + +#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ + if (TAILQ_NEXT((elm), field) != NULL && \ + TAILQ_NEXT((elm), field)->field.tqe_prev != \ + &((elm)->field.tqe_next)) \ + panic("Bad link elm %p next->prev != elm", (elm)); \ +} while (0) + +#define QMD_TAILQ_CHECK_PREV(elm, field) do { \ + if (*(elm)->field.tqe_prev != (elm)) \ + panic("Bad link elm %p prev->next != elm", (elm)); \ +} while (0) +#else +#define QMD_TAILQ_CHECK_HEAD(head, field) +#define QMD_TAILQ_CHECK_TAIL(head, headname) +#define QMD_TAILQ_CHECK_NEXT(elm, field) +#define QMD_TAILQ_CHECK_PREV(elm, field) +#endif /* (_KERNEL && INVARIANTS) */ + +#define TAILQ_CONCAT(head1, head2, field) do { \ + if (!TAILQ_EMPTY(head2)) { \ + *(head1)->tqh_last = (head2)->tqh_first; \ + (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ + (head1)->tqh_last = (head2)->tqh_last; \ + TAILQ_INIT((head2)); \ + QMD_TRACE_HEAD(head1); \ + QMD_TRACE_HEAD(head2); \ + } \ +} while (0) + +#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) + +#define TAILQ_FIRST(head) ((head)->tqh_first) + +#define TAILQ_FOREACH(var, head, field) \ + for ((var) = TAILQ_FIRST((head)); \ + (var); \ + (var) = TAILQ_NEXT((var), field)) + +#define TAILQ_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ + (var); \ + (var) = TAILQ_NEXT((var), field)) + +#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = TAILQ_FIRST((head)); \ + (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ + for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ + (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = TAILQ_LAST((head), headname); \ + (var); \ + (var) = TAILQ_PREV((var), headname, field)) + +#define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field) \ + for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ + (var); \ + (var) = TAILQ_PREV((var), headname, field)) + +#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ + for ((var) = TAILQ_LAST((head), headname); \ + (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ + (var) = (tvar)) + +#define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \ + for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ + (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ + (var) = (tvar)) + +#define TAILQ_INIT(head) do { \ + TAILQ_FIRST((head)) = NULL; \ + (head)->tqh_last = &TAILQ_FIRST((head)); \ + QMD_TRACE_HEAD(head); \ +} while (0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + QMD_TAILQ_CHECK_NEXT(listelm, field); \ + if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ + TAILQ_NEXT((elm), field)->field.tqe_prev = \ + &TAILQ_NEXT((elm), field); \ + else { \ + (head)->tqh_last = &TAILQ_NEXT((elm), field); \ + QMD_TRACE_HEAD(head); \ + } \ + TAILQ_NEXT((listelm), field) = (elm); \ + (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ + QMD_TRACE_ELEM(&(elm)->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ +} while (0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + QMD_TAILQ_CHECK_PREV(listelm, field); \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + TAILQ_NEXT((elm), field) = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ + QMD_TRACE_ELEM(&(elm)->field); \ + QMD_TRACE_ELEM(&(listelm)->field); \ +} while (0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + QMD_TAILQ_CHECK_HEAD(head, field); \ + if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ + TAILQ_FIRST((head))->field.tqe_prev = \ + &TAILQ_NEXT((elm), field); \ + else \ + (head)->tqh_last = &TAILQ_NEXT((elm), field); \ + TAILQ_FIRST((head)) = (elm); \ + (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ + QMD_TRACE_HEAD(head); \ + QMD_TRACE_ELEM(&(elm)->field); \ +} while (0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + QMD_TAILQ_CHECK_TAIL(head, field); \ + TAILQ_NEXT((elm), field) = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &TAILQ_NEXT((elm), field); \ + QMD_TRACE_HEAD(head); \ + QMD_TRACE_ELEM(&(elm)->field); \ +} while (0) + +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) + +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) + +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) + +#define TAILQ_REMOVE(head, elm, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ + QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ + QMD_TAILQ_CHECK_NEXT(elm, field); \ + QMD_TAILQ_CHECK_PREV(elm, field); \ + if ((TAILQ_NEXT((elm), field)) != NULL) \ + TAILQ_NEXT((elm), field)->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else { \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + QMD_TRACE_HEAD(head); \ + } \ + *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ + TRASHIT(*oldnext); \ + TRASHIT(*oldprev); \ + QMD_TRACE_ELEM(&(elm)->field); \ +} while (0) + +#define TAILQ_SWAP(head1, head2, type, field) do { \ + QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \ + QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \ + (head1)->tqh_first = (head2)->tqh_first; \ + (head1)->tqh_last = (head2)->tqh_last; \ + (head2)->tqh_first = swap_first; \ + (head2)->tqh_last = swap_last; \ + if ((swap_first = (head1)->tqh_first) != NULL) \ + swap_first->field.tqe_prev = &(head1)->tqh_first; \ + else \ + (head1)->tqh_last = &(head1)->tqh_first; \ + if ((swap_first = (head2)->tqh_first) != NULL) \ + swap_first->field.tqe_prev = &(head2)->tqh_first; \ + else \ + (head2)->tqh_last = &(head2)->tqh_first; \ +} while (0) + +#endif /* !_SYS_QUEUE_H_ */ diff --git a/src/common/str_util.c b/src/common/str_util.c new file mode 100644 index 0000000000000000000000000000000000000000..74ab524192218ec41c6550cf0db17ac6314b1d93 --- /dev/null +++ b/src/common/str_util.c @@ -0,0 +1,516 @@ + +#ifndef EXCLUDE_COMMON + +#include "common/str_util.h" +#include "common/mg_mem.h" +#include "common/platform.h" + +#ifndef C_DISABLE_BUILTIN_SNPRINTF +#define C_DISABLE_BUILTIN_SNPRINTF 0 +#endif + +#include "common/mg_mem.h" + +size_t c_strnlen(const char *s, size_t maxlen) WEAK; +size_t c_strnlen(const char *s, size_t maxlen) { + size_t l = 0; + for (; l < maxlen && s[l] != '\0'; l++) { + } + return l; +} + +#define C_SNPRINTF_APPEND_CHAR(ch) \ + do { \ + if (i < (int) buf_size) buf[i] = ch; \ + i++; \ + } while (0) + +#define C_SNPRINTF_FLAG_ZERO 1 + +#if C_DISABLE_BUILTIN_SNPRINTF +int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) WEAK; +int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) { + return vsnprintf(buf, buf_size, fmt, ap); +} +#else +static int c_itoa(char *buf, size_t buf_size, int64_t num, int base, int flags, + int field_width) { + char tmp[40]; + int i = 0, k = 0, neg = 0; + + if (num < 0) { + neg++; + num = -num; + } + + /* Print into temporary buffer - in reverse order */ + do { + int rem = num % base; + if (rem < 10) { + tmp[k++] = '0' + rem; + } else { + tmp[k++] = 'a' + (rem - 10); + } + num /= base; + } while (num > 0); + + /* Zero padding */ + if (flags && C_SNPRINTF_FLAG_ZERO) { + while (k < field_width && k < (int) sizeof(tmp) - 1) { + tmp[k++] = '0'; + } + } + + /* And sign */ + if (neg) { + tmp[k++] = '-'; + } + + /* Now output */ + while (--k >= 0) { + C_SNPRINTF_APPEND_CHAR(tmp[k]); + } + + return i; +} + +int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) WEAK; +int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) { + int ch, i = 0, len_mod, flags, precision, field_width; + + while ((ch = *fmt++) != '\0') { + if (ch != '%') { + C_SNPRINTF_APPEND_CHAR(ch); + } else { + /* + * Conversion specification: + * zero or more flags (one of: # 0 - <space> + ') + * an optional minimum field width (digits) + * an optional precision (. followed by digits, or *) + * an optional length modifier (one of: hh h l ll L q j z t) + * conversion specifier (one of: d i o u x X e E f F g G a A c s p n) + */ + flags = field_width = precision = len_mod = 0; + + /* Flags. only zero-pad flag is supported. */ + if (*fmt == '0') { + flags |= C_SNPRINTF_FLAG_ZERO; + } + + /* Field width */ + while (*fmt >= '0' && *fmt <= '9') { + field_width *= 10; + field_width += *fmt++ - '0'; + } + /* Dynamic field width */ + if (*fmt == '*') { + field_width = va_arg(ap, int); + fmt++; + } + + /* Precision */ + if (*fmt == '.') { + fmt++; + if (*fmt == '*') { + precision = va_arg(ap, int); + fmt++; + } else { + while (*fmt >= '0' && *fmt <= '9') { + precision *= 10; + precision += *fmt++ - '0'; + } + } + } + + /* Length modifier */ + switch (*fmt) { + case 'h': + case 'l': + case 'L': + case 'I': + case 'q': + case 'j': + case 'z': + case 't': + len_mod = *fmt++; + if (*fmt == 'h') { + len_mod = 'H'; + fmt++; + } + if (*fmt == 'l') { + len_mod = 'q'; + fmt++; + } + break; + } + + ch = *fmt++; + if (ch == 's') { + const char *s = va_arg(ap, const char *); /* Always fetch parameter */ + int j; + int pad = field_width - (precision >= 0 ? c_strnlen(s, precision) : 0); + for (j = 0; j < pad; j++) { + C_SNPRINTF_APPEND_CHAR(' '); + } + + /* `s` may be NULL in case of %.*s */ + if (s != NULL) { + /* Ignore negative and 0 precisions */ + for (j = 0; (precision <= 0 || j < precision) && s[j] != '\0'; j++) { + C_SNPRINTF_APPEND_CHAR(s[j]); + } + } + } else if (ch == 'c') { + ch = va_arg(ap, int); /* Always fetch parameter */ + C_SNPRINTF_APPEND_CHAR(ch); + } else if (ch == 'd' && len_mod == 0) { + i += c_itoa(buf + i, buf_size - i, va_arg(ap, int), 10, flags, + field_width); + } else if (ch == 'd' && len_mod == 'l') { + i += c_itoa(buf + i, buf_size - i, va_arg(ap, long), 10, flags, + field_width); +#ifdef SSIZE_MAX + } else if (ch == 'd' && len_mod == 'z') { + i += c_itoa(buf + i, buf_size - i, va_arg(ap, ssize_t), 10, flags, + field_width); +#endif + } else if (ch == 'd' && len_mod == 'q') { + i += c_itoa(buf + i, buf_size - i, va_arg(ap, int64_t), 10, flags, + field_width); + } else if ((ch == 'x' || ch == 'u') && len_mod == 0) { + i += c_itoa(buf + i, buf_size - i, va_arg(ap, unsigned), + ch == 'x' ? 16 : 10, flags, field_width); + } else if ((ch == 'x' || ch == 'u') && len_mod == 'l') { + i += c_itoa(buf + i, buf_size - i, va_arg(ap, unsigned long), + ch == 'x' ? 16 : 10, flags, field_width); + } else if ((ch == 'x' || ch == 'u') && len_mod == 'z') { + i += c_itoa(buf + i, buf_size - i, va_arg(ap, size_t), + ch == 'x' ? 16 : 10, flags, field_width); + } else if (ch == 'p') { + unsigned long num = (unsigned long) (uintptr_t) va_arg(ap, void *); + C_SNPRINTF_APPEND_CHAR('0'); + C_SNPRINTF_APPEND_CHAR('x'); + i += c_itoa(buf + i, buf_size - i, num, 16, flags, 0); + } else { +#ifndef NO_LIBC + /* + * TODO(lsm): abort is not nice in a library, remove it + * Also, ESP8266 SDK doesn't have it + */ + abort(); +#endif + } + } + } + + /* Zero-terminate the result */ + if (buf_size > 0) { + buf[i < (int) buf_size ? i : (int) buf_size - 1] = '\0'; + } + + return i; +} +#endif + +int c_snprintf(char *buf, size_t buf_size, const char *fmt, ...) WEAK; +int c_snprintf(char *buf, size_t buf_size, const char *fmt, ...) { + int result; + va_list ap; + va_start(ap, fmt); + result = c_vsnprintf(buf, buf_size, fmt, ap); + va_end(ap); + return result; +} + +#ifdef _WIN32 +int to_wchar(const char *path, wchar_t *wbuf, size_t wbuf_len) { + int ret; + char buf[MAX_PATH * 2], buf2[MAX_PATH * 2], *p; + + strncpy(buf, path, sizeof(buf)); + buf[sizeof(buf) - 1] = '\0'; + + /* Trim trailing slashes. Leave backslash for paths like "X:\" */ + p = buf + strlen(buf) - 1; + while (p > buf && p[-1] != ':' && (p[0] == '\\' || p[0] == '/')) *p-- = '\0'; + + memset(wbuf, 0, wbuf_len * sizeof(wchar_t)); + ret = MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, (int) wbuf_len); + + /* + * Convert back to Unicode. If doubly-converted string does not match the + * original, something is fishy, reject. + */ + WideCharToMultiByte(CP_UTF8, 0, wbuf, (int) wbuf_len, buf2, sizeof(buf2), + NULL, NULL); + if (strcmp(buf, buf2) != 0) { + wbuf[0] = L'\0'; + ret = 0; + } + + return ret; +} +#endif /* _WIN32 */ + +/* The simplest O(mn) algorithm. Better implementation are GPLed */ +const char *c_strnstr(const char *s, const char *find, size_t slen) WEAK; +const char *c_strnstr(const char *s, const char *find, size_t slen) { + size_t find_length = strlen(find); + size_t i; + + for (i = 0; i < slen; i++) { + if (i + find_length > slen) { + return NULL; + } + + if (strncmp(&s[i], find, find_length) == 0) { + return &s[i]; + } + } + + return NULL; +} + +#if CS_ENABLE_STRDUP +char *strdup(const char *src) WEAK; +char *strdup(const char *src) { + size_t len = strlen(src) + 1; + char *ret = MG_MALLOC(len); + if (ret != NULL) { + strcpy(ret, src); + } + return ret; +} +#endif + +void cs_to_hex(char *to, const unsigned char *p, size_t len) WEAK; +void cs_to_hex(char *to, const unsigned char *p, size_t len) { + static const char *hex = "0123456789abcdef"; + + for (; len--; p++) { + *to++ = hex[p[0] >> 4]; + *to++ = hex[p[0] & 0x0f]; + } + *to = '\0'; +} + +static int fourbit(int ch) { + if (ch >= '0' && ch <= '9') { + return ch - '0'; + } else if (ch >= 'a' && ch <= 'f') { + return ch - 'a' + 10; + } else if (ch >= 'A' && ch <= 'F') { + return ch - 'A' + 10; + } + return 0; +} + +void cs_from_hex(char *to, const char *p, size_t len) WEAK; +void cs_from_hex(char *to, const char *p, size_t len) { + size_t i; + + for (i = 0; i < len; i += 2) { + *to++ = (fourbit(p[i]) << 4) + fourbit(p[i + 1]); + } + *to = '\0'; +} + +#if CS_ENABLE_TO64 +int64_t cs_to64(const char *s) WEAK; +int64_t cs_to64(const char *s) { + int64_t result = 0; + int64_t neg = 1; + while (*s && isspace((unsigned char) *s)) s++; + if (*s == '-') { + neg = -1; + s++; + } + while (isdigit((unsigned char) *s)) { + result *= 10; + result += (*s - '0'); + s++; + } + return result * neg; +} +#endif + +static int str_util_lowercase(const char *s) { + return tolower(*(const unsigned char *) s); +} + +int mg_ncasecmp(const char *s1, const char *s2, size_t len) WEAK; +int mg_ncasecmp(const char *s1, const char *s2, size_t len) { + int diff = 0; + + if (len > 0) do { + diff = str_util_lowercase(s1++) - str_util_lowercase(s2++); + } while (diff == 0 && s1[-1] != '\0' && --len > 0); + + return diff; +} + +int mg_casecmp(const char *s1, const char *s2) WEAK; +int mg_casecmp(const char *s1, const char *s2) { + return mg_ncasecmp(s1, s2, (size_t) ~0); +} + +int mg_asprintf(char **buf, size_t size, const char *fmt, ...) WEAK; +int mg_asprintf(char **buf, size_t size, const char *fmt, ...) { + int ret; + va_list ap; + va_start(ap, fmt); + ret = mg_avprintf(buf, size, fmt, ap); + va_end(ap); + return ret; +} + +int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap) WEAK; +int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap) { + va_list ap_copy; + int len; + + va_copy(ap_copy, ap); + len = vsnprintf(*buf, size, fmt, ap_copy); + va_end(ap_copy); + + if (len < 0) { + /* eCos and Windows are not standard-compliant and return -1 when + * the buffer is too small. Keep allocating larger buffers until we + * succeed or out of memory. */ + *buf = NULL; /* LCOV_EXCL_START */ + while (len < 0) { + MG_FREE(*buf); + if (size == 0) { + size = 5; + } + size *= 2; + if ((*buf = (char *) MG_MALLOC(size)) == NULL) { + len = -1; + break; + } + va_copy(ap_copy, ap); + len = vsnprintf(*buf, size - 1, fmt, ap_copy); + va_end(ap_copy); + } + + /* + * Microsoft version of vsnprintf() is not always null-terminated, so put + * the terminator manually + */ + (*buf)[len] = 0; + /* LCOV_EXCL_STOP */ + } else if (len >= (int) size) { + /* Standard-compliant code path. Allocate a buffer that is large enough. */ + if ((*buf = (char *) MG_MALLOC(len + 1)) == NULL) { + len = -1; /* LCOV_EXCL_LINE */ + } else { /* LCOV_EXCL_LINE */ + va_copy(ap_copy, ap); + len = vsnprintf(*buf, len + 1, fmt, ap_copy); + va_end(ap_copy); + } + } + + return len; +} + +const char *mg_next_comma_list_entry(const char *, struct mg_str *, + struct mg_str *) WEAK; +const char *mg_next_comma_list_entry(const char *list, struct mg_str *val, + struct mg_str *eq_val) { + struct mg_str ret = mg_next_comma_list_entry_n(mg_mk_str(list), val, eq_val); + return ret.p; +} + +struct mg_str mg_next_comma_list_entry_n(struct mg_str list, struct mg_str *val, + struct mg_str *eq_val) WEAK; +struct mg_str mg_next_comma_list_entry_n(struct mg_str list, struct mg_str *val, + struct mg_str *eq_val) { + if (list.len == 0) { + /* End of the list */ + list = mg_mk_str(NULL); + } else { + const char *chr = NULL; + *val = list; + + if ((chr = mg_strchr(*val, ',')) != NULL) { + /* Comma found. Store length and shift the list ptr */ + val->len = chr - val->p; + chr++; + list.len -= (chr - list.p); + list.p = chr; + } else { + /* This value is the last one */ + list = mg_mk_str_n(list.p + list.len, 0); + } + + if (eq_val != NULL) { + /* Value has form "x=y", adjust pointers and lengths */ + /* so that val points to "x", and eq_val points to "y". */ + eq_val->len = 0; + eq_val->p = (const char *) memchr(val->p, '=', val->len); + if (eq_val->p != NULL) { + eq_val->p++; /* Skip over '=' character */ + eq_val->len = val->p + val->len - eq_val->p; + val->len = (eq_val->p - val->p) - 1; + } + } + } + + return list; +} + +size_t mg_match_prefix_n(const struct mg_str, const struct mg_str) WEAK; +size_t mg_match_prefix_n(const struct mg_str pattern, const struct mg_str str) { + const char *or_str; + size_t res = 0, len = 0, i = 0, j = 0; + + if ((or_str = (const char *) memchr(pattern.p, '|', pattern.len)) != NULL || + (or_str = (const char *) memchr(pattern.p, ',', pattern.len)) != NULL) { + struct mg_str pstr = {pattern.p, (size_t)(or_str - pattern.p)}; + res = mg_match_prefix_n(pstr, str); + if (res > 0) return res; + pstr.p = or_str + 1; + pstr.len = (pattern.p + pattern.len) - (or_str + 1); + return mg_match_prefix_n(pstr, str); + } + + for (; i < pattern.len && j < str.len; i++, j++) { + if (pattern.p[i] == '?') { + continue; + } else if (pattern.p[i] == '*') { + i++; + if (i < pattern.len && pattern.p[i] == '*') { + i++; + len = str.len - j; + } else { + len = 0; + while (j + len < str.len && str.p[j + len] != '/') len++; + } + if (i == pattern.len || (pattern.p[i] == '$' && i == pattern.len - 1)) + return j + len; + do { + const struct mg_str pstr = {pattern.p + i, pattern.len - i}; + const struct mg_str sstr = {str.p + j + len, str.len - j - len}; + res = mg_match_prefix_n(pstr, sstr); + } while (res == 0 && len != 0 && len-- > 0); + return res == 0 ? 0 : j + res + len; + } else if (str_util_lowercase(&pattern.p[i]) != + str_util_lowercase(&str.p[j])) { + break; + } + } + if (i < pattern.len && pattern.p[i] == '$') { + return j == str.len ? str.len : 0; + } + return i == pattern.len ? j : 0; +} + +size_t mg_match_prefix(const char *, int, const char *) WEAK; +size_t mg_match_prefix(const char *pattern, int pattern_len, const char *str) { + const struct mg_str pstr = {pattern, (size_t) pattern_len}; + struct mg_str s = {str, 0}; + if (str != NULL) s.len = strlen(str); + return mg_match_prefix_n(pstr, s); +} + +#endif /* EXCLUDE_COMMON */ diff --git a/src/common/str_util.h b/src/common/str_util.h new file mode 100644 index 0000000000000000000000000000000000000000..e023aa629e9a5300fa2905186a4c86ced27007f9 --- /dev/null +++ b/src/common/str_util.h @@ -0,0 +1,182 @@ + +#ifndef CS_COMMON_STR_UTIL_H_ +#define CS_COMMON_STR_UTIL_H_ + +#include <stdarg.h> +#include <stdlib.h> + +#include "common/mg_str.h" +#include "common/platform.h" + +#ifndef CS_ENABLE_STRDUP +#define CS_ENABLE_STRDUP 0 +#endif + +#ifndef CS_ENABLE_TO64 +#define CS_ENABLE_TO64 0 +#endif + +/* + * Expands to a string representation of its argument: e.g. + * `CS_STRINGIFY_LIT(5) expands to "5"` + */ +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#define CS_STRINGIFY_LIT(...) #__VA_ARGS__ +#else +#define CS_STRINGIFY_LIT(x) #x +#endif + +/* + * Expands to a string representation of its argument, which is allowed + * to be a macro: e.g. + * + * #define FOO 123 + * CS_STRINGIFY_MACRO(FOO) + * + * expands to 123. + */ +#define CS_STRINGIFY_MACRO(x) CS_STRINGIFY_LIT(x) + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Equivalent of standard `strnlen()`. + */ +size_t c_strnlen(const char *s, size_t maxlen); + +/* + * Equivalent of standard `snprintf()`. + */ +int c_snprintf(char *buf, size_t buf_size, const char *format, ...) + PRINTF_LIKE(3, 4); + +/* + * Equivalent of standard `vsnprintf()`. + */ +int c_vsnprintf(char *buf, size_t buf_size, const char *format, va_list ap); + +/* + * Find the first occurrence of find in s, where the search is limited to the + * first slen characters of s. + */ +const char *c_strnstr(const char *s, const char *find, size_t slen); + +/* + * Stringify binary data. Output buffer size must be 2 * size_of_input + 1 + * because each byte of input takes 2 bytes in string representation + * plus 1 byte for the terminating \0 character. + */ +void cs_to_hex(char *to, const unsigned char *p, size_t len); + +/* + * Convert stringified binary data back to binary. + * Does the reverse of `cs_to_hex()`. + */ +void cs_from_hex(char *to, const char *p, size_t len); + +#if CS_ENABLE_STRDUP +/* + * Equivalent of standard `strdup()`, defined if only `CS_ENABLE_STRDUP` is 1. + */ +char *strdup(const char *src); +#endif + +#if CS_ENABLE_TO64 +#include <stdint.h> +/* + * Simple string -> int64 conversion routine. + */ +int64_t cs_to64(const char *s); +#endif + +/* + * Cross-platform version of `strncasecmp()`. + */ +int mg_ncasecmp(const char *s1, const char *s2, size_t len); + +/* + * Cross-platform version of `strcasecmp()`. + */ +int mg_casecmp(const char *s1, const char *s2); + +/* + * Prints message to the buffer. If the buffer is large enough to hold the + * message, it returns buffer. If buffer is to small, it allocates a large + * enough buffer on heap and returns allocated buffer. + * This is a supposed use case: + * + * ```c + * char buf[5], *p = buf; + * mg_avprintf(&p, sizeof(buf), "%s", "hi there"); + * use_p_somehow(p); + * if (p != buf) { + * free(p); + * } + * ``` + * + * The purpose of this is to avoid malloc-ing if generated strings are small. + */ +int mg_asprintf(char **buf, size_t size, const char *fmt, ...) + PRINTF_LIKE(3, 4); + +/* Same as mg_asprintf, but takes varargs list. */ +int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap); + +/* + * A helper function for traversing a comma separated list of values. + * It returns a list pointer shifted to the next value or NULL if the end + * of the list found. + * The value is stored in a val vector. If the value has a form "x=y", then + * eq_val vector is initialised to point to the "y" part, and val vector length + * is adjusted to point only to "x". + * If the list is just a comma separated list of entries, like "aa,bb,cc" then + * `eq_val` will contain zero-length string. + * + * The purpose of this function is to parse comma separated string without + * any copying/memory allocation. + */ +const char *mg_next_comma_list_entry(const char *list, struct mg_str *val, + struct mg_str *eq_val); + +/* + * Like `mg_next_comma_list_entry()`, but takes `list` as `struct mg_str`. + * NB: Test return value's .p, not .len. On last itreation that yields result + * .len will be 0 but .p will not. When finished, .p will be NULL. + */ +struct mg_str mg_next_comma_list_entry_n(struct mg_str list, struct mg_str *val, + struct mg_str *eq_val); + +/* + * Matches 0-terminated string (mg_match_prefix) or string with given length + * mg_match_prefix_n against a glob pattern. Glob syntax: + * ``` + * - * matches zero or more characters until a slash character / + * - ** matches zero or more characters + * - ? Matches exactly one character which is not a slash / + * - | or , divides alternative patterns + * - any other character matches itself + * ``` + * Match is case-insensitive. Return number of bytes matched. + * Examples: + * ``` + * mg_match_prefix("a*f", len, "abcdefgh") == 6 + * mg_match_prefix("a*f", len, "abcdexgh") == 0 + * mg_match_prefix("a*f|de*,xy", len, "defgh") == 5 + * mg_match_prefix("?*", len, "abc") == 3 + * mg_match_prefix("?*", len, "") == 0 + * ``` + */ +size_t mg_match_prefix(const char *pattern, int pattern_len, const char *str); + +/* + * Like `mg_match_prefix()`, but takes `pattern` and `str` as `struct mg_str`. + */ +size_t mg_match_prefix_n(const struct mg_str pattern, const struct mg_str str); + +#ifdef __cplusplus +} +#endif + +#endif /* CS_COMMON_STR_UTIL_H_ */ diff --git a/src/mg_coap.c b/src/mg_coap.c index 29667b7c5f7c03e1ee8837d11d1106c3fb0dbdca..abbf562568ad07130c80a6b016fd493b00cd9f82 100644 --- a/src/mg_coap.c +++ b/src/mg_coap.c @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2015 Cesanta Software Limited - * All rights reserved - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ #include "mg_internal.h" #include "mg_coap.h" diff --git a/src/mg_coap.h b/src/mg_coap.h index 296933fec209b2c01720d650cb34e3251320b641..21b6cfe2dbc0206ae73868513cec01e0f83df417 100644 --- a/src/mg_coap.h +++ b/src/mg_coap.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2015 Cesanta Software Limited - * All rights reserved - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ /* * === CoAP API reference diff --git a/src/mg_dns.c b/src/mg_dns.c index 0db0cb70c57fd2c6acdbe702ccb4a14e2fc1e55a..ad530619615a4119099f25c88c7ef1e27f182236 100644 --- a/src/mg_dns.c +++ b/src/mg_dns.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_DNS diff --git a/src/mg_dns.h b/src/mg_dns.h index 88d3c3988613087176514b78a1bda8e8c6e3cb48..7fd417321dd1626aa666bbcb2920de69b46a2f3b 100644 --- a/src/mg_dns.h +++ b/src/mg_dns.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ /* * === DNS API reference diff --git a/src/mg_dns_server.c b/src/mg_dns_server.c index 2dafb46d5232e7b7567d1f4f647dfccc6043420b..7a1350fbd4c88dbec79e8d3f1fe563236cff0118 100644 --- a/src/mg_dns_server.c +++ b/src/mg_dns_server.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_DNS_SERVER diff --git a/src/mg_dns_server.h b/src/mg_dns_server.h index 168a17433891f1e4f7fdc5e2295dc3f6f5edf2a5..5f4e813e5fae428f932ee13080a75880972dcd1b 100644 --- a/src/mg_dns_server.h +++ b/src/mg_dns_server.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ /* * === DNS server API reference diff --git a/src/mg_features.h b/src/mg_features.h index 515242d276ab67c30c71510891eae966419182d4..7485937fa0e4763c001f665a4c4c4ea929d1ee5a 100644 --- a/src/mg_features.h +++ b/src/mg_features.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #ifndef CS_MONGOOSE_SRC_FEATURES_H_ #define CS_MONGOOSE_SRC_FEATURES_H_ diff --git a/src/mg_http.c b/src/mg_http.c index 919251aab88229ed8fb91112ba48c2e2d2eaa39c..39bf78bf047359073f35bf42f7e5d68f9553e4ff 100644 --- a/src/mg_http.c +++ b/src/mg_http.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_HTTP diff --git a/src/mg_http.h b/src/mg_http.h index 385c210ac85a4eed9f9924023be927269d24a37c..45797df3e4b917feca78726fae9a4314fcc906b2 100644 --- a/src/mg_http.h +++ b/src/mg_http.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ /* * === Common API reference diff --git a/src/mg_http_cgi.c b/src/mg_http_cgi.c index b06c5f80d97b983e2cb7f6ced0e5667b7d4f4d5a..fe8b84ba9f925f0353c54baebb1e487ac23934fd 100644 --- a/src/mg_http_cgi.c +++ b/src/mg_http_cgi.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #ifndef _WIN32 #include <signal.h> diff --git a/src/mg_http_ssi.c b/src/mg_http_ssi.c index b96d611288684a4411376a2789ae68a9912af561..e45afc4cce2a3e3424421a18d64ee2c136169207 100644 --- a/src/mg_http_ssi.c +++ b/src/mg_http_ssi.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_HTTP && MG_ENABLE_HTTP_SSI && MG_ENABLE_FILESYSTEM diff --git a/src/mg_http_webdav.c b/src/mg_http_webdav.c index 6efb928c35d371a78391189101ff581cce2a1406..4878e6d7c5a8098ae111ae306129b774304d2883 100644 --- a/src/mg_http_webdav.c +++ b/src/mg_http_webdav.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_HTTP && MG_ENABLE_HTTP_WEBDAV diff --git a/src/mg_http_websocket.c b/src/mg_http_websocket.c index 317b4997b8a9426aad09e711d717735725728940..1f1a0da9b1c5b07b53189fe65c7e1a023efe337a 100644 --- a/src/mg_http_websocket.c +++ b/src/mg_http_websocket.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_HTTP && MG_ENABLE_HTTP_WEBSOCKET diff --git a/src/mg_internal.h b/src/mg_internal.h index 250b6fe1000faf5910215d453fc7d715d28ddf33..92ab71e62185501dc13ed538edd8af8d4d290389 100644 --- a/src/mg_internal.h +++ b/src/mg_internal.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #ifndef CS_MONGOOSE_SRC_INTERNAL_H_ #define CS_MONGOOSE_SRC_INTERNAL_H_ diff --git a/src/mg_license.h b/src/mg_license.h deleted file mode 100644 index 484389d251f9f3750d280a345213723dab8e44b5..0000000000000000000000000000000000000000 --- a/src/mg_license.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2004-2013 Sergey Lyubka - * Copyright (c) 2013-2020 Cesanta Software Limited - * All rights reserved - * - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ diff --git a/src/mg_modules.mk b/src/mg_modules.mk deleted file mode 100644 index e0e51bc7a683cab7b9621f2c138b8f139ebc101e..0000000000000000000000000000000000000000 --- a/src/mg_modules.mk +++ /dev/null @@ -1,105 +0,0 @@ -COMMON = ../../common - -HEADERS = mg_common.h \ - $(COMMON)/platform.h \ - $(COMMON)/platforms/platform_windows.h \ - $(COMMON)/platforms/platform_unix.h \ - $(COMMON)/platforms/platform_esp32.h \ - $(COMMON)/platforms/platform_esp8266.h \ - $(COMMON)/platforms/platform_cc3100.h \ - $(COMMON)/platforms/platform_cc3200.h \ - $(COMMON)/platforms/platform_cc3220.h \ - $(COMMON)/platforms/platform_msp432.h \ - $(COMMON)/platforms/platform_tm4c129.h \ - $(COMMON)/platforms/platform_mbed.h \ - $(COMMON)/platforms/platform_nrf51.h \ - $(COMMON)/platforms/platform_nrf52.h \ - $(COMMON)/platforms/simplelink/cs_simplelink.h \ - $(COMMON)/platforms/platform_wince.h \ - $(COMMON)/platforms/platform_nxp_lpc.h \ - $(COMMON)/platforms/platform_nxp_kinetis.h \ - $(COMMON)/platforms/platform_pic32.h \ - $(COMMON)/platforms/platform_rs14100.h \ - $(COMMON)/platforms/platform_stm32.h \ - $(COMMON)/platforms/lwip/mg_lwip.h \ - $(COMMON)/cs_md5.h \ - $(COMMON)/cs_sha1.h \ - $(COMMON)/cs_time.h \ - $(COMMON)/mg_str.h \ - $(COMMON)/mbuf.h \ - $(COMMON)/cs_base64.h \ - $(COMMON)/str_util.h \ - $(COMMON)/queue.h \ - mg_features.h \ - mg_net_if.h \ - mg_ssl_if.h \ - mg_net.h \ - mg_uri.h \ - mg_util.h \ - mg_http.h \ - mg_http_server.h \ - mg_http_client.h \ - mg_mqtt.h \ - mg_mqtt_server.h \ - mg_dns.h \ - mg_dns_server.h \ - mg_resolv.h \ - mg_coap.h \ - mg_sntp.h \ - mg_socks.h - -SOURCES = $(COMMON)/mg_mem.h \ - $(COMMON)/cs_base64.c \ - $(COMMON)/cs_dbg.h \ - $(COMMON)/cs_dbg.c \ - $(COMMON)/cs_dirent.h \ - $(COMMON)/cs_dirent.c \ - $(COMMON)/cs_time.c \ - $(COMMON)/cs_endian.h \ - $(COMMON)/cs_md5.c \ - $(COMMON)/cs_sha1.c \ - $(COMMON)/mbuf.c \ - $(COMMON)/mg_str.c \ - $(COMMON)/str_util.c \ - mg_net.c \ - mg_net_if_socket.h \ - mg_net_if_socks.h \ - mg_net_if.c \ - mg_net_if_null.c \ - mg_net_if_socket.c \ - mg_net_if_socks.c \ - mg_ssl_if_openssl.c \ - mg_ssl_if_mbedtls.c \ - mg_uri.c \ - mg_http.c \ - mg_http_cgi.c \ - mg_http_ssi.c \ - mg_http_webdav.c \ - mg_http_websocket.c \ - mg_util.c \ - mg_mqtt.c \ - mg_mqtt_server.c \ - mg_dns.c \ - mg_dns_server.c \ - mg_resolv.c \ - mg_coap.c \ - mg_sntp.c \ - mg_socks.c \ - $(COMMON)/platforms/cc3200/cc3200_libc.c \ - $(COMMON)/platforms/msp432/msp432_libc.c \ - $(COMMON)/platforms/nrf5/nrf5_libc.c \ - $(COMMON)/platforms/simplelink/sl_fs_slfs.h \ - $(COMMON)/platforms/simplelink/sl_fs_slfs.c \ - $(COMMON)/platforms/simplelink/sl_fs.c \ - $(COMMON)/platforms/simplelink/sl_socket.c \ - $(COMMON)/platforms/simplelink/sl_mg_task.c \ - $(COMMON)/platforms/simplelink/sl_net_if.h \ - $(COMMON)/platforms/simplelink/sl_net_if.c \ - $(COMMON)/platforms/simplelink/sl_ssl_if.c \ - $(COMMON)/platforms/lwip/mg_lwip_net_if.h \ - $(COMMON)/platforms/lwip/mg_lwip_net_if.c \ - $(COMMON)/platforms/lwip/mg_lwip_ev_mgr.c \ - $(COMMON)/platforms/wince/wince_libc.c \ - $(COMMON)/platforms/pic32/pic32_net_if.h \ - $(COMMON)/platforms/pic32/pic32_net_if.c \ - $(COMMON)/platforms/windows/windows_direct.c diff --git a/src/mg_mqtt.c b/src/mg_mqtt.c index 06a3814d1988227cee82f336a80a3b1eddfec811..1ac530c19b352e9816995d3275b162b5561eee12 100644 --- a/src/mg_mqtt.c +++ b/src/mg_mqtt.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_MQTT diff --git a/src/mg_mqtt.h b/src/mg_mqtt.h index 31dad5835f5fdb3f6a83a09b6f3079bda1f31dae..208799bdd627031d720dde9b3d07e70857dc0487 100644 --- a/src/mg_mqtt.h +++ b/src/mg_mqtt.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ /* * === MQTT API reference diff --git a/src/mg_mqtt_client.h b/src/mg_mqtt_client.h deleted file mode 100644 index 998414d12625082b3c77cfe75766479ba1195931..0000000000000000000000000000000000000000 --- a/src/mg_mqtt_client.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * === API reference - */ - -#ifndef CS_MONGOOSE_SRC_MQTT_CLIENT_H_ -#define CS_MONGOOSE_SRC_MQTT_CLIENT_H_ - -#endif /* CS_MONGOOSE_SRC_MQTT_CLIENT_H_ */ diff --git a/src/mg_mqtt_server.c b/src/mg_mqtt_server.c index cb5664801122f06cef1793846b2bfb002878f016..fe0440f8f2281445dd3d5443f7afda91bce9a9b8 100644 --- a/src/mg_mqtt_server.c +++ b/src/mg_mqtt_server.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #include "mg_internal.h" #include "mg_mqtt_server.h" diff --git a/src/mg_mqtt_server.h b/src/mg_mqtt_server.h index 8c34b5e64fa2e7d53046a9f074d838819a392b36..80a23804b2f868268b90f05b605ab77a557b7d3b 100644 --- a/src/mg_mqtt_server.h +++ b/src/mg_mqtt_server.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ /* * === MQTT Server API reference diff --git a/src/mg_net.c b/src/mg_net.c index b621b0efae39cb602388a2d17e129558076ab76b..ad8998b115d6cdc9483748475d10416caa271b1b 100644 --- a/src/mg_net.c +++ b/src/mg_net.c @@ -1,20 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - * - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ #include "common/cs_time.h" #include "mg_dns.h" diff --git a/src/mg_net.h b/src/mg_net.h index e6ff21ba7e8943f3e2b3c24bc99eff74e5d80efb..89939bf29cc71d8c2942cd5d763f39ed1a845af0 100644 --- a/src/mg_net.h +++ b/src/mg_net.h @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ /* * === Core API: TCP/UDP/SSL diff --git a/src/mg_net_if.h b/src/mg_net_if.h index 1239d54a0ae6af2cb4092fe0b8902900c871b7e8..3d336d7440eb1bb7be54433ad33590dbbf613dd9 100644 --- a/src/mg_net_if.h +++ b/src/mg_net_if.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #ifndef CS_MONGOOSE_SRC_NET_IF_H_ #define CS_MONGOOSE_SRC_NET_IF_H_ diff --git a/src/mg_net_if_null.c b/src/mg_net_if_null.c index cf8bbaa103aed4569077841a3c98a63254c594ef..36e7504bc7d623e5df5779b4a349f2ba8924cac9 100644 --- a/src/mg_net_if_null.c +++ b/src/mg_net_if_null.c @@ -1,20 +1,3 @@ -/* - * Copyright (c) 2018 Cesanta Software Limited - * All rights reserved - * - * This software is dual-licensed: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. For the terms of this - * license, see <http://www.gnu.org/licenses/>. - * - * You are free to use this software under the terms of the GNU General - * Public License, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * Alternatively, you can license this software under a commercial - * license, as set out in <https://www.cesanta.com/license>. - */ static void mg_null_if_connect_tcp(struct mg_connection *c, const union socket_address *sa) { diff --git a/src/mg_net_if_socket.c b/src/mg_net_if_socket.c index c7f7f59a963dd0ab5272b205ef5b6bee4dd8a91f..18b7b0dd25b64ee24932f6527bec90bf4f1d6d12 100644 --- a/src/mg_net_if_socket.c +++ b/src/mg_net_if_socket.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_NET_IF_SOCKET diff --git a/src/mg_net_if_socket.h b/src/mg_net_if_socket.h index 744fc0f4fe6c6e943c33850efbea94da7d95bda0..e75778754262a56f8942b584069be32580f2da1a 100644 --- a/src/mg_net_if_socket.h +++ b/src/mg_net_if_socket.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #ifndef CS_MONGOOSE_SRC_NET_IF_SOCKET_H_ #define CS_MONGOOSE_SRC_NET_IF_SOCKET_H_ diff --git a/src/mg_net_if_socks.c b/src/mg_net_if_socks.c index 2a4214268769dfedff6c02633c8b5c92ffd57b93..72404417431bcaa434ffe49d00ae53946cfcded0 100644 --- a/src/mg_net_if_socks.c +++ b/src/mg_net_if_socks.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_SOCKS diff --git a/src/mg_net_if_socks.h b/src/mg_net_if_socks.h index 80e3107c743d53c5bfc14091301fb1205c35f71d..3e5e000c6ae9d514a4278d5a81683401860e648c 100644 --- a/src/mg_net_if_socks.h +++ b/src/mg_net_if_socks.h @@ -1,7 +1,3 @@ -/* -* Copyright (c) 2014-2017 Cesanta Software Limited -* All rights reserved -*/ #ifndef CS_MONGOOSE_SRC_NET_IF_SOCKS_H_ #define CS_MONGOOSE_SRC_NET_IF_SOCKS_H_ diff --git a/src/mg_resolv.c b/src/mg_resolv.c index a67c773870339c45cf4d9f84b5cff3ab5d3d611c..5eef4792fd749fff370efd083638fe60e5cb1a0b 100644 --- a/src/mg_resolv.c +++ b/src/mg_resolv.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_ASYNC_RESOLVER diff --git a/src/mg_resolv.h b/src/mg_resolv.h index a604c1790e93777e60f7e6b55b3c70240eff9329..651317375a2d3bb5750fa772a129b49867a254dc 100644 --- a/src/mg_resolv.h +++ b/src/mg_resolv.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ /* * === API reference diff --git a/src/mg_sntp.c b/src/mg_sntp.c index 5d40e1afe1a3aab2dadd88ecca76ddc6a7a7a1b2..dd9dbaf7587c4e2ead4f81663dd3b5176151e11f 100644 --- a/src/mg_sntp.c +++ b/src/mg_sntp.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2016 Cesanta Software Limited - * All rights reserved - */ #include "mg_internal.h" #include "mg_sntp.h" diff --git a/src/mg_sntp.h b/src/mg_sntp.h index 5cdff2ec37f56edc97e2e9bd16a3fc8fca9876f3..1d0ed5beaa446613d42511b9a0cec925cf5d52d5 100644 --- a/src/mg_sntp.h +++ b/src/mg_sntp.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2016 Cesanta Software Limited - * All rights reserved - */ #ifndef CS_MONGOOSE_SRC_SNTP_H_ #define CS_MONGOOSE_SRC_SNTP_H_ diff --git a/src/mg_socks.c b/src/mg_socks.c index 56b2d5c0edfabbeff19c807bcb8254712834e337..a97e175d5237e720fabd1b32a22ac1c1661494c8 100644 --- a/src/mg_socks.c +++ b/src/mg_socks.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2017 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_SOCKS diff --git a/src/mg_socks.h b/src/mg_socks.h index e7b231a0992b385219b7e782913cd1ccf0afa44b..7ac26a03e5560737b3753c5ff2c0cda180311946 100644 --- a/src/mg_socks.h +++ b/src/mg_socks.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2017 Cesanta Software Limited - * All rights reserved - */ #ifndef CS_MONGOOSE_SRC_SOCKS_H_ #define CS_MONGOOSE_SRC_SOCKS_H_ diff --git a/src/mg_ssl_if.h b/src/mg_ssl_if.h index 0ccd3f0a65ad295fe9730989a2ff490e74256069..1964fc6d5e6bcc45a7d85f70a710f08dfe572c66 100644 --- a/src/mg_ssl_if.h +++ b/src/mg_ssl_if.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #ifndef CS_MONGOOSE_SRC_SSL_IF_H_ #define CS_MONGOOSE_SRC_SSL_IF_H_ diff --git a/src/mg_ssl_if_mbedtls.c b/src/mg_ssl_if_mbedtls.c index d837481aaa2abc214a648bc866e1c4a95f86e13c..6ba4a01e6db12b5af1d42c5d35455bee4bb166e1 100644 --- a/src/mg_ssl_if_mbedtls.c +++ b/src/mg_ssl_if_mbedtls.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_MBEDTLS diff --git a/src/mg_ssl_if_openssl.c b/src/mg_ssl_if_openssl.c index 18d8b706fd76bc4cd78e83b806eb72b32a7fb807..4d6bbaeeca0edd3e32b5cbac3a17d3c790e360b8 100644 --- a/src/mg_ssl_if_openssl.c +++ b/src/mg_ssl_if_openssl.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014-2016 Cesanta Software Limited - * All rights reserved - */ #if MG_ENABLE_SSL && MG_SSL_IF == MG_SSL_IF_OPENSSL diff --git a/src/mg_uri.c b/src/mg_uri.c index 9b6228b893a9df27c87f354af9d66a667e8ce8bb..30591e5f70f4b9fd723eb664edb2a03566669965 100644 --- a/src/mg_uri.c +++ b/src/mg_uri.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #include "mg_internal.h" #include "mg_uri.h" diff --git a/src/mg_uri.h b/src/mg_uri.h index f79e547ca3cc7d639d6345fbe6d7268518542c83..6266fb278585b9df90cdfd4bd351e570edd2acb1 100644 --- a/src/mg_uri.h +++ b/src/mg_uri.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ /* * === URI diff --git a/src/mg_util.c b/src/mg_util.c index cfbd87e5a5736c1e5592e79c233ca5c4983f6cfa..69753996bafedc6dab5ac59c8251d0379e457979 100644 --- a/src/mg_util.c +++ b/src/mg_util.c @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ #include "common/cs_base64.h" #include "mg_internal.h" diff --git a/src/mg_util.h b/src/mg_util.h index 8ddeb770fdec2f50b1d4f6f11116f41bb5826223..4122aed37d499917a64da72929c289df64a76bf4 100644 --- a/src/mg_util.h +++ b/src/mg_util.h @@ -1,7 +1,3 @@ -/* - * Copyright (c) 2014 Cesanta Software Limited - * All rights reserved - */ /* * === Utility API diff --git a/src/mongoose.c.manifest b/src/mongoose.c.manifest new file mode 100644 index 0000000000000000000000000000000000000000..ada28d4138951eba13b963a2ca218e545d41b2fd --- /dev/null +++ b/src/mongoose.c.manifest @@ -0,0 +1,56 @@ +src/mg_internal.h +src/common/mg_mem.h +src/common/cs_base64.c +src/common/cs_dbg.h +src/common/cs_dbg.c +src/common/cs_dirent.h +src/common/cs_dirent.c +src/common/cs_time.c +src/common/cs_endian.h +src/common/cs_md5.c +src/common/cs_sha1.c +src/common/mbuf.c +src/common/mg_str.c +src/common/str_util.c +src/mg_net.c +src/mg_net_if_socket.h +src/mg_net_if_socks.h +src/mg_net_if.c +src/mg_net_if_null.c +src/mg_net_if_socket.c +src/mg_net_if_socks.c +src/mg_ssl_if_openssl.c +src/mg_ssl_if_mbedtls.c +src/mg_uri.c +src/mg_http.c +src/mg_http_cgi.c +src/mg_http_ssi.c +src/mg_http_webdav.c +src/mg_http_websocket.c +src/mg_util.c +src/mg_mqtt.c +src/mg_mqtt_server.c +src/mg_dns.c +src/mg_dns_server.c +src/mg_resolv.c +src/mg_coap.c +src/mg_sntp.c +src/mg_socks.c +src/common/platforms/cc3200/cc3200_libc.c +src/common/platforms/msp432/msp432_libc.c +src/common/platforms/nrf5/nrf5_libc.c +src/common/platforms/simplelink/sl_fs_slfs.h +src/common/platforms/simplelink/sl_fs_slfs.c +src/common/platforms/simplelink/sl_fs.c +src/common/platforms/simplelink/sl_socket.c +src/common/platforms/simplelink/sl_mg_task.c +src/common/platforms/simplelink/sl_net_if.h +src/common/platforms/simplelink/sl_net_if.c +src/common/platforms/simplelink/sl_ssl_if.c +src/common/platforms/lwip/mg_lwip_net_if.h +src/common/platforms/lwip/mg_lwip_net_if.c +src/common/platforms/lwip/mg_lwip_ev_mgr.c +src/common/platforms/wince/wince_libc.c +src/common/platforms/pic32/pic32_net_if.h +src/common/platforms/pic32/pic32_net_if.c +src/common/platforms/windows/windows_direct.c diff --git a/src/mongoose.h.manifest b/src/mongoose.h.manifest new file mode 100644 index 0000000000000000000000000000000000000000..b942d14c23b9bd2b0ccd65a25f9f95d80c7e5cd8 --- /dev/null +++ b/src/mongoose.h.manifest @@ -0,0 +1,47 @@ +src/mg_common.h +src/common/platform.h +src/common/platforms/platform_windows.h +src/common/platforms/platform_unix.h +src/common/platforms/platform_esp32.h +src/common/platforms/platform_esp8266.h +src/common/platforms/platform_cc3100.h +src/common/platforms/platform_cc3200.h +src/common/platforms/platform_cc3220.h +src/common/platforms/platform_msp432.h +src/common/platforms/platform_tm4c129.h +src/common/platforms/platform_mbed.h +src/common/platforms/platform_nrf51.h +src/common/platforms/platform_nrf52.h +src/common/platforms/simplelink/cs_simplelink.h +src/common/platforms/platform_wince.h +src/common/platforms/platform_nxp_lpc.h +src/common/platforms/platform_nxp_kinetis.h +src/common/platforms/platform_pic32.h +src/common/platforms/platform_rs14100.h +src/common/platforms/platform_stm32.h +src/common/platforms/lwip/mg_lwip.h +src/common/cs_md5.h +src/common/cs_sha1.h +src/common/cs_time.h +src/common/mg_str.h +src/common/mbuf.h +src/common/cs_base64.h +src/common/str_util.h +src/common/queue.h +src/mg_features.h +src/mg_net_if.h +src/mg_ssl_if.h +src/mg_net.h +src/mg_uri.h +src/mg_util.h +src/mg_http.h +src/mg_http_server.h +src/mg_http_client.h +src/mg_mqtt.h +src/mg_mqtt_server.h +src/mg_dns.h +src/mg_dns_server.h +src/mg_resolv.h +src/mg_coap.h +src/mg_sntp.h +src/mg_socks.h diff --git a/test/Makefile b/test/Makefile index 7bf70a1075be90da627e070b86f486cbb7353f1e..9bbdb900bb6600511f2507b16e464d129b9f09d9 100644 --- a/test/Makefile +++ b/test/Makefile @@ -4,24 +4,11 @@ PROG = unit_test MONGOOSE_DIR = .. -SRC_DIR = ../src - -COMMON_DIR_PUB = ../src/common -COMMON_DIR_DEV = ../../common - -# Our dev repo and public mongoose repo have different layouts, so here -# we make it work on both -ifneq ("$(wildcard ../../common.mk)","") -COMMON_PARENT = ../.. -else -COMMON_PARENT = $(SRC_DIR) -endif - TEST_SOURCES = unit_test.c test_util.c test_main.c fuzz.c AMALGAMATED_SOURCES = ../mongoose.c KRYPTON_PATH = $(REPO_ROOT)/krypton -VPATH = $(MONGOOSE_DIR) $(SRC_DIR) $(COMMON_DIR_PUB) $(COMMON_DIR_DEV) $(COMMON_PARENT) +VPATH = $(MONGOOSE_DIR) # or Krypton, or mbedTLS SSL ?= OpenSSL @@ -49,7 +36,7 @@ UNIX_FEATURE_FLAGS=-DMG_ENABLE_IPV6 -DMG_ENABLE_SSL # `mg_http_parse_header()` is removed from mongoose. CFLAGS = -W -Wall -Wundef -Werror -Wno-deprecated-declarations -g -O0 -Wno-multichar -D__USE_MISC \ $(COMMON_FEATURE_FLAGS) $(UNIX_FEATURE_FLAGS) \ - $(patsubst %,-I%,$(subst :, ,$(VPATH))) \ + -I$(MONGOOSE_DIR) -I../src \ -include unit_test.h -pthread $(CFLAGS_EXTRA) LDFLAGS = -lm @@ -67,7 +54,6 @@ LDFLAGS += -lmbedcrypto -lmbedtls -lmbedx509 endif include test.mk -include $(SRC_DIR)/mg_modules.mk # http://crossgcc.rts-software.org/doku.php?id=compiling_for_win32 MINGW_GCC=/usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/bin/i586-mingw32-gcc diff --git a/src/common/test_main.c b/test/test_main.c similarity index 97% rename from src/common/test_main.c rename to test/test_main.c index 5057cbc92d5b119686f1bb5770fc97fee05eaede..91dd2854062b6011f82aa343f04bd703a5b38bfd 100644 --- a/src/common/test_main.c +++ b/test/test_main.c @@ -16,8 +16,8 @@ */ #include "common/cs_dbg.h" -#include "common/test_main.h" -#include "common/test_util.h" +#include "test_main.h" +#include "test_util.h" #if defined(_MSC_VER) && _MSC_VER >= 1900 #include <crtdbg.h> diff --git a/src/common/test_main.h b/test/test_main.h similarity index 100% rename from src/common/test_main.h rename to test/test_main.h diff --git a/src/common/test_util.c b/test/test_util.c similarity index 98% rename from src/common/test_util.c rename to test/test_util.c index f2782f83c3e6bca7c14e48465cf67255a8440d3c..2b193d9c154080de51fb12048c6032b458e5c126 100644 --- a/src/common/test_util.c +++ b/test/test_util.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#include "common/test_util.h" +#include "test_util.h" #include <ctype.h> #include <stdio.h> diff --git a/src/common/test_util.h b/test/test_util.h similarity index 100% rename from src/common/test_util.h rename to test/test_util.h diff --git a/test/unit_test.c b/test/unit_test.c index f5e055235f2234b5d99b811fdeee005145e04ebf..bc84c0849a2289501a42dd009ab68a8cde9e12f0 100644 --- a/test/unit_test.c +++ b/test/unit_test.c @@ -17,11 +17,12 @@ #include "unit_test.h" -#include "common/cs_md5.h" -#include "common/test_main.h" -#include "common/test_util.h" #include "mongoose.h" -#include "src/mg_internal.h" + +#include "common/cs_md5.h" +#include "../src/mg_internal.h" +#include "test_main.h" +#include "test_util.h" #if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L && !defined(WIN32) #define __func__ "" diff --git a/tools/README.md b/tools/README.md index b4e14a12e77b25272b276c2895323b993627c525..6e1b14e43c6c9b7f0966fb023716255eed8e4175 100644 --- a/tools/README.md +++ b/tools/README.md @@ -8,8 +8,8 @@ This directory contains utilities to split and re-constitute amalgamated files. Here's how `mongoose.c` can be split into its consituent parts: ``` $ tools/unamalgam.py mongoose.c -=> mongoose/src/internal.h -=> common/cs_dbg.h +=> src/mg_internal.h +=> src/common/mg_mem.h ... ``` @@ -20,3 +20,5 @@ $ tools/amalgam.py --prefix=MG --public-header=mongoose.h $(cat mongoose.c.manif ``` The same applies to `mongoose.h`, except `--public-header` should be omitted during amalgamation. + +`tools/amalgam.sh` can be used to assemble `mongoose.c` and `mongoose.h`. diff --git a/tools/amalgam.py b/tools/amalgam.py index 0c931d8eabcdb842d937ce7d7de97b6a388f6670..8fbe35e6951765a8b2650baff05d4bed5f87e501 100755 --- a/tools/amalgam.py +++ b/tools/amalgam.py @@ -172,8 +172,11 @@ if sys.platform == "win32": if args.license: - with open(args.license) as f: - print(f.read()) + print('/*') + for l in open(args.license): + print((' * %s' % l.rstrip()).rstrip()) + print(' */') + print('') if args.public: print('#include "%s"' % args.public) diff --git a/tools/amalgam.sh b/tools/amalgam.sh new file mode 100755 index 0000000000000000000000000000000000000000..7159dccf7e66477e603f32d79d99c71130ce5014 --- /dev/null +++ b/tools/amalgam.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -x -e + +tools/amalgam.py --prefix=MG --license=LICENSE $(cat src/mongoose.h.manifest) > mongoose.h +tools/amalgam.py --prefix=MG --public-header=mongoose.h --license=LICENSE $(cat src/mongoose.c.manifest) > mongoose.c diff --git a/tools/unamalgam.py b/tools/unamalgam.py index 2fd6a41eb8020b200d7e38f113c635f7e452df06..347c6acfa67a5dec99b368614b6b3c5296c8e382 100755 --- a/tools/unamalgam.py +++ b/tools/unamalgam.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import re import os @@ -33,11 +33,11 @@ with open(fname) as f: # open next file for writing ofile = open(cur_src, "w") - print >>sys.stderr, '=> %s' % cur_src + print('=> %s' % cur_src, file=sys.stderr) manifest.append(cur_src) next(f) elif ofile: ofile.write(clean(l)) -m = open('%s.manifest' % os.path.basename(fname), 'w') -print >>m, '\n'.join(manifest) +with open('src/%s.manifest' % os.path.basename(fname), 'w') as m: + print('\n'.join(manifest), file=m)