Subversion Repositories Kolibri OS

Rev

Rev 9827 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5345 serge 1
#ifndef __SYSCALL_H__
2
#define __SYSCALL_H__
1029 serge 3
 
1630 serge 4
#include 
5
 
9833 turbocat 6
#define ASSERT_CONCAT_(a, b) a##b
7
#define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b)
8
#define STATIC_ASSERT(e) enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }
9
 
5270 serge 10
typedef u32 addr_t;
11
typedef u32 count_t;
12
 
9057 turbocat 13
#pragma pack(push, 1)
14
 
9833 turbocat 15
typedef struct {
16
    int width;
17
    int height;
18
    int bpp;
19
    int freq;
20
} videomode_t;
6082 serge 21
 
9833 turbocat 22
struct kos32_pdev {
6102 serge 23
    struct kos32_pdev *prev;
24
    struct kos32_pdev *next;
25
    u32 devid;
26
    u32 class;
27
    u8  devfn;
28
    u8  bus;
29
    u8  reserved[2];
30
    u32 owner;
9057 turbocat 31
};
6102 serge 32
 
9833 turbocat 33
// struct BOX in const.inc
34
struct kos_wnd_box {
35
    u32 left;
36
    u32 top;
37
    u32 width;
38
    u32 height;
39
};
40
 
41
// struct DBG_REGS in const.inc
42
struct kos_dbg_regs {
43
    u32 dr0;
44
    u32 dr1;
45
    u32 dr2;
46
    u32 dr3;
47
    u32 dr7;
48
};
49
 
50
struct kos_lhead {
51
  struct kos_lhead *prev;
52
  struct kos_lhead *next;
53
};
54
 
55
enum KOS_SLOT_STATES {
56
    KOS_SLOT_STATE_RUNNING = 0,
57
    KOS_SLOT_STATE_SUSPENDED = 1,
58
    KOS_SLOT_STATE_SUSPENDED_WAIT_EVENT = 2,
59
    KOS_SLOT_STATE_NORMAL_TERM = 3,
60
    KOS_SLOT_STATE_EXCEPT_TERM = 4,
61
    KOS_SLOT_STATE_WAIT_EVENT = 5,
62
    KOS_SLOT_STATE_FREE = 9
63
};
64
 
65
struct kos_appdata {
66
    char app_name[16];
67
    struct kos_lhead list;
68
    u32 process;
69
    u32 fpu_state;
70
    u32 exc_handler;
71
    u32 except_mask;
72
    u32 pl0_stack;
73
    u32 cursor;
74
    u32 fd_ev;
75
    u32 bk_ev;
76
    u32 fd_obj;
77
    u32 bk_obj;
78
    u32 saved_esp;
79
    u32 io_map[2];
80
    u32 dbg_state;
81
    char* cur_dir;
82
    u32 wait_timeout;
83
    u32 saved_esp0;
84
    u32 wait_begin;
85
    u32 wait_test;
86
    u32 wait_param;
87
    u32 tls_base;
88
    u32 event_mask;
89
    u32 tid;
90
    u32 draw_bgr_x;
91
    u32 draw_bgr_y;
92
    u8  state;
93
    u8  wnd_number;
94
    u16 __reserved1;
95
    u32 wnd_shape;
96
    u32 wnd_shape_scale;
97
    u32 __reserved2;
98
    u32 counter_sum;
99
    struct kos_wnd_box saved_box;
100
    u32 ipc_start;
101
    u32 ipc_size;
102
    u32 occurred_events;
103
    u32 debugger_slot;
104
    u32 terminate_protection;
105
    u8  keyboard_mode;
106
    u8  captionEncoding;
107
    u8  __reserved3[2];
108
    char* exec_params;
109
    u32 dbg_event_mem;
110
    struct kos_dbg_regs dbg_regs;
111
    char* wnd_caption;
112
    struct kos_wnd_box wnd_clientbox;
113
    u32 priority;
114
    struct kos_lhead in_schedule;
115
    u32 counter_add;
116
    u32 cpu_usage;
117
    u32 __reserved4;
118
};
119
 
120
#define KOS_APPDATA_SIZE 256
121
STATIC_ASSERT(sizeof(struct kos_appdata) == KOS_APPDATA_SIZE);
122
 
