Skip to content

Commit

Permalink
Add missing wrlong optimization in a 9P-related file
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuerfel21 committed Jul 2, 2024
1 parent ada40c8 commit 685cda8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/filesys/fs9p/fs9p_vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ static int plain_sendrecv(uint8_t *startbuf, uint8_t *endbuf, int maxlen)

flags = _getrxtxflags();
_setrxtxflags(0); // raw mode
#ifdef __P2__
*(int*)startbuf = len;
#else
startbuf[0] = len & 0xff;
startbuf[1] = (len>>8) & 0xff;
startbuf[2] = (len>>16) & 0xff;
startbuf[3] = (len>>24) & 0xff;
#endif

if (len <= 4) {
return -1; // not a valid message
Expand All @@ -68,10 +72,14 @@ static int plain_sendrecv(uint8_t *startbuf, uint8_t *endbuf, int maxlen)
--len;
}
len = zdoGet4();
#ifdef __P2__
*(int*)startbuf = len;
#else
startbuf[0] = len & 0xff;
startbuf[1] = (len>>8) & 0xff;
startbuf[2] = (len>>16) & 0xff;
startbuf[3] = (len>>24) & 0xff;
#endif
buf = startbuf+4;
left = len - 4;
while (left > 0 && i < maxlen) {
Expand Down

0 comments on commit 685cda8

Please sign in to comment.