Add an optional MD calling convention flag for use in libsa when space

optimisation is critical. Use this on i386 to switch to register passing
calling convention for the file system entry points and most assembler
call backs that have to preserve at least 3 registers.
This commit is contained in:
joerg 2011-06-16 13:27:58 +00:00
parent 9703593994
commit c97378d081
21 changed files with 168 additions and 328 deletions

View File

@ -1,8 +1,10 @@
/* $NetBSD: cdefs.h,v 1.7 2008/10/26 06:57:30 mrg Exp $ */
/* $NetBSD: cdefs.h,v 1.8 2011/06/16 13:27:59 joerg Exp $ */
#ifndef _I386_CDEFS_H_
#define _I386_CDEFS_H_
/* No arch-specific cdefs. */
#if defined(_STANDALONE)
#define __compactcall __attribute__((__regparm__(3)))
#endif
#endif /* !_I386_CDEFS_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: bios_disk.S,v 1.20 2010/12/29 22:40:46 jakllsch Exp $ */
/* $NetBSD: bios_disk.S,v 1.21 2011/06/16 13:27:59 joerg Exp $ */
/*
* Ported to boot 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
@ -63,13 +63,9 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* %al = 0x0 on success; err code on failure
*/
ENTRY(biosdisk_reset)
pushl %ebp
movl %esp, %ebp
pushl %ebx
push %edx
push %edi
pusha
movb 8(%ebp), %dl # device
movb %al, %dl # device
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -83,11 +79,9 @@ ENTRY(biosdisk_reset)
.code32
movzwl %bx, %eax # return value in %eax
movl %eax, 28(%esp)
pop %edi
pop %edx
popl %ebx
popl %ebp
popa
ret
/*
@ -108,24 +102,18 @@ ENTRY(biosdisk_reset)
* sending another command.
*/
ENTRY(biosdisk_read)
pushl %ebp
movl %esp, %ebp
pushl %ebx
push %ecx
push %edx
push %esi
push %edi
pusha
movb 16(%ebp), %dh
movw 12(%ebp), %cx
movb 44(%esp), %dh
movw 40(%esp), %cx
xchgb %ch, %cl # cylinder; the highest 2 bits of cyl is in %cl
rorb $2, %cl
movb 20(%ebp), %al
movb 48(%esp), %al
orb %al, %cl
incb %cl # sector; sec starts from 1, not 0
movb 8(%ebp), %dl # device
movl 28(%ebp), %ebx # buffer address (may be >64k)
movb 24(%ebp), %al # number of sectors
movb 36(%esp), %dl # device
movl 56(%esp), %ebx # buffer address (may be >64k)
movb 52(%esp), %al # number of sectors
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -145,14 +133,9 @@ ENTRY(biosdisk_read)
calll _C_LABEL(real_to_prot) # back to protected mode
.code32
movzwl %ax, %eax # return value in %eax
movl %eax, 28(%esp)
pop %edi
pop %esi
pop %edx
pop %ecx
popl %ebx
popl %ebp
popa
ret
/*
@ -160,16 +143,10 @@ ENTRY(biosdisk_read)
* max number of sectors, heads and cylinders for this device
*/
ENTRY(biosdisk_getinfo)
pushl %ebp
movl %esp, %ebp
push %es
pushl %ebx
push %ecx
push %edx
push %esi
push %edi
pusha
movb 8(%ebp), %dl # diskinfo(drive #)
movb %al, %dl # diskinfo(drive #)
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -209,14 +186,10 @@ ok:
shrl $8, %ecx
movb %dh, %cl # max head
orl %ecx, %eax # return value in %eax
movl %eax, 28(%esp)
pop %edi
pop %esi
pop %edx
pop %ecx
popl %ebx
popa
pop %es
popl %ebp
ret
/*
@ -224,15 +197,9 @@ ok:
* check for availibility of int13 extensions.
*/
ENTRY(biosdisk_int13ext)
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %ecx
pushl %edx
pushl %esi
pushl %edi
pusha
movb 8(%ebp), %dl # drive #
movb %al, %dl # drive #
movw $0x55aa, %bx
call _C_LABEL(prot_to_real) # enter real mode
@ -252,13 +219,9 @@ ENTRY(biosdisk_int13ext)
andb %dl, %al
andb %cl, %al
movl %eax, 28(%esp)
popl %edi
popl %esi
popl %edx
popl %ecx
popl %ebx
popl %ebp
popa
ret
/*
@ -271,16 +234,10 @@ ENTRY(biosdisk_int13ext)
* %al = 0x0 on success; err code on failure
*/
ENTRY(biosdisk_extread)
pushl %ebp
movl %esp, %ebp
pushl %ebx
push %ecx
push %edx
push %esi
push %edi
pusha
movb 8(%ebp), %dl # device
movl 12(%ebp), %esi # parameter block
movl %edx, %esi # parameter block
movb %al, %dl # device
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -303,26 +260,16 @@ ENTRY(biosdisk_extread)
.code32
movzwl %bx, %eax # return value in %eax
movl %eax, 28(%esp)
pop %edi
pop %esi
pop %edx
pop %ecx
popl %ebx
popl %ebp
popa
ret
ENTRY(biosdisk_getextinfo)
pushl %ebp
movl %esp, %ebp
pushl %ebx
push %ecx
push %edx
push %esi
push %edi
pusha
movb 8(%ebp), %dl # device
movl 12(%ebp), %esi # parameter block
movl %edx, %esi # parameter block
movb %al, %dl # device
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -344,11 +291,7 @@ ENTRY(biosdisk_getextinfo)
.code32
movzbl %bl, %eax # return value in %eax
movl %eax, 28(%esp)
pop %edi
pop %esi
pop %edx
pop %ecx
popl %ebx
popl %ebp
popa
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: biosgetrtc.S,v 1.6 2005/12/11 12:17:48 christos Exp $ */
/* $NetBSD: biosgetrtc.S,v 1.7 2011/06/16 13:27:59 joerg Exp $ */
/*
* Copyright (c) 1996
@ -29,13 +29,8 @@
#include <machine/asm.h>
ENTRY(biosgetrtc)
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %ecx
pushl %edx
push %esi
push %edi
pusha
pushl %eax
xorl %ebx, %ebx
@ -51,18 +46,13 @@ ok:
calll _C_LABEL(real_to_prot) # back to protected mode
.code32
movl 8(%ebp), %eax
movl $0, (%eax)
popl %eax
movb %ch, (%eax)
movb %cl, 1(%eax)
movb %dh, 2(%eax)
movb $0, 3(%eax)
movl %ebx, %eax
movl %ebx, 28(%esp)
pop %edi
pop %esi
popl %edx
popl %ecx
popl %ebx
popl %ebp
popa
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: biosgetsystime.S,v 1.2 2008/04/28 20:23:25 martin Exp $ */
/* $NetBSD: biosgetsystime.S,v 1.3 2011/06/16 13:27:59 joerg Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -34,13 +34,7 @@
/* Return system time (~18.2Hz ticks since midnight) */
ENTRY(biosgetsystime)
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %ecx
pushl %edx
push %esi
push %edi
pusha
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -54,11 +48,7 @@ ENTRY(biosgetsystime)
mov %ecx, %eax
shl $16, %eax
movw %dx, %ax
movl %eax, 28(%esp)
pop %edi
pop %esi
popl %edx
popl %ecx
popl %ebx
popl %ebp
popa
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: biosmem.S,v 1.8 2005/12/11 12:17:48 christos Exp $ */
/* $NetBSD: biosmem.S,v 1.9 2011/06/16 13:27:59 joerg Exp $ */
/*
* Copyright (c) 1996
@ -39,39 +39,26 @@
/* get mem below 1M, in kByte */
ENTRY(getbasemem)
pushl %ebp
movl %esp,%ebp
pushl %ebx
push %esi
push %edi
pusha
call _C_LABEL(prot_to_real)
.code16
int $0x12
# zero-extend 16-bit result to 32 bits.
movl $0, %ebx
mov %ax,%bx
movzwl %ax, %eax
calll _C_LABEL(real_to_prot)
.code32
movl %ebx, %eax
pop %edi
pop %esi
popl %ebx
popl %ebp
movl %eax, 28(%esp)
popa
ret
/* get mem above 1M, in kByte */
ENTRY(getextmem1)
pushl %ebp
movl %esp,%ebp
pushl %ebx
push %esi
push %edi
pusha
call _C_LABEL(prot_to_real)
.code16
@ -80,17 +67,12 @@ ENTRY(getextmem1)
int $0x15
# zero-extend 16-bit result to 32 bits.
movl $0, %ebx
mov %ax,%bx
movzwl %ax, %eax
calll _C_LABEL(real_to_prot)
.code32
movl %ebx, %eax
pop %edi
pop %esi
popl %ebx
popl %ebp
movl %eax, 28(%esp)
popa
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: biosmemps2.S,v 1.5 2011/02/20 05:45:48 jakllsch Exp $ */
/* $NetBSD: biosmemps2.S,v 1.6 2011/06/16 13:27:59 joerg Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -40,15 +40,9 @@
*/
ENTRY(getextmemps2)
.code32
pushl %ebp
movl %esp,%ebp
pushl %ebx
pushl %ecx
pushl %edx
push %esi
push %edi
movl 8(%ebp), %edx # parameter
movl %eax, %edx
xorl %eax, %eax
pusha
call _C_LABEL(prot_to_real)
.code16
@ -88,12 +82,6 @@ out:
calll _C_LABEL(real_to_prot)
.code32
movzbl %cl, %eax # return value in %eax
pop %edi
pop %esi
popl %edx
popl %ecx
popl %ebx
popl %ebp
movb %cl, 28(%esp)
popa
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: biosreboot.S,v 1.4 2005/12/11 12:17:48 christos Exp $ */
/* $NetBSD: biosreboot.S,v 1.5 2011/06/16 13:27:59 joerg Exp $ */
/*
* Copyright (c) 1997
@ -40,11 +40,7 @@
/* Call INT 19 to do the equivalent of CTL-ALT-DEL */
ENTRY(reboot)
pushl %ebp
movl %esp,%ebp
pushl %ebx
push %esi
push %edi
pusha
call _C_LABEL(prot_to_real)
.code16
@ -56,10 +52,6 @@ ENTRY(reboot)
calll _C_LABEL(real_to_prot)
.code32
movl %ebx, %eax
pop %edi
pop %esi
popl %ebx
popl %ebp
movl %ebx, 28(%esp)
popa
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: conio.S,v 1.6 2008/05/21 01:51:34 ad Exp $ */
/* $NetBSD: conio.S,v 1.7 2011/06/16 13:27:59 joerg Exp $ */
/* PC console handling
originally from: FreeBSD:sys/i386/boot/netboot/start2.S
@ -12,14 +12,7 @@
CLR - Clear screen
**************************************************************************/
ENTRY(conclr)
push %ebp
mov %esp,%ebp
push %ecx
push %ebx
push %esi
push %edi
movb 8(%ebp),%cl
pusha
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -40,53 +33,35 @@ ENTRY(conclr)
calll _C_LABEL(real_to_prot) # back to protected mode
.code32
pop %edi
pop %esi
pop %ebx
pop %ecx
pop %ebp
popa
ret
/**************************************************************************
PUTC - Print a character
**************************************************************************/
ENTRY(conputc)
push %ebp
mov %esp,%ebp
push %ecx
push %ebx
push %esi
push %edi
movb 8(%ebp),%cl
pusha
call _C_LABEL(prot_to_real) # enter real mode
.code16
movb %cl,%al
movw $1,%bx
movb $0x0e,%ah
movb %al, %cl
int $0x10
calll _C_LABEL(real_to_prot) # back to protected mode
.code32
pop %edi
pop %esi
pop %ebx
pop %ecx
pop %ebp
popa
ret
/**************************************************************************
GETC - Get a character
**************************************************************************/
ENTRY(congetc)
push %ebp
mov %esp,%ebp
push %ebx
push %esi
push %edi
xorl %eax, %eax
pusha
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -98,24 +73,17 @@ ENTRY(congetc)
calll _C_LABEL(real_to_prot) # back to protected mode
.code32
xor %eax,%eax
movb %bl,%al
movb %bl, 28(%esp)
pop %edi
pop %esi
pop %ebx
pop %ebp
popa
ret
/**************************************************************************
ISSHIFT - Check for keyboard interrupt; via shift key
**************************************************************************/
ENTRY(conisshift)
push %ebp
mov %esp,%ebp
push %ebx
push %esi
push %edi
xorl %eax, %eax
pusha
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -129,24 +97,17 @@ ENTRY(conisshift)
calll _C_LABEL(real_to_prot) # back to protected mode
.code32
xor %eax,%eax
movb %bl,%al
movb %bl, 28(%esp)
pop %edi
pop %esi
pop %ebx
pop %ebp
popa
ret
/**************************************************************************
ISKEY - Check for keyboard input
**************************************************************************/
ENTRY(coniskey)
push %ebp
mov %esp,%ebp
push %ebx
push %esi
push %edi
xorl %eax, %eax
pusha
call _C_LABEL(prot_to_real) # enter real mode
.code16
@ -159,11 +120,7 @@ ENTRY(coniskey)
calll _C_LABEL(real_to_prot) # back to protected mode
.code32
xor %eax,%eax
movb %bl,%al
movb %bl, 28(%esp)
pop %edi
pop %esi
pop %ebx
pop %ebp
popa
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: dosfile.c,v 1.14 2008/12/14 17:03:43 christos Exp $ */
/* $NetBSD: dosfile.c,v 1.15 2011/06/16 13:27:59 joerg Exp $ */
/*
* Copyright (c) 1996
@ -72,7 +72,7 @@ dos2errno(void)
return err;
}
int
__compactcall int
dos_open(const char *path, struct open_file *f)
{
struct dosfile *df;
@ -94,7 +94,7 @@ dos_open(const char *path, struct open_file *f)
return 0;
}
int
__compactcall int
dos_read(struct open_file *f, void *addr, size_t size, size_t *resid)
{
struct dosfile *df;
@ -156,7 +156,7 @@ dos_read(struct open_file *f, void *addr, size_t size, size_t *resid)
return 0;
}
int
__compactcall int
dos_close(struct open_file *f)
{
struct dosfile *df;
@ -169,13 +169,13 @@ dos_close(struct open_file *f)
return 0;
}
int
__compactcall int
dos_write(struct open_file *f, void *start, size_t size, size_t *resid)
{
return EROFS;
}
int
__compactcall int
dos_stat(struct open_file *f, struct stat *sb)
{
struct dosfile *df;
@ -189,7 +189,7 @@ dos_stat(struct open_file *f, struct stat *sb)
return 0;
}
off_t
__compactcall off_t
dos_seek(struct open_file *f, off_t offset, int where)
{
struct dosfile *df;

View File

@ -1,4 +1,4 @@
/* $NetBSD: getextmemx.c,v 1.9 2008/12/14 17:03:43 christos Exp $ */
/* $NetBSD: getextmemx.c,v 1.10 2011/06/16 13:27:59 joerg Exp $ */
/*
* Copyright (c) 1997, 1999
@ -35,10 +35,6 @@
#include <lib/libsa/stand.h>
#include "libi386.h"
extern int getextmem2(int *);
extern int getmementry(int *, int *);
extern int getextmemps2(void *);
int
getextmemx(void)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: libi386.h,v 1.36 2011/05/26 04:25:27 uebayasi Exp $ */
/* $NetBSD: libi386.h,v 1.37 2011/06/16 13:27:59 joerg Exp $ */
/*
* Copyright (c) 1996
@ -98,30 +98,30 @@ void command_help(char *);
extern const struct bootblk_command commands[];
/* asm bios/dos calls */
int biosdisk_extread(int, void *);
__compactcall int biosdisk_extread(int, void *);
int biosdisk_read(int, int, int, int, int, void *);
int biosdisk_reset(int);
__compactcall int biosdisk_reset(int);
int biosgetrtc(u_long *);
__compactcall int biosgetrtc(u_long *);
int biosgetsystime(void);
int comgetc(int);
void cominit(int);
int computc(int, int);
__compactcall int computc(int, int);
int comstatus(int);
int congetc(void);
int conisshift(void);
int coniskey(void);
void conputc(int);
__compactcall void conputc(int);
void conclr(void);
int getextmem2(int *);
int getextmemps2(void *);
__compactcall int getextmemps2(void *);
int getmementry(int *, int *);
int biosdisk_int13ext(int);
int biosdisk_getinfo(int);
__compactcall int biosdisk_int13ext(int);
__compactcall int biosdisk_getinfo(int);
struct biosdisk_extinfo;
int biosdisk_getextinfo(int, struct biosdisk_extinfo *);
__compactcall int biosdisk_getextinfo(int, struct biosdisk_extinfo *);
int get_harddrives(void);
void biosdisk_probe(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs.c,v 1.17 2009/03/14 21:04:10 dsl Exp $ */
/* $NetBSD: nfs.c,v 1.18 2011/06/16 13:27:59 joerg Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@ -333,7 +333,7 @@ nfs_readdata(struct nfs_iodesc *d, off_t off, void *addr, size_t len)
* Open a file.
* return zero or error number
*/
int
__compactcall int
nfs_open(const char *path, struct open_file *f)
{
static struct nfs_iodesc nfs_root_node;
@ -510,7 +510,7 @@ out:
return (error);
}
int
__compactcall int
nfs_close(struct open_file *f)
{
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
@ -530,7 +530,7 @@ nfs_close(struct open_file *f)
/*
* read a portion of a file
*/
int
__compactcall int
nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid)
/* resid: out */
{
@ -577,7 +577,7 @@ ret:
/*
* Not implemented.
*/
int
__compactcall int
nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid)
/* resid: out */
{
@ -585,7 +585,7 @@ nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid)
return (EROFS);
}
off_t
__compactcall off_t
nfs_seek(struct open_file *f, off_t offset, int where)
{
struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
@ -612,7 +612,7 @@ nfs_seek(struct open_file *f, off_t offset, int where)
const int nfs_stat_types[8] = {
0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, 0 };
int
__compactcall int
nfs_stat(struct open_file *f, struct stat *sb)
{
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;

View File

@ -1,4 +1,4 @@
/* $NetBSD: alloc.c,v 1.24 2010/12/25 01:08:44 jakllsch Exp $ */
/* $NetBSD: alloc.c,v 1.25 2011/06/16 13:27:58 joerg Exp $ */
/*
* Copyright (c) 1993
@ -162,7 +162,7 @@ extern char end[];
static char *top = (char *)HEAP_START;
#endif /* HEAP_VARIABLE */
void *
__compactcall void *
alloc(size_t size)
{
struct fl **f = &freelist, **bestf = NULL;
@ -239,7 +239,7 @@ found:
return help + ALIGN(sizeof(unsigned int));
}
void
__compactcall void
/*ARGSUSED*/
dealloc(void *ptr, size_t size)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd9660.c,v 1.26 2010/10/18 11:08:26 ws Exp $ */
/* $NetBSD: cd9660.c,v 1.27 2011/06/16 13:27:58 joerg Exp $ */
/*
* Copyright (C) 1996 Wolfgang Solfrank.
@ -129,7 +129,7 @@ dirmatch(const char *path, struct iso_directory_record *dp)
return 1;
}
int
__compactcall int
cd9660_open(const char *path, struct open_file *f)
{
struct file *fp = 0;
@ -291,7 +291,7 @@ out:
}
#if !defined(LIBSA_NO_FS_CLOSE)
int
__compactcall int
cd9660_close(struct open_file *f)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -303,7 +303,7 @@ cd9660_close(struct open_file *f)
}
#endif /* !defined(LIBSA_NO_FS_CLOSE) */
int
__compactcall int
cd9660_read(struct open_file *f, void *start, size_t size, size_t *resid)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -354,7 +354,7 @@ cd9660_read(struct open_file *f, void *start, size_t size, size_t *resid)
}
#if !defined(LIBSA_NO_FS_WRITE)
int
__compactcall int
cd9660_write(struct open_file *f, void *start, size_t size, size_t *resid)
{
@ -363,7 +363,7 @@ cd9660_write(struct open_file *f, void *start, size_t size, size_t *resid)
#endif /* !defined(LIBSA_NO_FS_WRITE) */
#if !defined(LIBSA_NO_FS_SEEK)
off_t
__compactcall off_t
cd9660_seek(struct open_file *f, off_t offset, int where)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -385,7 +385,7 @@ cd9660_seek(struct open_file *f, off_t offset, int where)
}
#endif /* !defined(LIBSA_NO_FS_SEEK) */
int
__compactcall int
cd9660_stat(struct open_file *f, struct stat *sb)
{
struct file *fp = (struct file *)f->f_fsdata;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dosfs.c,v 1.16 2008/11/24 11:27:20 ad Exp $ */
/* $NetBSD: dosfs.c,v 1.17 2011/06/16 13:27:58 joerg Exp $ */
/*
* Copyright (c) 1996, 1998 Robert Nordier
@ -218,7 +218,7 @@ dosunmount(DOS_FS *fs)
/*
* Open DOS file
*/
int
__compactcall int
dosfs_open(const char *path, struct open_file *fd)
{
const struct direntry *de;
@ -270,7 +270,7 @@ out:
/*
* Read from file
*/
int
__compactcall int
dosfs_read(struct open_file *fd, void *vbuf, size_t nbyte, size_t *resid)
{
off_t size;
@ -327,7 +327,7 @@ out:
/*
* Not implemented.
*/
int
__compactcall int
dosfs_write(struct open_file *fd, void *start, size_t size, size_t *resid)
{
@ -339,7 +339,7 @@ dosfs_write(struct open_file *fd, void *start, size_t size, size_t *resid)
/*
* Reposition within file
*/
off_t
__compactcall off_t
dosfs_seek(struct open_file *fd, off_t offset, int whence)
{
off_t off;
@ -373,7 +373,7 @@ dosfs_seek(struct open_file *fd, off_t offset, int whence)
/*
* Close open file
*/
int
__compactcall int
dosfs_close(struct open_file *fd)
{
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
@ -389,7 +389,7 @@ dosfs_close(struct open_file *fd)
/*
* Return some stat information on a file.
*/
int
__compactcall int
dosfs_stat(struct open_file *fd, struct stat *sb)
{
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs.c,v 1.9 2011/01/02 21:37:01 jakllsch Exp $ */
/* $NetBSD: ext2fs.c,v 1.10 2011/06/16 13:27:58 joerg Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -485,7 +485,7 @@ read_gdblock(struct open_file *f, struct m_ext2fs *fs)
/*
* Open a file.
*/
int
__compactcall int
ext2fs_open(const char *path, struct open_file *f)
{
#ifndef LIBSA_FS_SINGLECOMPONENT
@ -695,7 +695,7 @@ out:
return rc;
}
int
__compactcall int
ext2fs_close(struct open_file *f)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -718,7 +718,7 @@ ext2fs_close(struct open_file *f)
* Copy a portion of a file into kernel memory.
* Cross block boundaries when necessary.
*/
int
__compactcall int
ext2fs_read(struct open_file *f, void *start, size_t size, size_t *resid)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -756,7 +756,7 @@ ext2fs_read(struct open_file *f, void *start, size_t size, size_t *resid)
* Not implemented.
*/
#ifndef LIBSA_NO_FS_WRITE
int
__compactcall int
ext2fs_write(struct open_file *f, void *start, size_t size, size_t *resid)
{
@ -765,7 +765,7 @@ ext2fs_write(struct open_file *f, void *start, size_t size, size_t *resid)
#endif /* !LIBSA_NO_FS_WRITE */
#ifndef LIBSA_NO_FS_SEEK
off_t
__compactcall off_t
ext2fs_seek(struct open_file *f, off_t offset, int where)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -788,7 +788,7 @@ ext2fs_seek(struct open_file *f, off_t offset, int where)
}
#endif /* !LIBSA_NO_FS_SEEK */
int
__compactcall int
ext2fs_stat(struct open_file *f, struct stat *sb)
{
struct file *fp = (struct file *)f->f_fsdata;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs.c,v 1.45 2009/01/17 14:00:36 tsutsui Exp $ */
/* $NetBSD: nfs.c,v 1.46 2011/06/16 13:27:58 joerg Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@ -382,7 +382,7 @@ nfs_mount(int sock, struct in_addr ip, char *path)
* Open a file.
* return zero or error number
*/
int
__compactcall int
nfs_open(const char *path, struct open_file *f)
{
struct nfs_iodesc *newfd, *currfd;
@ -537,7 +537,7 @@ out:
return error;
}
int
__compactcall int
nfs_close(struct open_file *f)
{
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
@ -557,7 +557,7 @@ nfs_close(struct open_file *f)
/*
* read a portion of a file
*/
int
__compactcall int
nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid)
{
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
@ -604,13 +604,13 @@ ret:
/*
* Not implemented.
*/
int
__compactcall int
nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid)
{
return EROFS;
}
off_t
__compactcall off_t
nfs_seek(struct open_file *f, off_t offset, int where)
{
struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
@ -637,7 +637,7 @@ nfs_seek(struct open_file *f, off_t offset, int where)
const int nfs_stat_types[8] = {
0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, 0 };
int
__compactcall int
nfs_stat(struct open_file *f, struct stat *sb)
{
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nullfs.c,v 1.9 2005/12/11 12:24:46 christos Exp $ */
/* $NetBSD: nullfs.c,v 1.10 2011/06/16 13:27:58 joerg Exp $ */
/*-
* Copyright (c) 1993
@ -66,7 +66,7 @@
* Null filesystem
*/
int
__compactcall int
null_open(const char *path, struct open_file *f)
{
@ -74,7 +74,7 @@ null_open(const char *path, struct open_file *f)
}
#ifndef LIBSA_NO_FS_CLOSE
int
__compactcall int
null_close(struct open_file *f)
{
@ -82,7 +82,7 @@ null_close(struct open_file *f)
}
#endif
int
__compactcall int
null_read(struct open_file *f, void *buf, size_t size, size_t *resid)
{
@ -90,7 +90,7 @@ null_read(struct open_file *f, void *buf, size_t size, size_t *resid)
}
#ifndef LIBSA_NO_FS_WRITE
int
__compactcall int
null_write(struct open_file *f, void *buf, size_t size, size_t *resid)
{
@ -99,7 +99,7 @@ null_write(struct open_file *f, void *buf, size_t size, size_t *resid)
#endif
#ifndef LIBSA_NO_FS_SEEK
off_t
__compactcall off_t
null_seek(struct open_file *f, off_t offset, int where)
{
@ -107,7 +107,7 @@ null_seek(struct open_file *f, off_t offset, int where)
}
#endif
int
__compactcall int
null_stat(struct open_file *f, struct stat *sb)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: tftp.c,v 1.31 2011/05/11 16:23:40 zoltan Exp $ */
/* $NetBSD: tftp.c,v 1.32 2011/06/16 13:27:58 joerg Exp $ */
/*
* Copyright (c) 1996
@ -248,7 +248,7 @@ tftp_terminate(struct tftp_handle *h)
}
#endif
int
__compactcall int
tftp_open(const char *path, struct open_file *f)
{
struct tftp_handle *tftpfile;
@ -275,7 +275,7 @@ tftp_open(const char *path, struct open_file *f)
return 0;
}
int
__compactcall int
tftp_read(struct open_file *f, void *addr, size_t size, size_t *resid)
{
struct tftp_handle *tftpfile;
@ -356,7 +356,7 @@ tftp_read(struct open_file *f, void *addr, size_t size, size_t *resid)
return 0;
}
int
__compactcall int
tftp_close(struct open_file *f)
{
struct tftp_handle *tftpfile;
@ -372,7 +372,7 @@ tftp_close(struct open_file *f)
return 0;
}
int
__compactcall int
tftp_write(struct open_file *f, void *start, size_t size, size_t *resid)
{
@ -415,7 +415,7 @@ tftp_size_of_file(struct tftp_handle *tftpfile)
return filesize;
}
int
__compactcall int
tftp_stat(struct open_file *f, struct stat *sb)
{
struct tftp_handle *tftpfile;
@ -429,7 +429,7 @@ tftp_stat(struct open_file *f, struct stat *sb)
return 0;
}
off_t
__compactcall off_t
tftp_seek(struct open_file *f, off_t offset, int where)
{
struct tftp_handle *tftpfile;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs.c,v 1.54 2008/11/19 12:36:41 ad Exp $ */
/* $NetBSD: ufs.c,v 1.55 2011/06/16 13:27:58 joerg Exp $ */
/*-
* Copyright (c) 1993
@ -513,7 +513,7 @@ ffs_find_superblock(struct open_file *f, struct fs *fs)
/*
* Open a file.
*/
int
__compactcall int
ufs_open(const char *path, struct open_file *f)
{
#ifndef LIBSA_FS_SINGLECOMPONENT
@ -750,7 +750,7 @@ out:
return rc;
}
int
__compactcall int
ufs_close(struct open_file *f)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -770,7 +770,7 @@ ufs_close(struct open_file *f)
* Copy a portion of a file into kernel memory.
* Cross block boundaries when necessary.
*/
int
__compactcall int
ufs_read(struct open_file *f, void *start, size_t size, size_t *resid)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -807,7 +807,7 @@ ufs_read(struct open_file *f, void *start, size_t size, size_t *resid)
* Not implemented.
*/
#ifndef LIBSA_NO_FS_WRITE
int
__compactcall int
ufs_write(struct open_file *f, void *start, size_t size, size_t *resid)
{
@ -816,7 +816,7 @@ ufs_write(struct open_file *f, void *start, size_t size, size_t *resid)
#endif /* !LIBSA_NO_FS_WRITE */
#ifndef LIBSA_NO_FS_SEEK
off_t
__compactcall off_t
ufs_seek(struct open_file *f, off_t offset, int where)
{
struct file *fp = (struct file *)f->f_fsdata;
@ -838,7 +838,7 @@ ufs_seek(struct open_file *f, off_t offset, int where)
}
#endif /* !LIBSA_NO_FS_SEEK */
int
__compactcall int
ufs_stat(struct open_file *f, struct stat *sb)
{
struct file *fp = (struct file *)f->f_fsdata;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ustarfs.c,v 1.32 2009/01/17 14:00:36 tsutsui Exp $ */
/* $NetBSD: ustarfs.c,v 1.33 2011/06/16 13:27:58 joerg Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@ -381,7 +381,7 @@ init_volzero_sig(struct open_file *f)
return 0;
}
int
__compactcall int
ustarfs_open(const char *path, struct open_file *f)
{
ust_active_t *ustf;
@ -442,7 +442,7 @@ ustarfs_open(const char *path, struct open_file *f)
}
#ifndef LIBSA_NO_FS_WRITE
int
__compactcall int
ustarfs_write(struct open_file *f, void *start, size_t size, size_t *resid)
{
@ -451,7 +451,7 @@ ustarfs_write(struct open_file *f, void *start, size_t size, size_t *resid)
#endif /* !LIBSA_NO_FS_WRITE */
#ifndef LIBSA_NO_FS_SEEK
off_t
__compactcall off_t
ustarfs_seek(struct open_file *f, off_t offs, int whence)
{
ust_active_t *ustf;
@ -474,7 +474,7 @@ ustarfs_seek(struct open_file *f, off_t offs, int whence)
}
#endif /* !LIBSA_NO_FS_SEEK */
int
__compactcall int
ustarfs_read(struct open_file *f, void *start, size_t size, size_t *resid)
{
ust_active_t *ustf;
@ -517,7 +517,7 @@ ustarfs_read(struct open_file *f, void *start, size_t size, size_t *resid)
return e;
}
int
__compactcall int
ustarfs_stat(struct open_file *f, struct stat *sb)
{
int mode, uid, gid;
@ -538,7 +538,7 @@ ustarfs_stat(struct open_file *f, struct stat *sb)
}
#ifndef LIBSA_NO_FS_CLOSE
int
__compactcall int
ustarfs_close(struct open_file *f)
{
if (f == NULL || f->f_fsdata == NULL)