Subversion Repositories Kolibri OS

Rev

Rev 9338 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9338 Rev 9342
Line 1... Line 1...
1
; TODO: SPDX
1
; TODO: SPDX
Line -... Line 2...
-
 
2
 
2
 
3
if ~ defined win32
-
 
4
    format ELF
-
 
5
else
-
 
6
    format MS COFF
-
 
7
 
-
 
8
    macro c_public name, _alias, _argsize {
-
 
9
        if ~ _argsize eq nomangle
-
 
10
            if _alias eqtype 'string'
-
 
11
                if _argsize eqtype 1
-
 
12
                    public name as '_' # _alias # '@' # `_argsize
-
 
13
                else
-
 
14
                    public name as '_' # _alias
-
 
15
                end if
-
 
16
            else if _alias eqtype 1
-
 
17
                public name as '_' # `name # '@' # `_alias
-
 
18
            else
-
 
19
                public name as '_' # `name
-
 
20
            end if
-
 
21
        else
-
 
22
            public name as _alias
-
 
23
        end if
-
 
24
    }
-
 
25
 
-
 
26
    macro extrn name, _argsize {
-
 
27
        if _argsize eqtype 1
-
 
28
            extrn '_' # `name # '@' # `_argsize as name
-
 
29
        else
-
 
30
            extrn '_' # `name as name
-
 
31
        end if
-
 
32
    }
Line 3... Line 33...
3
format ELF
33
end if
4
 
34
 
Line 5... Line 35...
5
__DEBUG__ = 1
35
__DEBUG__ = 1
6
__DEBUG_LEVEL__ = 1
36
__DEBUG_LEVEL__ = 1
7
 
37
 
Line 8... Line 38...
8
UMKA_SHELL = 1
38
UMKA_SHELL = 1
Line 9... Line 39...
9
UMKA_FUSE  = 2
39
UMKA_FUSE  = 2
10
UMKA_OS    = 3
40
UMKA_OS    = 3
11
 
41
 
12
UMKA_MEMORY_BYTES = 256 SHL 20
42
UMKA_MEMORY_BYTES = 256 SHL 20
13
 
43
 
14
public umka_sys_put_image_palette
44
c_public umka_sys_put_image_palette
15
public disk_add
45
c_public disk_add, 16
16
public disk_del
46
c_public disk_del, 4
17
public disk_list
47
c_public disk_list
18
public disk_media_changed
48
c_public disk_media_changed,8
19
 
49
 
20
public xfs._.user_functions as 'xfs_user_functions'
50
c_public xfs._.user_functions, 'xfs_user_functions'
21
public ext_user_functions
51
c_public ext_user_functions
22
public fat_user_functions
52
c_public fat_user_functions
23
public ntfs_user_functions
53
c_public ntfs_user_functions
24
 
54
 
25
public i40
55
c_public i40, 'i40', nomangle
26
 
56
 
27
public coverage_begin
57
c_public coverage_begin
28
public coverage_end
58
c_public coverage_end
29
 
59
 
30
public sha3_256_oneshot as 'hash_oneshot'
60
c_public sha3_256_oneshot, 'hash_oneshot'
31
public kos_time_to_epoch
61
c_public kos_time_to_epoch
32
public umka_init
62
c_public umka_init
33
 
63
 
34
public current_process as 'kos_current_process'
64
c_public current_process, 'kos_current_process'
35
public current_slot as 'kos_current_slot'
65
c_public current_slot, 'kos_current_slot'
36
public current_slot_idx as 'kos_current_slot_idx'
66
c_public current_slot_idx, 'kos_current_slot_idx'
37
 
67
 
38
public thread_count as 'kos_thread_count'
68
c_public thread_count, 'kos_thread_count'
39
public TASK_TABLE as 'kos_task_table'
69
c_public TASK_TABLE, 'kos_task_table'
40
public TASK_BASE as 'kos_task_base'
70
c_public TASK_BASE, 'kos_task_base'
41
public TASK_DATA as 'kos_task_data'
71
c_public TASK_DATA, 'kos_task_data'
42
public SLOT_BASE as 'kos_slot_base'
72
c_public SLOT_BASE, 'kos_slot_base'
43
public window_data as 'kos_window_data'
73
c_public window_data, 'kos_window_data'
44
 