9057 turbocat 123
typedef struct {
124
    unsigned            p00;
125
    union{
126
        uint64_t        p04;
127
        struct {
128
            unsigned    p04dw;
129
            unsigned    p08dw;
130
        };
131
    };
132
    unsigned            p12;
133
    union {
134
        unsigned        p16;
135
        const char     *new_name;
136
        void           *bdfe;
137
        void           *buf16;
138
        const void     *cbuf16;
139
    };
140
    char                p20;
141
    const char         *p21;
9833 turbocat 142
} ksys70_t;
9057 turbocat 143
 
144
#pragma pack(pop)
145
 
1029 serge 146
///////////////////////////////////////////////////////////////////////////////
147
 
1434 serge 148
#define STDCALL  __attribute__ ((stdcall)) __attribute__ ((dllimport))
149
#define FASTCALL __attribute__ ((fastcall)) __attribute__ ((dllimport))
1029 serge 150
 
1434 serge 151
#define IMPORT   __attribute__ ((dllimport))
152
 
1029 serge 153
///////////////////////////////////////////////////////////////////////////////
154
 
155
#define SysMsgBoardStr  __SysMsgBoardStr
156
#define PciApi          __PciApi
157
#define CreateObject    __CreateObject
158
#define DestroyObject   __DestroyObject
159
 
1872 serge 160
#define _alloca(x) __builtin_alloca((x))
161
 
1029 serge 162
///////////////////////////////////////////////////////////////////////////////
163
 
164
 
165
void*  STDCALL AllocKernelSpace(size_t size)__asm__("AllocKernelSpace");
1408 serge 166
void   STDCALL FreeKernelSpace(void *mem)__asm__("FreeKernelSpace");
5270 serge 167
addr_t STDCALL MapIoMem(addr_t base, size_t size, u32 flags)__asm__("MapIoMem");
1029 serge 168
void*  STDCALL KernelAlloc(size_t size)__asm__("KernelAlloc");
6295 serge 169
void*  STDCALL KernelFree(const void *mem)__asm__("KernelFree");
1029 serge 170
void*  STDCALL UserAlloc(size_t size)__asm__("UserAlloc");
171
int    STDCALL UserFree(void *mem)__asm__("UserFree");
172
 
1613 serge 173
void*  STDCALL GetDisplay(void)__asm__("GetDisplay");
1408 serge 174
 
5270 serge 175
u32  IMPORT  GetTimerTicks(void)__asm__("GetTimerTicks");
6082 serge 176
u64  IMPORT  GetClockNs(void)__asm__("GetClockNs");
1408 serge 177
 
1613 serge 178
addr_t STDCALL AllocPage(void)__asm__("AllocPage");
1029 serge 179
addr_t STDCALL AllocPages(count_t count)__asm__("AllocPages");
2967 Serge 180
void   IMPORT  __attribute__((regparm(1)))
181
               FreePage(addr_t page)__asm__("FreePage");
5270 serge 182
void   STDCALL MapPage(void *vaddr, addr_t paddr, u32 flags)__asm__("MapPage");
1029 serge 183
 
2967 Serge 184
 
5270 serge 185
void* STDCALL CreateRingBuffer(size_t size, u32 map)__asm__("CreateRingBuffer");
1029 serge 186
 
5270 serge 187
u32 STDCALL RegService(char *name, srv_proc_t proc)__asm__("RegService");
1029 serge 188
 
5270 serge 189
int   STDCALL AttachIntHandler(int irq, void *handler, u32 access) __asm__("AttachIntHandler");
1029 serge 190
 
1434 serge 191
void  FASTCALL MutexInit(struct mutex*)__asm__("MutexInit");
192
void  FASTCALL MutexLock(struct mutex*)__asm__("MutexLock");
193
void  FASTCALL MutexUnlock(struct mutex*)__asm__("MutexUnlock");
1029 serge 194
 
5345 serge 195
void  FASTCALL InitRwsem(struct rw_semaphore *sem)__asm__("InitRwsem");
196
void  FASTCALL DownRead(struct rw_semaphore *sem)__asm__("DownRead");
197
void  FASTCALL DownWrite(struct rw_semaphore *sem)__asm__("DownWrite");
198
void  FASTCALL UpRead(struct rw_semaphore *sem)__asm__("UpRead");
199
void  FASTCALL UpWrite(struct rw_semaphore *sem)__asm__("UpWrite");
200
 
