aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/doscmd
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2002-07-19 13:38:43 +0000
committerMark Murray <markm@FreeBSD.org>2002-07-19 13:38:43 +0000
commitc279819e2ef4f9d5a91ab3531cf2d3bec2de25a9 (patch)
tree8ff8a1fb45d285ad3b8b8fe9a28e8c34c78a4982 /usr.bin/doscmd
parent5fc8ac9eb8c99b54461f036237f05e3ad0932bf9 (diff)
Notes
Diffstat (limited to 'usr.bin/doscmd')
-rw-r--r--usr.bin/doscmd/cmos.c6
-rw-r--r--usr.bin/doscmd/cwd.c12
-rw-r--r--usr.bin/doscmd/cwd.h22
-rw-r--r--usr.bin/doscmd/dispatch.h6
-rw-r--r--usr.bin/doscmd/dos.h4
-rw-r--r--usr.bin/doscmd/int13.c6
-rw-r--r--usr.bin/doscmd/int1a.c2
-rw-r--r--usr.bin/doscmd/port.c28
-rw-r--r--usr.bin/doscmd/register.h4
-rw-r--r--usr.bin/doscmd/trace.c4
10 files changed, 51 insertions, 43 deletions
diff --git a/usr.bin/doscmd/cmos.c b/usr.bin/doscmd/cmos.c
index d899e96530373..61534b7167f25 100644
--- a/usr.bin/doscmd/cmos.c
+++ b/usr.bin/doscmd/cmos.c
@@ -99,20 +99,20 @@ static struct timeval glob_clock;
static int cmos_alarm_time = 0;
static int cmos_alarm_daytime = 0;
-static inline int
+static __inline int
day_in_mon_year(int mon, int year)
{
return day_in_year[mon] + (mon > 2 && (year % 4 == 0));
}
-static inline int
+static __inline int
to_BCD (int n)
{
n &= 0xFF;
return n%10 + ((n/10)<<4);
}
-static inline int
+static __inline int
from_BCD (int n)
{
n &= 0xFF;
diff --git a/usr.bin/doscmd/cwd.c b/usr.bin/doscmd/cwd.c
index 1410238a08ab8..58b9434fbebdf 100644
--- a/usr.bin/doscmd/cwd.c
+++ b/usr.bin/doscmd/cwd.c
@@ -48,9 +48,9 @@ __FBSDID("$FreeBSD$");
#include "cwd.h"
/* Local functions */
-static inline int isvalid(unsigned);
-static inline int isdot(unsigned);
-static inline int isslash(unsigned);
+static __inline int isvalid(unsigned);
+static __inline int isdot(unsigned);
+static __inline int isslash(unsigned);
static void to_dos_fcb(u_char *, u_char *);
#define D_REDIR 0x0080000 /* XXX - ack */
@@ -404,19 +404,19 @@ u_char cattr[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
};
-static inline int
+static __inline int
isvalid(unsigned c)
{
return (cattr[c & 0xff] == 1);
}
-static inline int
+static __inline int
isdot(unsigned c)
{
return (cattr[c & 0xff] == 3);
}
-static inline int
+static __inline int
isslash(unsigned c)
{
return (cattr[c & 0xff] == 4);
diff --git a/usr.bin/doscmd/cwd.h b/usr.bin/doscmd/cwd.h
index 16c74740beb16..ac5bbd13e73ad 100644
--- a/usr.bin/doscmd/cwd.h
+++ b/usr.bin/doscmd/cwd.h
@@ -32,67 +32,67 @@
* $FreeBSD$
*/
-static inline u_char *
+static __inline u_char *
ustrcpy(u_char *s1, u_char *s2)
{
return((u_char *)strcpy((char *)s1, (char *)s2));
}
-static inline u_char *
+static __inline u_char *
ustrcat(u_char *s1, u_char *s2)
{
return((u_char *)strcat((char *)s1, (char *)s2));
}
-static inline u_char *
+static __inline u_char *
ustrncat(u_char *s1, const u_char *s2, size_t n)
{
return((u_char *)strncat((char *)s1, (const char *)s2, n));
}
-static inline u_char *
+static __inline u_char *
ustrncpy(u_char *s1, u_char *s2, size_t n)
{
return((u_char *)strncpy((char *)s1, (char *)s2, n));
}
-static inline int
+static __inline int
ustrcmp(u_char *s1, u_char *s2)
{
return(strcmp((char *)s1, (char *)s2));
}
-static inline int
+static __inline int
ustrncmp(const u_char *s1, const u_char *s2, size_t n)
{
return(strncmp((const char *)s1, (const char *)s2, n));
}
-static inline int
+static __inline int
ustrlen(const u_char *s)
{
return(strlen((const char *)s));
}
-static inline u_char *
+static __inline u_char *
ustrrchr(u_char *s, u_char c)
{
return((u_char *)strrchr((char *)s, c));
}
-static inline u_char *
+static __inline u_char *
ustrdup(const u_char *s)
{
return((u_char *)strdup((const char *)s));
}
-static inline int
+static __inline int
ustat(u_char *s, struct stat *sb)
{
return(stat((char *)s, sb));
}
-static inline int
+static __inline int
uaccess(u_char *s, int mode)
{
return(access((char *)s, mode));
diff --git a/usr.bin/doscmd/dispatch.h b/usr.bin/doscmd/dispatch.h
index b1932af9dc1dd..72df2840acd0f 100644
--- a/usr.bin/doscmd/dispatch.h
+++ b/usr.bin/doscmd/dispatch.h
@@ -55,7 +55,7 @@ struct intfunc_table
** must be arranged with all handlers for a given function together, and
** that the handler listed with IFT_NOSUBFUNC should be last.
*/
-static inline void
+static __inline void
intfunc_init(struct intfunc_table table[], int idx[])
{
int hn;
@@ -72,7 +72,7 @@ intfunc_init(struct intfunc_table table[], int idx[])
** Call this to get an index matching the function/subfunction
** described by (sc), or -1 if none exist
*/
-static inline int
+static __inline int
intfunc_find(struct intfunc_table table[], int idx[], int func, int subfunc)
{
int ent = idx[func]; /* look for handler */
@@ -95,7 +95,7 @@ intfunc_find(struct intfunc_table table[], int idx[], int func, int subfunc)
** Again, handlers with IFT_NOSUBFUNC should be listed after any with
** specific subfunction values.
*/
-static inline int
+static __inline int
intfunc_search(struct intfunc_table table[], int func, int subfunc)
{
int ent;
diff --git a/usr.bin/doscmd/dos.h b/usr.bin/doscmd/dos.h
index b75963f1211b7..64ed49261ab0c 100644
--- a/usr.bin/doscmd/dos.h
+++ b/usr.bin/doscmd/dos.h
@@ -356,13 +356,13 @@ struct reloc_entry {
** DOS-related shrapnel
*/
-static inline int
+static __inline int
from_dos_attr(int attr)
{
return((attr & READ_ONLY_FILE) ? 0444 : 0666);
}
-static inline int
+static __inline int
to_dos_attr(int mode)
{
int attr;
diff --git a/usr.bin/doscmd/int13.c b/usr.bin/doscmd/int13.c
index a52daea8f2b48..ba9be70d49dd4 100644
--- a/usr.bin/doscmd/int13.c
+++ b/usr.bin/doscmd/int13.c
@@ -97,13 +97,13 @@ struct diskinfo {
#define hd_status (*(u_char *)0x474)
#define fd_status (*(u_char *)0x441)
-static inline int
+static __inline int
disize(struct diskinfo *di)
{
return(di->sectors * di->cylinders * di->sides);
}
-static inline int
+static __inline int
cylsize(struct diskinfo *di)
{
return(di->sectors * di->sides);
@@ -335,7 +335,7 @@ init_hdisk(int drive, int cyl, int head, int tracksize, char *file, char *fake_p
return(drive);
}
-static inline int
+static __inline int
bps(int size)
{
switch (size) {
diff --git a/usr.bin/doscmd/int1a.c b/usr.bin/doscmd/int1a.c
index 0c5696882af13..abd19296f8afb 100644
--- a/usr.bin/doscmd/int1a.c
+++ b/usr.bin/doscmd/int1a.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include "doscmd.h"
-static inline int
+static __inline int
to_BCD (int n)
{
n &= 0xFF;
diff --git a/usr.bin/doscmd/port.c b/usr.bin/doscmd/port.c
index a65b1be7450d2..22e995fedd4f0 100644
--- a/usr.bin/doscmd/port.c
+++ b/usr.bin/doscmd/port.c
@@ -42,17 +42,25 @@ __FBSDID("$FreeBSD$");
#define MINPORT 0x000
#define MAXPORT_MASK (MAXPORT - 1)
-#define in(port) \
-({ \
- register int _inb_result; \
-\
- asm volatile ("xorl %%eax,%%eax; inb %%dx,%%al" : \
- "=a" (_inb_result) : "d" (port)); \
- _inb_result; \
-})
+static __inline int
+in(u_int port)
+{
+ int _inb_result;
+
+#ifdef __GNUC__
+ __asm __volatile ("xorl %%eax,%%eax; inb %%dx,%%al" :
+ "=a" (_inb_result) : "d" (port));
+#endif
+ return _inb_result;
+}
-#define out(port, data) \
- asm volatile ("outb %%al,%%dx" : : "a" (data), "d" (port))
+static __inline void
+out(u_int port, int data)
+{
+#ifdef __GNUC__
+ __asm __volatile ("outb %%al,%%dx" : : "a" (data), "d" (port));
+#endif
+}
FILE *iolog = 0;
u_long ioports[MAXPORT/32];
diff --git a/usr.bin/doscmd/register.h b/usr.bin/doscmd/register.h
index 6e0752c542ddf..6be530922c361 100644
--- a/usr.bin/doscmd/register.h
+++ b/usr.bin/doscmd/register.h
@@ -155,14 +155,14 @@ typedef union
#define REGISTERS regcontext_t *REGS
-inline static void
+static __inline void
PUSH(u_short x, REGISTERS)
{
R_SP -= 2;
*(u_short *)MAKEPTR(R_SS, R_SP) = (x);
}
-inline static u_short
+static __inline u_short
POP(REGISTERS)
{
u_short x;
diff --git a/usr.bin/doscmd/trace.c b/usr.bin/doscmd/trace.c
index d99dff67928de..c710504583eb2 100644
--- a/usr.bin/doscmd/trace.c
+++ b/usr.bin/doscmd/trace.c
@@ -43,7 +43,7 @@ static u_char *iaddr, ibyte;
/* locals */
static void printtrace(regcontext_t *REGS, char *buf);
-static inline void showstate(long, long, char);
+static __inline void showstate(long, long, char);
/*
* Before exiting to VM86 mode:
@@ -183,7 +183,7 @@ tracetrap(regcontext_t *REGS)
}
}
-static inline void
+static __inline void
showstate(long flags, long flag, char f)
{
putc((flags & flag) ? f : ' ', debugf);