Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/* Project:     OSLib
2
 * Description: The OS Construction Kit
3
 * Date:                1.6.2000
4
 * Idea by:             Luca Abeni & Gerardo Lamastra
5
 *
6
 * OSLib is an SO project aimed at developing a common, easy-to-use
7
 * low-level infrastructure for developing OS kernels and Embedded
8
 * Applications; it partially derives from the HARTIK project but it
9
 * currently is independently developed.
10
 *
11
 * OSLib is distributed under GPL License, and some of its code has
12
 * been derived from the Linux kernel source; also some important
13
 * ideas come from studying the DJGPP go32 extender.
14
 *
15
 * We acknowledge the Linux Community, Free Software Foundation,
16
 * D.J. Delorie and all the other developers who believe in the
17
 * freedom of software and ideas.
18
 *
19
 * For legalese, check out the included GPL license.
20
 */
21
 
22
 
23
#include <ll/i386/cons.h>
24
#include <ll/stdlib.h>
25
#include <ll/sys/types.h>
26
 
27
/* bytes for +Infinity on a 387 */
28
char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
29
 
30
static int (*__errnumber)(void) = NULL;
31
static int errno;
32
int *__errnumber1()
33
{
34
  if (__errnumber == NULL) {
35
    return &errno;
36
  }
37
 
38
  return (void *)__errnumber();
39
}
40
 
41
void seterrnumber(int (*e)(void))
42
{
43
  __errnumber = e;
44
}
45
 
46
int isnan(double d)
47
{
48
        register struct IEEEdp {
49
                u_int manl : 32;
50
                u_int manh : 20;
51
                u_int  exp : 11;
52
                u_int sign :  1;
53
        } *p = (struct IEEEdp *)&d;
54
 
55
        return(p->exp == 2047 && (p->manh || p->manl));
56
}
57
 
58
/* By Luca.... The write stub */
59
int write(int a, char *b, int c)
60
{
61
        b[c] = 0;
62
        cputs(b);
63
        return c;
64
}