Read about our upcoming Code of Conduct on this issue

Commit 9aac6c97 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

Merged new-dryos-task-hooks into 1300D

--HG--
branch : 1300D
diff --git a/block/blkdebug.c b/block/blkdebug.c
index dee3a0e..b00d0f0 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -756,7 +756,7 @@ static void blkdebug_refresh_filename(BlockDriverState *bs)
if (!force_json && bs->file->bs->exact_filename[0]) {
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
- "blkdebug:%s:%s",
+ "blkdebug:%s:%.4085s",
qdict_get_try_str(bs->options, "config") ?: "",
bs->file->bs->exact_filename);
}
diff --git a/block/blkverify.c b/block/blkverify.c
index c5f8e8d..b242680 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -333,7 +333,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs)
&& s->test_file->bs->exact_filename[0])
{
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
- "blkverify:%s:%s",
+ "blkverify:%.2000s:%.2000s",
bs->file->bs->exact_filename,
s->test_file->bs->exact_filename);
}
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index ee6b43a..c8a5f83 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -396,7 +396,7 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],
void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)
{
if (upstream) {
- snprintf(downstream->path, sizeof(downstream->path), "%s.%d",
+ snprintf(downstream->path, sizeof(downstream->path), "%.12s.%d",
upstream->path, portnr);
downstream->hubcount = upstream->hubcount + 1;
} else {
diff --git a/net/slirp.c b/net/slirp.c
index f505570..1e36231 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -463,7 +463,7 @@ int net_slirp_redir(const char *redir_str)
/* automatic user mode samba server configuration */
static void slirp_smb_cleanup(SlirpState *s)
{
- char cmd[128];
+ char cmd[256];
int ret;
if (s->smb_dir[0] != '\0') {
@@ -482,8 +482,8 @@ static void slirp_smb_cleanup(SlirpState *s)
static int slirp_smb(SlirpState* s, const char *exported_dir,
struct in_addr vserver_addr)
{
- char smb_conf[128];
- char smb_cmdline[128];
+ char smb_conf[128+10];
+ char smb_cmdline[128+128];
struct passwd *passwd;
FILE *f;
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index c2ff970..ae64df0 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -13,6 +13,7 @@
#include <glib.h>
#include <sys/types.h>
+#include <sys/sysmacros.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <unistd.h>
......@@ -106,11 +106,17 @@ copy_and_restart( int offset )
char* get_current_task_name()
{
#if 0
/* DryOS: right after current_task we have a flag
* set to 1 when handling an interrupt */
/* this doesn't work on DIGIC 7 */
uint32_t interrupt_active = MEM((uintptr_t)&current_task + 4);
if (!interrupt_active)
#endif
/* DryOS: right before interrupt_active we have a counter showing the interrupt nesting level */
uint32_t interrupt_level = MEM((uintptr_t)&current_interrupt - 4);
if (!interrupt_level)
{
return current_task->name;
}
......
......@@ -281,7 +281,7 @@ NSTUB(0xFFCDAD80 - RAM_OFFSET, give_semaphore)
NSTUB(0xFFCDAC94 - RAM_OFFSET, take_semaphore)
/** Task info **/
NSTUB( 0x75F58, task_max)
NSTUB( 0x75F5C, task_max)
NSTUB(0xFFD1D5F4 - RAM_OFFSET, is_taskid_valid) // AJ_task_trampoline_related_p10
NSTUB( 0x74C28, current_task)
NSTUB( 0x64C, current_interrupt) // in interrupt handler (0x18), where MEM(C0201004) is stored
......
......@@ -22,11 +22,10 @@ int ml_shutdown_requested = 0;
char* get_current_task_name()
{
/* DryOS: right after current_task we have a flag
* set to 1 when handling an interrupt */
uint32_t interrupt_active = MEM((uintptr_t)&current_task + 4);
if (!interrupt_active)
/* DryOS: right before interrupt_active we have a counter showing the interrupt nesting level */
uint32_t interrupt_level = MEM((uintptr_t)&current_interrupt - 4);
if (!interrupt_level)
{
return current_task->name;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment