> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 21:03:05 up 2 days, 11:16,  1 user,  load average: 0.29, 0.28, 0.29
This commit is contained in:
tracer-ics2023
2024-09-14 21:03:06 +08:00
committed by zzy
parent 93cc7da851
commit 12de12ccff

View File

@ -57,11 +57,18 @@ void *memset(void *s, int c, size_t n) {
}
void *memmove(void *dst, const void *src, size_t n) {
// unsigned char* _dst = (unsigned char*)dst;
// const unsigned char* _src = (const unsigned char*)src;
// const unsigned char* _dst_end = _dst + n;
// const unsigned char* _src_end = _src + n;
panic("Not implemented");
unsigned char* _dst = (unsigned char*)dst;
unsigned char* _src = (unsigned char*)src;
if (_dst < _src) {
for (; _dst < (unsigned char*)dst + n; _dst++, _src++) {
*_dst = *_src;
}
} else {
for (_dst += n; _dst > (unsigned char*)dst; _dst--, _src--) {
*(_dst - 1) = *(_src - 1);
}
}
return dst;
}
void *memcpy(void *out, const void *in, size_t n) {