1872 serge 201
addr_t IMPORT  GetStackBase(void)__asm__("GetStackBase");
5270 serge 202
u32  IMPORT  GetPid(void)__asm__("GetPid");
1872 serge 203
 
4125 Serge 204
u32 STDCALL TimerHS(u32 delay, u32 interval,
205
                    void *fn, void *data)asm("TimerHS");
2967 Serge 206
 
4125 Serge 207
void STDCALL CancelTimerHS(u32 handle)asm("CancelTimerHS");
208
 
3482 Serge 209
u64 IMPORT GetCpuFreq()__asm__("GetCpuFreq");
210
 
1029 serge 211
///////////////////////////////////////////////////////////////////////////////
212
 
213
void   STDCALL SetMouseData(int btn, int x, int y,
214
                            int z, int h)__asm__("SetMouseData");
215
 
5270 serge 216
void   FASTCALL SetKeyboardData(u32 data)__asm__("SetKeyboardData");
1872 serge 217
 
6102 serge 218
struct kos32_pdev* IMPORT GetPCIList()__asm__("GetPCIList");
1872 serge 219
 
5270 serge 220
u8  STDCALL PciRead8 (u32 bus, u32 devfn, u32 reg)__asm__("PciRead8");
221
u16 STDCALL PciRead16(u32 bus, u32 devfn, u32 reg)__asm__("PciRead16");
222
u32 STDCALL PciRead32(u32 bus, u32 devfn, u32 reg)__asm__("PciRead32");
1029 serge 223
 
5270 serge 224
u32 STDCALL PciWrite8 (u32 bus, u32 devfn, u32 reg,u8 val) __asm__("PciWrite8");
225
u32 STDCALL PciWrite16(u32 bus, u32 devfn, u32 reg,u16 val)__asm__("PciWrite16");
226
u32 STDCALL PciWrite32(u32 bus, u32 devfn, u32 reg,u32 val)__asm__("PciWrite32");
1029 serge 227
 
9833 turbocat 228
struct kos_appdata* IMPORT GetCurrSlot(void) __asm__("GetCurrSlot");
229
 
1029 serge 230
#define pciReadByte(tag, reg) \
231
        PciRead8(PCI_BUS_FROM_TAG(tag),PCI_DFN_FROM_TAG(tag),(reg))
232
 
233
#define pciReadWord(tag, reg) \
234
        PciRead16(PCI_BUS_FROM_TAG(tag),PCI_DFN_FROM_TAG(tag),(reg))
235
 
236
#define pciReadLong(tag, reg) \
237
        PciRead32(PCI_BUS_FROM_TAG(tag),PCI_DFN_FROM_TAG(tag),(reg))
238
 
239
#define pciWriteByte(tag, reg, val) \
240
        PciWrite8(PCI_BUS_FROM_TAG(tag),PCI_DFN_FROM_TAG(tag),(reg),(val))
241
 
242
#define pciWriteWord(tag, reg, val) \
243
        PciWrite16(PCI_BUS_FROM_TAG(tag),PCI_DFN_FROM_TAG(tag),(reg),(val))
244
 
245
#define pciWriteLong(tag, reg, val) \
246
        PciWrite32(PCI_BUS_FROM_TAG(tag),PCI_DFN_FROM_TAG(tag),(reg),(val))
247
 
3031 serge 248
 
1029 serge 249
///////////////////////////////////////////////////////////////////////////////
250
 
251
int dbg_open(char *path);
252
int dbgprintf(const char* format, ...);
253
 
254
///////////////////////////////////////////////////////////////////////////////
255
 
4110 Serge 256
static inline int CreateKernelThread(void *entry)
257
{
258
    int pid;
259
     __asm__ __volatile__ (
260
     "call *__imp__CreateThread"
261
     :"=a"(pid)
262
     :"b"(1),"c"(entry),"d"(0)
263
     :"memory");
264
     __asm__ __volatile__ ("":::"ebx","ecx","edx","esi","edi");
265
     return pid;
266
};
267
 
268
 
5270 serge 269
static inline evhandle_t CreateEvent(kevent_t *ev, u32 flags)
1029 serge 270
{
1616 serge 271
     evhandle_t evh;
1613 serge 272
 
273
     __asm__ __volatile__ (
274
     "call *__imp__CreateEvent"
1616 serge 275
     :"=A"(evh.raw)
276
     :"S" (ev), "c"(flags)
277
     :"memory");
2005 serge 278
     __asm__ __volatile__ ("":::"ebx","ecx","edx","esi", "edi");
1613 serge 279
 
1616 serge 280
     return evh;
281
};
1613 serge 282
 
