summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/jumpscroll.h
diff options
context:
space:
mode:
authorSimon Rettberg2026-01-28 12:53:53 +0100
committerSimon Rettberg2026-01-28 12:53:53 +0100
commit8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch)
treea8b359e59196be5b2e3862bed189107f4bc9975f /src/include/ipxe/jumpscroll.h
parentMerge branch 'master' into openslx (diff)
parent[prefix] Make unlzma.S compatible with 386 class CPUs (diff)
downloadipxe-openslx.tar.gz
ipxe-openslx.tar.xz
ipxe-openslx.zip
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/include/ipxe/jumpscroll.h')
-rw-r--r--src/include/ipxe/jumpscroll.h37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/include/ipxe/jumpscroll.h b/src/include/ipxe/jumpscroll.h
index 7a5b111c1..0eec1b47b 100644
--- a/src/include/ipxe/jumpscroll.h
+++ b/src/include/ipxe/jumpscroll.h
@@ -8,6 +8,9 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
+
+#include <stdint.h>
/** A jump scroller */
struct jump_scroller {
@@ -22,6 +25,35 @@ struct jump_scroller {
};
/**
+ * Construct scroll movement
+ *
+ * @v delta Change in scroller position
+ * @ret move Scroll movement
+ */
+#define SCROLL( delta ) ( ( unsigned int ) ( uint16_t ) ( int16_t ) (delta) )
+
+/**
+ * Extract change in scroller position
+ *
+ * @v move Scroll movement
+ * @ret delta Change in scroller position
+ */
+#define SCROLL_DELTA( scroll ) ( ( int16_t ) ( (scroll) & 0x0000ffffUL ) )
+
+/** Scroll movement flags */
+#define SCROLL_FLAGS 0xffff0000UL
+#define SCROLL_WRAP 0x80000000UL /**< Wrap around scrolling */
+
+/** Do not scroll */
+#define SCROLL_NONE SCROLL ( 0 )
+
+/** Scroll up by one line */
+#define SCROLL_UP SCROLL ( -1 )
+
+/** Scroll down by one line */
+#define SCROLL_DOWN SCROLL ( +1 )
+
+/**
* Check if jump scroller is currently on first page
*
* @v scroll Jump scroller
@@ -43,8 +75,9 @@ static inline int jump_scroll_is_last ( struct jump_scroller *scroll ) {
return ( ( scroll->first + scroll->rows ) >= scroll->count );
}
-extern int jump_scroll_key ( struct jump_scroller *scroll, int key );
-extern int jump_scroll_move ( struct jump_scroller *scroll, int move );
+extern unsigned int jump_scroll_key ( struct jump_scroller *scroll, int key );
+extern unsigned int jump_scroll_move ( struct jump_scroller *scroll,
+ unsigned int move );
extern int jump_scroll ( struct jump_scroller *scroll );
#endif /* _IPXE_JUMPSCROLL_H */