Compare commits
7 Commits
bd3caddbf7
...
12df8d517d
| Author | SHA1 | Date | |
|---|---|---|---|
| 12df8d517d | |||
| 55f5a8e82a | |||
| 98343f1e12 | |||
| 46cb969019 | |||
| 3f9e0abc49 | |||
| 9af5aa2acf | |||
| 01ee992791 |
@@ -11,3 +11,4 @@ func seek[4](offset: offset, origin: int) -> (err: int, new_pos: offset);
|
||||
func map[5](prot: int, flags: int) -> (err: int, vmo: handle);
|
||||
|
||||
func getdents[6]() -> (err: int, dents: buffer);
|
||||
func mount[7](path: string, nd: int, pid: int, chid: int) -> (err: int);
|
||||
|
||||
+1
-1
Submodule kernel updated: c425d6e389...bd6872d672
@@ -28,14 +28,14 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <magenta/log.h>
|
||||
#include <stdio.h>
|
||||
|
||||
long long strtoll(
|
||||
const char *restrict ptr,
|
||||
char **restrict endptr,
|
||||
register int base)
|
||||
long long strtoll(const char *restrict ptr, char **restrict endptr, int base)
|
||||
{
|
||||
const char *s = ptr;
|
||||
long long acc;
|
||||
@@ -64,8 +64,31 @@ long long strtoll(
|
||||
base = c == '0' ? 8 : 10;
|
||||
}
|
||||
|
||||
cutoff = (long long)LLONG_MAX / (long long)base;
|
||||
cutlim = (long long)LLONG_MAX % (long long)base;
|
||||
/* XXX cannot just divide by base here. Doing so results in a #DE
|
||||
* exception when running under Bochs. Not sure if this is a bug in the
|
||||
* kernel or in Bochs, but this switch statement is here as a workaround
|
||||
* until the issue is resolved. */
|
||||
switch (base) {
|
||||
case 2:
|
||||
cutoff = (long long)LLONG_MAX / (long long)2;
|
||||
cutlim = (long long)LLONG_MAX % (long long)2;
|
||||
break;
|
||||
case 8:
|
||||
cutoff = (long long)LLONG_MAX / (long long)8;
|
||||
cutlim = (long long)LLONG_MAX % (long long)8;
|
||||
break;
|
||||
case 10:
|
||||
cutoff = (long long)LLONG_MAX / (long long)10;
|
||||
cutlim = (long long)LLONG_MAX % (long long)10;
|
||||
break;
|
||||
case 16:
|
||||
cutoff = (long long)LLONG_MAX / (long long)16;
|
||||
cutlim = (long long)LLONG_MAX % (long long)16;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (acc = 0, any = 0;; c = *s++) {
|
||||
if (isdigit(c)) {
|
||||
c -= '0';
|
||||
|
||||
@@ -12,6 +12,7 @@ enum rosetta_bootstrap_handle_type {
|
||||
enum rosetta_bootstrap_channel_type {
|
||||
RSBS_CHANNEL_NONE,
|
||||
RSBS_CHANNEL_SYSTEM,
|
||||
RSBS_CHANNEL_NAMESPACE,
|
||||
};
|
||||
|
||||
struct rosetta_bootstrap_handle {
|
||||
|
||||
@@ -6,6 +6,9 @@ file(GLOB sources
|
||||
|
||||
add_executable(mxdbg ${sources})
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
target_link_libraries(mxdbg
|
||||
magenta_debug
|
||||
Threads::Threads
|
||||
FX::Runtime FX::Collections FX::Term FX::Cmdline)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <magenta/debug/packet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -26,7 +27,14 @@ void debug_context_cleanup(struct debug_context *ctx)
|
||||
close(ctx->ctx_sock);
|
||||
}
|
||||
|
||||
pthread_cond_broadcast(&ctx->ctx_packet_cond);
|
||||
pthread_kill(ctx->ctx_packet_thread, SIGINT);
|
||||
pthread_kill(ctx->ctx_event_thread, SIGINT);
|
||||
|
||||
printf("joining threads...\n");
|
||||
pthread_join(ctx->ctx_packet_thread, NULL);
|
||||
pthread_join(ctx->ctx_event_thread, NULL);
|
||||
printf("threads joined\n");
|
||||
}
|
||||
|
||||
static void *packet_thread(void *arg)
|
||||
|
||||
@@ -6,7 +6,7 @@ struct packet *packet_create(size_t packet_size)
|
||||
{
|
||||
size_t real_packet_size = sizeof(struct packet) + packet_size
|
||||
- sizeof(struct mxdbg_packet);
|
||||
return calloc(1, packet_size);
|
||||
return calloc(1, real_packet_size);
|
||||
}
|
||||
|
||||
void packet_destroy(struct packet *packet)
|
||||
|
||||
Reference in New Issue
Block a user