5270 serge 283
static inline void RaiseEvent(evhandle_t evh, u32 flags, kevent_t *ev)
1616 serge 284
{
285
     __asm__ __volatile__ (
286
     "call *__imp__RaiseEvent"
287
     ::"a"(evh.handle),"b"(evh.euid),"d"(flags),"S" (ev)
288
     :"memory");
2005 serge 289
     __asm__ __volatile__ ("":::"ebx","ecx","edx","esi","edi");
1616 serge 290
 
291
};
292
 
2005 serge 293
static inline void WaitEvent(evhandle_t evh)
1616 serge 294
{
295
     __asm__ __volatile__ (
296
     "call *__imp__WaitEvent"
2005 serge 297
     ::"a"(evh.handle),"b"(evh.euid));
298
     __asm__ __volatile__ ("":::"ebx","ecx","edx","esi","edi");
1616 serge 299
};
300
 
3391 Serge 301
static inline int WaitEventTimeout(evhandle_t evh, int timeout)
302
{
303
    int retval;
304
    __asm__ __volatile__ (
305
    "call *__imp__WaitEventTimeout"
306
    :"=a"(retval)
307
    :"a"(evh.handle),"b"(evh.euid), "c"(timeout));
308
    __asm__ __volatile__ ("":::"ebx","ecx","edx","esi","edi");
309
    return retval;
310
};
311
 
2967 Serge 312
static inline void DestroyEvent(evhandle_t evh)
313
{
314
     __asm__ __volatile__ (
315
     "call *__imp__DestroyEvent"
316
     ::"a"(evh.handle),"b"(evh.euid));
317
     __asm__ __volatile__ ("":::"ebx","ecx","edx","esi","edi");
318
};
319
 
5270 serge 320
static inline u32 GetEvent(kevent_t *ev)
1616 serge 321
{
5270 serge 322
    u32  handle;
1616 serge 323
 
324
    __asm__ __volatile__ (
325
    "call *__imp__GetEvent"
326
    :"=a"(handle)
327
    :"D"(ev)
328
    :"memory");
329
    __asm__ __volatile__ ("":::"ebx","ecx","edx", "esi","edi");
1613 serge 330
     return handle;
331
};
332
 
1616 serge 333
 
1613 serge 334
static inline int GetScreenSize(void)
335
{
1029 serge 336
  int retval;
337
 
338
  asm("int $0x40"
339
      :"=a"(retval)
340
      :"a"(61), "b"(1));
341
  return retval;
342
}
343
 
1613 serge 344
static inline int GetScreenBpp(void)
1029 serge 345
{
346
  int retval;
347
 
348
  asm("int $0x40"
349
      :"=a"(retval)
350
      :"a"(61), "b"(2));
351
  return retval;
352
}
353
 
1613 serge 354
static inline int GetScreenPitch(void)
1029 serge 355
{
356
  int retval;
357
 
358
  asm("int $0x40"
359
      :"=a"(retval)
360
      :"a"(61), "b"(3));
361
  return retval;
362
}
363
 
5270 serge 364
static inline u32 GetPgAddr(void *mem)
1029 serge 365
{
5270 serge 366
     u32 retval;
1029 serge 367
 
368
     __asm__ __volatile__ (
369
     "call *__imp__GetPgAddr \n\t"
2967 Serge 370
     :"=a" (retval)
1029 serge 371
     :"a" (mem) );
372
     return retval;
373
};
374
 
5270 serge 375
static inline void CommitPages(void *mem, u32 page, u32 size)
1029 serge 376
{
377
     size = (size+4095) & ~4095;
378
     __asm__ __volatile__ (
379
     "call *__imp__CommitPages"
380
     ::"a" (page), "b"(mem),"c"(size>>12)
381
     :"edx" );
382
     __asm__ __volatile__ ("":::"eax","ebx","ecx");
383
};
384
 
1408 serge 385
static inline void UnmapPages(void *mem, size_t size)
1029 serge 386
{
387
     size = (size+4095) & ~4095;
388
     __asm__ __volatile__ (
389
     "call *__imp__UnmapPages"
390
     ::"a" (mem), "c"(size>>12)
391
     :"edx");
392
     __asm__ __volatile__ ("":::"eax","ecx");
393
};
394
 