74
 
45
public WIN_STACK as 'kos_win_stack'
75
c_public WIN_STACK, 'kos_win_stack'
46
public WIN_POS as 'kos_win_pos'
76
c_public WIN_POS, 'kos_win_pos'
47
public lfb_base as 'kos_lfb_base'
77
c_public lfb_base, 'kos_lfb_base'
48
 
78
 
49
public RAMDISK as 'kos_ramdisk'
79
c_public RAMDISK, 'kos_ramdisk'
50
public ramdisk_init as 'kos_ramdisk_init'
80
c_public ramdisk_init, 'kos_ramdisk_init'
51
 
81
 
52
public acpi_ssdt_cnt as 'kos_acpi_ssdt_cnt'
82
c_public acpi_ssdt_cnt, 'kos_acpi_ssdt_cnt'
53
public acpi_ssdt_base as 'kos_acpi_ssdt_base'
83
c_public acpi_ssdt_base, 'kos_acpi_ssdt_base'
54
public acpi_ssdt_size as 'kos_acpi_ssdt_size'
84
c_public acpi_ssdt_size, 'kos_acpi_ssdt_size'
55
 
85
 
56
public stack_init as 'kos_stack_init'
86
c_public stack_init, 'kos_stack_init'
57
public net_add_device
87
c_public net_add_device
58
 
88
 
59
public draw_data
89
c_public draw_data
60
public img_background
90
c_public img_background
61
public mem_BACKGROUND
91
c_public mem_BACKGROUND
62
public sys_background
92
c_public sys_background
63
public REDRAW_BACKGROUND as 'kos_redraw_background'
93
c_public REDRAW_BACKGROUND, 'kos_redraw_background'
64
public new_sys_threads as 'kos_new_sys_threads'
94
c_public new_sys_threads, 'kos_new_sys_threads', nomangle
65
public osloop as 'kos_osloop'
95
c_public osloop, 'kos_osloop'
66
public set_mouse_data as 'kos_set_mouse_data'
96
c_public set_mouse_data, 'kos_set_mouse_data', 20
67
public scheduler_current as 'kos_scheduler_current'
97
c_public scheduler_current, 'kos_scheduler_current'
68
public eth_input as 'kos_eth_input'
98
c_public eth_input, 'kos_eth_input'
69
public net_buff_alloc as 'kos_net_buff_alloc'
99
c_public net_buff_alloc, 'kos_net_buff_alloc'
70
 
100
 
Line 71... Line 101...
71
public mem_block_list
101
c_public mem_block_list
72
 
102
 
Line 73... Line 103...
73
public acpi_dev_data as "kos_acpi_dev_data"
103
c_public acpi_dev_data, "kos_acpi_dev_data"
Line 74... Line 104...
74
public acpi_dev_size as "kos_acpi_dev_size"
104
c_public acpi_dev_size, "kos_acpi_dev_size"
75
public kernel_alloc as "kos_kernel_alloc"
105
c_public kernel_alloc, "kos_kernel_alloc"
76
 
106
 
77
public window._.set_screen as 'kos_window_set_screen'
107
c_public window._.set_screen, 'kos_window_set_screen'
Line 110... Line 140...
110
include 'macros.inc'
140
include 'macros.inc'
Line 111... Line 141...
111
 
141
 
112
macro diff16 msg,blah2,blah3 {
142
macro diff16 msg,blah2,blah3 {
113
  if msg eq "end of .data segment"
143
  if msg eq "end of .data segment"
114
; fasm doesn't align on 65536, but ld script does
144
; fasm doesn't align on 65536, but ld script does
115
section '.bss.aligned65k' writeable align 65536
145
section '.bss.65k' writeable align 512
116
bss_base:
146
bss_base:
117
  end if
147
  end if
118
}
148
}
119
include 'proc32.inc'
149
include 'proc32.inc'
Line 503... Line 533...
503
        mov     [ebx+APPDATA.cur_dir], cur_dir
