- KSYS_SLOT_STATE_FREE has right value (9, not 6) now
- few style changes (snake_case)

git-svn-id: svn://kolibrios.org@9830 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
vitalkrilov 2022-06-05 08:46:07 +00:00
parent c48822e03e
commit b66e372685
2 changed files with 24 additions and 24 deletions

View File

@ -483,7 +483,7 @@ enum KSYS_SLOT_STATES {
KSYS_SLOT_STATE_NORMAL_TERM = 3, KSYS_SLOT_STATE_NORMAL_TERM = 3,
KSYS_SLOT_STATE_EXCEPT_TERM = 4, KSYS_SLOT_STATE_EXCEPT_TERM = 4,
KSYS_SLOT_STATE_WAIT_EVENT = 5, KSYS_SLOT_STATE_WAIT_EVENT = 5,
KSYS_SLOT_STATE_FREE = 6 KSYS_SLOT_STATE_FREE = 9
}; };
KOSAPI int _ksys_thread_info(ksys_thread_t* table, int slot) KOSAPI int _ksys_thread_info(ksys_thread_t* table, int slot)
@ -1580,48 +1580,48 @@ KOSAPI void _ksys_set_window_title(const char* title)
/*============= Function 77, subfunction 0 - create futex object =============*/ /*============= Function 77, subfunction 0 - create futex object =============*/
KOSAPI void* _ksys_futex_create(void* futexControlAddr) { KOSAPI void* _ksys_futex_create(void* futex_control_addr) {
void* futexDesc; void* futex_desc;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(futexDesc) : "=a"(futex_desc)
: "a"(77), "b"(0), "c"(futexControlAddr) : "a"(77), "b"(0), "c"(futex_control_addr)
: "memory"); : "memory");
return futexDesc; return futex_desc;
} }
/*============= Function 77, subfunction 1 - destroy futex object =============*/ /*============= Function 77, subfunction 1 - destroy futex object =============*/
KOSAPI int _ksys_futex_destroy(void* futexDesc) { KOSAPI int _ksys_futex_destroy(void* futex_desc) {
int res; int res;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(res) : "=a"(res)
: "a"(77), "b"(1), "c"(futexDesc) : "a"(77), "b"(1), "c"(futex_desc)
: "memory"); : "memory");
return res; return res;
} }
/*============= Function 77, subfunction 2 - futex wait =============*/ /*============= Function 77, subfunction 2 - futex wait =============*/
KOSAPI int _ksys_futex_wait(void* futexDesc, int controlVal, int timeout) { KOSAPI int _ksys_futex_wait(void* futex_desc, int control_val, int timeout) {
int res; int res;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(res) : "=a"(res)
: "a"(77), "b"(2), "c"(futexDesc), "d"(controlVal), "S"(timeout) : "a"(77), "b"(2), "c"(futex_desc), "d"(control_val), "S"(timeout)
: "memory"); : "memory");
return res; return res;
} }
/*============= Function 77, subfunction 3 - futex wake =============*/ /*============= Function 77, subfunction 3 - futex wake =============*/
KOSAPI int _ksys_futex_wake(void* futexDesc, int maxWakeCount) { KOSAPI int _ksys_futex_wake(void* futex_desc, int max_wake_count) {
int count; int count;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(count) : "=a"(count)
: "a"(77), "b"(3), "c"(futexDesc), "d"(maxWakeCount) : "a"(77), "b"(3), "c"(futex_desc), "d"(max_wake_count)
: "memory"); : "memory");
return count; return count;
} }

View File

@ -483,7 +483,7 @@ enum KSYS_SLOT_STATES {
KSYS_SLOT_STATE_NORMAL_TERM = 3, KSYS_SLOT_STATE_NORMAL_TERM = 3,
KSYS_SLOT_STATE_EXCEPT_TERM = 4, KSYS_SLOT_STATE_EXCEPT_TERM = 4,
KSYS_SLOT_STATE_WAIT_EVENT = 5, KSYS_SLOT_STATE_WAIT_EVENT = 5,
KSYS_SLOT_STATE_FREE = 6 KSYS_SLOT_STATE_FREE = 9
}; };
KOSAPI int _ksys_thread_info(ksys_thread_t* table, int slot) KOSAPI int _ksys_thread_info(ksys_thread_t* table, int slot)
@ -1580,48 +1580,48 @@ KOSAPI void _ksys_set_window_title(const char* title)
/*============= Function 77, subfunction 0 - create futex object =============*/ /*============= Function 77, subfunction 0 - create futex object =============*/
KOSAPI void* _ksys_futex_create(void* futexControlAddr) { KOSAPI void* _ksys_futex_create(void* futex_control_addr) {
void* futexDesc; void* futex_desc;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(futexDesc) : "=a"(futex_desc)
: "a"(77), "b"(0), "c"(futexControlAddr) : "a"(77), "b"(0), "c"(futex_control_addr)
: "memory"); : "memory");
return futexDesc; return futex_desc;
} }
/*============= Function 77, subfunction 1 - destroy futex object =============*/ /*============= Function 77, subfunction 1 - destroy futex object =============*/
KOSAPI int _ksys_futex_destroy(void* futexDesc) { KOSAPI int _ksys_futex_destroy(void* futex_desc) {
int res; int res;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(res) : "=a"(res)
: "a"(77), "b"(1), "c"(futexDesc) : "a"(77), "b"(1), "c"(futex_desc)
: "memory"); : "memory");
return res; return res;
} }
/*============= Function 77, subfunction 2 - futex wait =============*/ /*============= Function 77, subfunction 2 - futex wait =============*/
KOSAPI int _ksys_futex_wait(void* futexDesc, int controlVal, int timeout) { KOSAPI int _ksys_futex_wait(void* futex_desc, int control_val, int timeout) {
int res; int res;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(res) : "=a"(res)
: "a"(77), "b"(2), "c"(futexDesc), "d"(controlVal), "S"(timeout) : "a"(77), "b"(2), "c"(futex_desc), "d"(control_val), "S"(timeout)
: "memory"); : "memory");
return res; return res;
} }
/*============= Function 77, subfunction 3 - futex wake =============*/ /*============= Function 77, subfunction 3 - futex wake =============*/
KOSAPI int _ksys_futex_wake(void* futexDesc, int maxWakeCount) { KOSAPI int _ksys_futex_wake(void* futex_desc, int max_wake_count) {
int count; int count;
asm_inline( asm_inline(
"int $0x40" "int $0x40"
: "=a"(count) : "=a"(count)
: "a"(77), "b"(3), "c"(futexDesc), "d"(maxWakeCount) : "a"(77), "b"(3), "c"(futex_desc), "d"(max_wake_count)
: "memory"); : "memory");
return count; return count;
} }