mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 01:37:44 +00:00
hv: shell: improve console to modify input easier
1. make memcpy_erms as a public API; add a new one memcpy_erms_backwards, which supports to copy data from tail to head. 2. improve to use right/left/home/end key to move cursor, and support delete/backspace key to modify current input command. Tracked-On: #7931 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
d5b2c82156
commit
83164d6030
@@ -24,7 +24,7 @@ void *memset(void *base, uint8_t v, size_t n)
|
||||
return base;
|
||||
}
|
||||
|
||||
static inline void memcpy_erms(void *d, const void *s, size_t slen)
|
||||
void memcpy_erms(void *d, const void *s, size_t slen)
|
||||
{
|
||||
asm volatile ("rep; movsb"
|
||||
: "=&D"(d), "=&S"(s)
|
||||
@@ -32,6 +32,15 @@ static inline void memcpy_erms(void *d, const void *s, size_t slen)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/* copy data from tail to head (backwards) with ERMS (Enhanced REP MOVSB/STOSB) */
|
||||
void memcpy_erms_backwards(void *d, const void *s, size_t slen)
|
||||
{
|
||||
asm volatile ("std; rep; movsb; cld"
|
||||
: "=&D"(d), "=&S"(s)
|
||||
: "c"(slen), "0" (d), "1" (s)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Copies at most slen bytes from src address to dest address, up to dmax.
|
||||
*
|
||||
|
Reference in New Issue
Block a user