Wrap kos_osloop, add a test for resizing cursors

This commit is contained in:
Ivan Baravy 2022-06-28 20:13:41 +04:00
parent 395f75d1f7
commit 715c181582
6 changed files with 75 additions and 4 deletions

16
shell.c
View File

@ -3460,6 +3460,21 @@ cmd_net_arp_del_entry(struct shell_ctx *ctx, int argc, char **argv) {
#endif // _WIN32
static void
cmd_osloop(struct shell_ctx *ctx, int argc, char **argv) {
(void)ctx;
(void)argv;
const char *usage = \
"usage: osloop";
if (argc != 1) {
puts(usage);
return;
}
COVERAGE_ON();
umka_osloop();
COVERAGE_OFF();
}
static void
cmd_bg_set_size(struct shell_ctx *ctx, int argc, char **argv) {
(void)ctx;
@ -3681,6 +3696,7 @@ func_table_t cmd_cmds[] = {
{ "net_listen", cmd_net_listen },
{ "net_open_socket", cmd_net_open_socket },
#endif // _WIN32
{ "osloop", cmd_osloop },
{ "pci_get_path", cmd_pci_get_path },
{ "pci_set_path", cmd_pci_set_path },
{ "process_info", cmd_process_info },

View File

@ -0,0 +1,20 @@
/> umka_init
/>
/> ramdisk_init ../img/kolibri.img
/rd/1: fat
/> set_skin /sys/DEFAULT.SKN
status: 0
/>
/> window_redraw 1
/> draw_window 10 300 5 200 0x000088 1 1 1 0 1 3 hello
/> window_redraw 2
/>
/> set_mouse_pos_screen 307 202
/> osloop
/>
/> mouse_move -x +1 -y +1
/> osloop
/>
/> scrot 054_#draw_#cursor_#osloop_resize.out.png
/>
/> disk_del rd

View File

@ -0,0 +1,18 @@
umka_init
ramdisk_init ../img/kolibri.img
set_skin /sys/DEFAULT.SKN
window_redraw 1
draw_window 10 300 5 200 0x000088 1 1 1 0 1 3 hello
window_redraw 2
set_mouse_pos_screen 307 202
osloop
mouse_move -x +1 -y +1
osloop
scrot 054_#draw_#cursor_#osloop_resize.out.png
disk_del rd

View File

@ -983,7 +983,17 @@ macro format [x] {}
bios32_entry equ bios32_entry_pew
tmp_page_tabs equ tmp_page_tabs_pew
macro jmp target {
if target eq osloop
cmp [umka_tool], UMKA_SHELL
jnz osloop
ret
else
jmp target
end if
}
include 'kernel.asm'
purge jmp
restore bios32_entry, tmp_page_tabs
purge org,sys_msg_board,delay_ms
restore org,sys_msg_board,delay_ms

13
umka.h
View File

@ -499,8 +499,16 @@ typedef struct {
size_t el_cnt;
} kos_node_package_t;
__attribute__((__noreturn__)) void
kos_osloop(void);
static inline void
umka_osloop() {
__asm__ __inline__ __volatile__ (
"pushad;"
"call kos_osloop;"
"popad"
:
:
: "memory", "cc");
}
void
irq0(int signo, siginfo_t *info, void *context);
@ -996,7 +1004,6 @@ umka_scheduler_add_thread(appdata_t *thread, int32_t priority) {
: "c"(priority),
"d"(thread)
: "memory", "cc");
}
#define MAX_PRIORITY 0

View File

@ -217,7 +217,7 @@ main() {
setitimer(ITIMER_PROF, &timeout, NULL);
kos_osloop(); // doesn't return
umka_osloop(); // doesn't return
if (coverage)
trace_end();