mirror of
https://gitlab.com/qemu-project/ipxe.git
synced 2025-10-30 07:56:50 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97ee630e27 | |||
| e72670ad7b |
@ -12,6 +12,7 @@
|
||||
#include <ipxe/uaccess.h>
|
||||
#include <ipxe/process.h>
|
||||
#include <ipxe/netdevice.h>
|
||||
#include <ipxe/malloc.h>
|
||||
#include <realmode.h>
|
||||
#include <pxe.h>
|
||||
|
||||
@ -482,3 +483,28 @@ struct pxe_api_call pxe_udp_api[] __pxe_api_call = {
|
||||
PXE_API_CALL ( PXENV_UDP_READ, pxenv_udp_read,
|
||||
struct s_PXENV_UDP_READ ),
|
||||
};
|
||||
|
||||
/**
|
||||
* Discard some cached PXE UDP data
|
||||
*
|
||||
* @ret discarded Number of cached items discarded
|
||||
*/
|
||||
static unsigned int pxe_udp_discard ( void ) {
|
||||
struct io_buffer *iobuf;
|
||||
unsigned int discarded = 0;
|
||||
|
||||
/* Try to discard the oldest received UDP packet */
|
||||
iobuf = list_first_entry ( &pxe_udp.list, struct io_buffer, list );
|
||||
if ( iobuf ) {
|
||||
list_del ( &iobuf->list );
|
||||
free_iob ( iobuf );
|
||||
discarded++;
|
||||
}
|
||||
|
||||
return discarded;
|
||||
}
|
||||
|
||||
/** PXE UDP cache discarder */
|
||||
struct cache_discarder pxe_udp_discarder __cache_discarder ( CACHE_NORMAL ) = {
|
||||
.discard = pxe_udp_discard,
|
||||
};
|
||||
|
||||
@ -204,7 +204,7 @@ static void pxe_menu_draw_item ( struct pxe_menu *menu,
|
||||
buf[ sizeof ( buf ) - 1 ] = '\0';
|
||||
|
||||
/* Draw row */
|
||||
row = ( LINES - menu->num_items + index );
|
||||
row = ( LINES - menu->num_items + index - 1 );
|
||||
color_set ( ( selected ? CPAIR_PXE : CPAIR_DEFAULT ), NULL );
|
||||
mvprintw ( row, 0, "%s", buf );
|
||||
move ( row, 1 );
|
||||
|
||||
Reference in New Issue
Block a user