5270 serge 395
static inline void usleep(u32 delay)
1029 serge 396
{
397
     if( !delay )
398
        delay++;
1408 serge 399
     delay*= 500;
1029 serge 400
 
401
     while(delay--)
1408 serge 402
        __asm__ __volatile__(
403
        "xorl %%eax, %%eax \n\t"
404
        "cpuid \n\t"
405
        :::"eax","ebx","ecx","edx");
406
     };
407
 
5270 serge 408
static inline void udelay1(u32 delay)
1408 serge 409
{
410
    if(!delay) delay++;
2967 Serge 411
    delay*= 100;
1408 serge 412
 
413
    while(delay--)
414
    {
415
        __asm__ __volatile__(
416
        "xorl %%eax, %%eax \n\t"
417
        "cpuid"
418
        :::"eax","ebx","ecx","edx" );
419
    }
420
}
421
 
5270 serge 422
static inline void msleep1(unsigned int msecs)
1964 serge 423
{
424
    msecs /= 10;
425
    if(!msecs) msecs = 1;
426
 
427
     __asm__ __volatile__ (
428
     "call *__imp__Delay"
429
     ::"b" (msecs));
430
     __asm__ __volatile__ (
431
     "":::"ebx");
432
 
433
};
434
 
5270 serge 435
static inline void mdelay1(u32 time)
1408 serge 436
{
437
    time /= 10;
438
    if(!time) time = 1;
439
 
1029 serge 440
     __asm__ __volatile__ (
1408 serge 441
     "call *__imp__Delay"
442
     ::"b" (time));
443
     __asm__ __volatile__ (
444
     "":::"ebx");
445
 
1029 serge 446
};
447
 
5270 serge 448
static inline u32 __PciApi(int cmd)
1029 serge 449
{
5270 serge 450
     u32 retval;
1029 serge 451
 
452
     __asm__ __volatile__ (
1616 serge 453
     "call *__imp__PciApi \n\t"
454
     "movzxb %%al, %%eax"
1029 serge 455
     :"=a" (retval)
456
     :"a" (cmd)
1630 serge 457
     :"cc");
458
 
1029 serge 459
     return retval;
460
};
461
 
5270 serge 462
static inline void* __CreateObject(u32 pid, size_t size)
1029 serge 463
{
464
     void *retval;
465
 
466
     __asm__ __volatile__ (
467
     "call *__imp__CreateObject \n\t"
468
     :"=a" (retval)
469
     :"a" (size),"b"(pid)
470
     :"esi","edi", "memory");
471
     return retval;
472
}
473
 
1408 serge 474
static inline void __DestroyObject(void *obj)
1029 serge 475
{
476
     __asm__ __volatile__ (
1408 serge 477
     "call *__imp__DestroyObject \n\t"
1029 serge 478
     :
1408 serge 479
     :"a" (obj));
480
     __asm__ __volatile__ (
481
     ""
482
     :::"eax","ebx","ecx","edx","esi","edi","cc","memory");
1029 serge 483
}
484
 
5270 serge 485
static inline u32 GetService(const char *name)
1029 serge 486
{
5270 serge 487
    u32 handle;
1408 serge 488
 
489
    __asm__ __volatile__
490
    (
491
     "pushl %%eax \n\t"
492
     "call *__imp__GetService"
2967 Serge 493
     :"=a" (handle)
1408 serge 494
     :"a" (name)
495
     :"ebx","ecx","edx","esi", "edi"
496
  );
497
  return handle;
498
};
499
 
5270 serge 500
static inline u32 safe_cli(void)
1408 serge 501
{
5270 serge 502
     u32 ifl;
1029 serge 503
     __asm__ __volatile__ (
504
     "pushf\n\t"
505
     "popl %0\n\t"
506
     "cli\n"
507
     : "=r" (ifl));
508
    return ifl;
509
}
510
 
5270 serge 511
static inline void safe_sti(u32 efl)
1029 serge 512
{
1616 serge 513
     if (efl & (1<<9))
514
        __asm__ __volatile__ ("sti");
1029 serge 515
}
516
 
