diff options
author | H. Peter Anvin <hpa@zytor.com> | 2014-01-17 17:06:35 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2014-01-17 17:06:35 -0800 |
commit | 69c272fa4b12775c51b1b86bf2720665ebf0f1a7 (patch) | |
tree | eb387bbefab86553fe67194075f879d01537994e | |
parent | ec8d8333983857d3c78311c52635651bf4363e28 (diff) | |
download | syslinux-69c272fa4b12775c51b1b86bf2720665ebf0f1a7.tar.gz syslinux-69c272fa4b12775c51b1b86bf2720665ebf0f1a7.tar.xz syslinux-69c272fa4b12775c51b1b86bf2720665ebf0f1a7.zip |
dos: Remove redundant data_segment() definition
The definition for data_segment() was exactly the same as ds().
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | dos/syslinux.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/dos/syslinux.c b/dos/syslinux.c index 8e856d4f..3c45f347 100644 --- a/dos/syslinux.c +++ b/dos/syslinux.c @@ -170,15 +170,6 @@ ssize_t write_file(int fd, const void *buf, size_t count) return done; } -static inline __attribute__ ((const)) -uint16_t data_segment(void) -{ - uint16_t ds; - - asm("movw %%ds,%0" : "=rm"(ds)); - return ds; -} - void write_device(int drive, const void *buf, size_t nsecs, unsigned int sector) { uint16_t errnum = 0x0001; @@ -189,7 +180,7 @@ void write_device(int drive, const void *buf, size_t nsecs, unsigned int sector) dio.startsector = sector; dio.sectors = nsecs; dio.bufoffs = (uintptr_t) buf; - dio.bufseg = data_segment(); + dio.bufseg = ds(); if (dos_version >= 0x070a) { /* Try FAT32-aware system call first */ @@ -222,7 +213,7 @@ void read_device(int drive, void *buf, size_t nsecs, unsigned int sector) dio.startsector = sector; dio.sectors = nsecs; dio.bufoffs = (uintptr_t) buf; - dio.bufseg = data_segment(); + dio.bufseg = ds(); if (dos_version >= 0x070a) { /* Try FAT32-aware system call first */ @@ -322,7 +313,7 @@ void write_mbr(int drive, const void *buf) dprintf("write_mbr(%d,%p)", drive, buf); mbr.bufferoffset = (uintptr_t) buf; - mbr.bufferseg = data_segment(); + mbr.bufferseg = ds(); rv = 0x440d; asm volatile ("int $0x21 ; setc %0" : "=bcdm" (err), "+a"(rv) @@ -351,7 +342,7 @@ void read_mbr(int drive, const void *buf) dprintf("read_mbr(%d,%p)", drive, buf); mbr.bufferoffset = (uintptr_t) buf; - mbr.bufferseg = data_segment(); + mbr.bufferseg = ds(); rv = 0x440d; asm volatile ("int $0x21 ; setc %0":"=abcdm" (err), "+a"(rv) |