533
        mov     [ebx+APPDATA.cur_dir], cur_dir
Line 504... Line 534...
504
 
534
 
505
        ret
535
        ret
Line 506... Line 536...
506
endp
536
endp
507
 
537
 
508
public skin_udata
538
c_public skin_udata
509
proc idle uses ebx esi edi
539
proc idle uses ebx esi edi
510
.loop:
540
.loop:
511
        mov     ecx, 10000000
541
        mov     ecx, 10000000
Line 515... Line 545...
515
        jmp     .loop
545
        jmp     .loop
Line 516... Line 546...
516
 
546
 
517
        ret
547
        ret
Line 518... Line 548...
518
endp
548
endp
519
 
549
 
520
extrn pci_read
550
extrn pci_read, 20
521
proc pci_read_reg uses ebx esi edi
551
proc pci_read_reg uses ebx esi edi
522
        mov     ecx, eax
552
        mov     ecx, eax
523
        and     ecx, 3
553
        and     ecx, 3
Line 539... Line 569...
539
endp
569
endp
Line 540... Line 570...
540
 
570
 
541
proc sys_msg_board
571
proc sys_msg_board
542
        cmp     cl, 0x0d
572
        cmp     cl, 0x0d
-
 
573
        jz      @f
543
        jz      @f
574
if ~ defined win32
544
        pushad
575
        pushad
545
        mov     eax, SYS_WRITE
576
        mov     eax, SYS_WRITE
546
        mov     ebx, STDOUT
577
        mov     ebx, STDOUT
547
        push    ecx
578
        push    ecx
548
        mov     ecx, esp
579
        mov     ecx, esp
549
        mov     edx, 1
580
        mov     edx, 1
550
        int     0x80
581
        int     0x80
551
        pop     ecx
582
        pop     ecx
-
 
583
        popad
-
 
584
else
-
 
585
        extrn   putchar
-
 
586
 
-
 
587
        pushad
-
 
588
        push    ecx
-
 
589
        call    putchar
-
 
590
        add     esp, 4
-
 
591
        popad
552
        popad
592
end if
553
@@:
593
@@:
554
        ret
594
        ret
Line 555... Line 595...
555
endp
595
endp
Line 556... Line 596...
556
 
596
 
557
proc delay_ms
597
proc delay_ms
Line 558... Line 598...
558
 
598
 
559
        ret
599
        ret
560
endp
600
endp
561
 
601
 
562
public umka_cli
602
c_public umka_cli
Line 563... Line 603...
563
proc umka_cli
603
proc umka_cli
564
        cli     ; macro
604
        cli     ; macro
565
        ret
605
        ret
566
endp
606
endp
567
 
607
 
Line 591... Line 631...
591
        ret
631
        ret
592
endp
632
endp
Line 593... Line 633...
593
 
633
 
594
extrn reset_procmask
634
extrn reset_procmask
595
extrn get_fake_if
635
extrn get_fake_if
596
public irq0
636
c_public irq0
597
proc irq0 c, _signo, _info, _context
637
proc irq0 c, _signo, _info, _context
598
        DEBUGF 2, "### irq0\n"
638
        DEBUGF 2, "### irq0\n"
599
        pushfd
639
        pushfd
600
        cli
640
        cli
Line 733... Line 773...
733
restore sys_msg_board,delay_ms
773
restore sys_msg_board,delay_ms
Line 734... Line 774...
734
 
774
 
Line 735... Line 775...
735
coverage_end:
775
coverage_end:
736
 
776
 
737
; fasm doesn't align on 65536, but ld script does
777
; fasm doesn't align on 65536, but ld script does
738
section '.data.aligned65k' writeable align 65536
778
section '.data' readable writeable align 512
739
public umka_tool
779
c_public umka_tool
740
umka_tool dd ?
780
umka_tool dd ?
741
public umka_initialized
781
c_public umka_initialized
Line 742... Line 782...
742
umka_initialized dd 0
782
umka_initialized dd 0
743
fpu_owner dd ?
783
fpu_owner dd ?