5270 serge 517
static inline u32 get_eflags(void)
1613 serge 518
{
5270 serge 519
    u32 val;
1613 serge 520
    asm volatile (
521
    "pushfl\n\t"
522
    "popl %0\n"
523
    : "=r" (val));
524
    return val;
525
}
526
 
1408 serge 527
static inline void __clear (void * dst, unsigned len)
1029 serge 528
{
5270 serge 529
     u32 tmp;
1029 serge 530
     __asm__ __volatile__ (
531
     "cld \n\t"
532
     "rep stosb \n"
533
     :"=c"(tmp),"=D"(tmp)
534
     :"a"(0),"c"(len),"D"(dst));
535
     __asm__ __volatile__ ("":::"ecx","edi");
536
};
537
 
5270 serge 538
static inline void out8(const u16 port, const u8 val)
1029 serge 539
{
540
    __asm__ __volatile__
541
    ("outb  %1, %0\n" : : "dN"(port), "a"(val));
542
}
543
 
5270 serge 544
static inline void out16(const u16 port, const u16 val)
1029 serge 545
{
546
    __asm__ __volatile__
547
    ("outw  %1, %0\n" : : "dN"(port), "a"(val));
548
}
549
 
5270 serge 550
static inline void out32(const u16 port, const u32 val)
1029 serge 551
{
552
    __asm__ __volatile__
553
    ("outl  %1, %0\n" : : "dN"(port), "a"(val));
554
}
555
 
5270 serge 556
static inline u8 in8(const u16 port)
1029 serge 557
{
5270 serge 558
    u8 tmp;
1029 serge 559
    __asm__ __volatile__
560
    ("inb %1, %0\n" : "=a"(tmp) : "dN"(port));
561
    return tmp;
562
};
563
 
5270 serge 564
static inline u16 in16(const u16 port)
1029 serge 565
{
5270 serge 566
    u16 tmp;
1029 serge 567
    __asm__ __volatile__
568
    ("inw %1, %0\n" : "=a"(tmp) : "dN"(port));
569
    return tmp;
570
};
571
 
5270 serge 572
static inline u32 in32(const u16 port)
1029 serge 573
{
5270 serge 574
    u32 tmp;
1029 serge 575
    __asm__ __volatile__
576
    ("inl %1, %0\n" : "=a"(tmp) : "dN"(port));
577
    return tmp;
578
};
579
 
1408 serge 580
static inline void delay(int time)
1029 serge 581
{
582
     __asm__ __volatile__ (
583
     "call *__imp__Delay"
584
     ::"b" (time));
585
     __asm__ __volatile__ (
586
     "":::"ebx");
587
 
588
}
589
 
1613 serge 590
static inline void change_task(void)
1029 serge 591
{
592
     __asm__ __volatile__ (
593
     "call *__imp__ChangeTask");
594
}
595
 
1613 serge 596
static inline void sysSetScreen(int width, int height, int pitch)
1408 serge 597
{
598
    __asm__ __volatile__
599
    (
600
        "call *__imp__SetScreen"
601
        :
602
        :"a" (width-1),"d"(height-1), "c"(pitch)
603
    );
604
    __asm__ __volatile__
605
    ("" :::"eax","ecx","edx");
606
}
607
 
6336 serge 608
void  FASTCALL sysSetFramebuffer(void *fb)__asm__("SetFramebuffer");
1408 serge 609
 
610
 
611
static inline void __SysMsgBoardStr(char *text)
612
{
613
    __asm__ __volatile__(
614
    "call *__imp__SysMsgBoardStr"
615
    ::"S" (text));
616
};
617
 
9827 turbocat 618
static inline void *KernelZeroAlloc(unsigned long size)
3031 serge 619
{
620
    void *mem;
621
 
622
    mem = KernelAlloc(size);
623
    if(mem)
624
        memset(mem, 0, size);
625
 
626
   return mem;
627
};
628
 
6082 serge 629
static inline int power_supply_is_system_supplied(void) { return -1; };
3031 serge 630
 
9833 turbocat 631
static inline int FS_Service(ksys70_t *k, int* err)
632
{
9057 turbocat 633
    int status;
634
    __asm__ __volatile__(
635
     "call *__imp__FS_Service"
636
     :"=a" (status), "=b" (*err)
637
     :"b" (k)
638
     :"memory"
639
    );
640
    __asm__ __volatile__ ("":::"ebx","ecx","edx","esi","edi");
641
    return status;
642
}
1408 serge 643
#endif