Module Name: src Committed By: joerg Date: Thu Jun 16 13:27:59 UTC 2011
Modified Files: src/sys/arch/i386/include: cdefs.h src/sys/arch/i386/stand/lib: bios_disk.S biosgetrtc.S biosgetsystime.S biosmem.S biosmemps2.S biosreboot.S conio.S dosfile.c getextmemx.c libi386.h src/sys/arch/i386/stand/libsa: nfs.c src/sys/lib/libsa: alloc.c cd9660.c dosfs.c ext2fs.c nfs.c nullfs.c tftp.c ufs.c ustarfs.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/include/cdefs.h cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/stand/lib/bios_disk.S cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/lib/biosgetrtc.S \ src/sys/arch/i386/stand/lib/conio.S cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/lib/biosgetsystime.S cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/lib/biosmem.S cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/lib/biosmemps2.S cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/lib/biosreboot.S cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/stand/lib/dosfile.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/getextmemx.c cvs rdiff -u -r1.36 -r1.37 src/sys/arch/i386/stand/lib/libi386.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/stand/libsa/nfs.c cvs rdiff -u -r1.24 -r1.25 src/sys/lib/libsa/alloc.c cvs rdiff -u -r1.26 -r1.27 src/sys/lib/libsa/cd9660.c cvs rdiff -u -r1.16 -r1.17 src/sys/lib/libsa/dosfs.c cvs rdiff -u -r1.9 -r1.10 src/sys/lib/libsa/ext2fs.c \ src/sys/lib/libsa/nullfs.c cvs rdiff -u -r1.45 -r1.46 src/sys/lib/libsa/nfs.c cvs rdiff -u -r1.31 -r1.32 src/sys/lib/libsa/tftp.c cvs rdiff -u -r1.54 -r1.55 src/sys/lib/libsa/ufs.c cvs rdiff -u -r1.32 -r1.33 src/sys/lib/libsa/ustarfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/i386/include/cdefs.h diff -u src/sys/arch/i386/include/cdefs.h:1.7 src/sys/arch/i386/include/cdefs.h:1.8 --- src/sys/arch/i386/include/cdefs.h:1.7 Sun Oct 26 06:57:30 2008 +++ src/sys/arch/i386/include/cdefs.h Thu Jun 16 13:27:59 2011 @@ -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_ */ Index: src/sys/arch/i386/stand/lib/bios_disk.S diff -u src/sys/arch/i386/stand/lib/bios_disk.S:1.20 src/sys/arch/i386/stand/lib/bios_disk.S:1.21 --- src/sys/arch/i386/stand/lib/bios_disk.S:1.20 Wed Dec 29 22:40:46 2010 +++ src/sys/arch/i386/stand/lib/bios_disk.S Thu Jun 16 13:27:59 2011 @@ -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 (jul...@tfs.com) Sept 1992 @@ -63,13 +63,9 @@ * %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 @@ .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 @@ * 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 @@ 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 @@ * 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 @@ 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 @@ * 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 @@ 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 @@ * %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 @@ .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 @@ .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 Index: src/sys/arch/i386/stand/lib/biosgetrtc.S diff -u src/sys/arch/i386/stand/lib/biosgetrtc.S:1.6 src/sys/arch/i386/stand/lib/biosgetrtc.S:1.7 --- src/sys/arch/i386/stand/lib/biosgetrtc.S:1.6 Sun Dec 11 12:17:48 2005 +++ src/sys/arch/i386/stand/lib/biosgetrtc.S Thu Jun 16 13:27:59 2011 @@ -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 @@ 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 Index: src/sys/arch/i386/stand/lib/conio.S diff -u src/sys/arch/i386/stand/lib/conio.S:1.6 src/sys/arch/i386/stand/lib/conio.S:1.7 --- src/sys/arch/i386/stand/lib/conio.S:1.6 Wed May 21 01:51:34 2008 +++ src/sys/arch/i386/stand/lib/conio.S Thu Jun 16 13:27:59 2011 @@ -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 @@ 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 @@ 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 @@ 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 @@ 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 Index: src/sys/arch/i386/stand/lib/biosgetsystime.S diff -u src/sys/arch/i386/stand/lib/biosgetsystime.S:1.2 src/sys/arch/i386/stand/lib/biosgetsystime.S:1.3 --- src/sys/arch/i386/stand/lib/biosgetsystime.S:1.2 Mon Apr 28 20:23:25 2008 +++ src/sys/arch/i386/stand/lib/biosgetsystime.S Thu Jun 16 13:27:59 2011 @@ -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 @@ 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 Index: src/sys/arch/i386/stand/lib/biosmem.S diff -u src/sys/arch/i386/stand/lib/biosmem.S:1.8 src/sys/arch/i386/stand/lib/biosmem.S:1.9 --- src/sys/arch/i386/stand/lib/biosmem.S:1.8 Sun Dec 11 12:17:48 2005 +++ src/sys/arch/i386/stand/lib/biosmem.S Thu Jun 16 13:27:59 2011 @@ -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 @@ 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 Index: src/sys/arch/i386/stand/lib/biosmemps2.S diff -u src/sys/arch/i386/stand/lib/biosmemps2.S:1.5 src/sys/arch/i386/stand/lib/biosmemps2.S:1.6 --- src/sys/arch/i386/stand/lib/biosmemps2.S:1.5 Sun Feb 20 05:45:48 2011 +++ src/sys/arch/i386/stand/lib/biosmemps2.S Thu Jun 16 13:27:59 2011 @@ -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 @@ 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 Index: src/sys/arch/i386/stand/lib/biosreboot.S diff -u src/sys/arch/i386/stand/lib/biosreboot.S:1.4 src/sys/arch/i386/stand/lib/biosreboot.S:1.5 --- src/sys/arch/i386/stand/lib/biosreboot.S:1.4 Sun Dec 11 12:17:48 2005 +++ src/sys/arch/i386/stand/lib/biosreboot.S Thu Jun 16 13:27:59 2011 @@ -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 @@ calll _C_LABEL(real_to_prot) .code32 - movl %ebx, %eax - - pop %edi - pop %esi - popl %ebx - popl %ebp + movl %ebx, 28(%esp) + popa ret Index: src/sys/arch/i386/stand/lib/dosfile.c diff -u src/sys/arch/i386/stand/lib/dosfile.c:1.14 src/sys/arch/i386/stand/lib/dosfile.c:1.15 --- src/sys/arch/i386/stand/lib/dosfile.c:1.14 Sun Dec 14 17:03:43 2008 +++ src/sys/arch/i386/stand/lib/dosfile.c Thu Jun 16 13:27:59 2011 @@ -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 @@ return err; } -int +__compactcall int dos_open(const char *path, struct open_file *f) { struct dosfile *df; @@ -94,7 +94,7 @@ 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 @@ return 0; } -int +__compactcall int dos_close(struct open_file *f) { struct dosfile *df; @@ -169,13 +169,13 @@ 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 @@ return 0; } -off_t +__compactcall off_t dos_seek(struct open_file *f, off_t offset, int where) { struct dosfile *df; Index: src/sys/arch/i386/stand/lib/getextmemx.c diff -u src/sys/arch/i386/stand/lib/getextmemx.c:1.9 src/sys/arch/i386/stand/lib/getextmemx.c:1.10 --- src/sys/arch/i386/stand/lib/getextmemx.c:1.9 Sun Dec 14 17:03:43 2008 +++ src/sys/arch/i386/stand/lib/getextmemx.c Thu Jun 16 13:27:59 2011 @@ -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) { Index: src/sys/arch/i386/stand/lib/libi386.h diff -u src/sys/arch/i386/stand/lib/libi386.h:1.36 src/sys/arch/i386/stand/lib/libi386.h:1.37 --- src/sys/arch/i386/stand/lib/libi386.h:1.36 Thu May 26 04:25:27 2011 +++ src/sys/arch/i386/stand/lib/libi386.h Thu Jun 16 13:27:59 2011 @@ -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 @@ 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); Index: src/sys/arch/i386/stand/libsa/nfs.c diff -u src/sys/arch/i386/stand/libsa/nfs.c:1.17 src/sys/arch/i386/stand/libsa/nfs.c:1.18 --- src/sys/arch/i386/stand/libsa/nfs.c:1.17 Sat Mar 14 21:04:10 2009 +++ src/sys/arch/i386/stand/libsa/nfs.c Thu Jun 16 13:27:59 2011 @@ -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 @@ * 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 @@ 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 @@ /* * 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 @@ /* * 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 @@ 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 @@ 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; Index: src/sys/lib/libsa/alloc.c diff -u src/sys/lib/libsa/alloc.c:1.24 src/sys/lib/libsa/alloc.c:1.25 --- src/sys/lib/libsa/alloc.c:1.24 Sat Dec 25 01:08:44 2010 +++ src/sys/lib/libsa/alloc.c Thu Jun 16 13:27:58 2011 @@ -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 @@ 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 @@ return help + ALIGN(sizeof(unsigned int)); } -void +__compactcall void /*ARGSUSED*/ dealloc(void *ptr, size_t size) { Index: src/sys/lib/libsa/cd9660.c diff -u src/sys/lib/libsa/cd9660.c:1.26 src/sys/lib/libsa/cd9660.c:1.27 --- src/sys/lib/libsa/cd9660.c:1.26 Mon Oct 18 11:08:26 2010 +++ src/sys/lib/libsa/cd9660.c Thu Jun 16 13:27:58 2011 @@ -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 @@ return 1; } -int +__compactcall int cd9660_open(const char *path, struct open_file *f) { struct file *fp = 0; @@ -291,7 +291,7 @@ } #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 @@ } #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 @@ } #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 @@ #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 @@ } #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; Index: src/sys/lib/libsa/dosfs.c diff -u src/sys/lib/libsa/dosfs.c:1.16 src/sys/lib/libsa/dosfs.c:1.17 --- src/sys/lib/libsa/dosfs.c:1.16 Mon Nov 24 11:27:20 2008 +++ src/sys/lib/libsa/dosfs.c Thu Jun 16 13:27:58 2011 @@ -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 @@ /* * Open DOS file */ -int +__compactcall int dosfs_open(const char *path, struct open_file *fd) { const struct direntry *de; @@ -270,7 +270,7 @@ /* * 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 @@ /* * Not implemented. */ -int +__compactcall int dosfs_write(struct open_file *fd, void *start, size_t size, size_t *resid) { @@ -339,7 +339,7 @@ /* * 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 @@ /* * Close open file */ -int +__compactcall int dosfs_close(struct open_file *fd) { DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; @@ -389,7 +389,7 @@ /* * 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; Index: src/sys/lib/libsa/ext2fs.c diff -u src/sys/lib/libsa/ext2fs.c:1.9 src/sys/lib/libsa/ext2fs.c:1.10 --- src/sys/lib/libsa/ext2fs.c:1.9 Sun Jan 2 21:37:01 2011 +++ src/sys/lib/libsa/ext2fs.c Thu Jun 16 13:27:58 2011 @@ -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 @@ /* * Open a file. */ -int +__compactcall int ext2fs_open(const char *path, struct open_file *f) { #ifndef LIBSA_FS_SINGLECOMPONENT @@ -695,7 +695,7 @@ return rc; } -int +__compactcall int ext2fs_close(struct open_file *f) { struct file *fp = (struct file *)f->f_fsdata; @@ -718,7 +718,7 @@ * 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 @@ * 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 @@ #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 @@ } #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; Index: src/sys/lib/libsa/nullfs.c diff -u src/sys/lib/libsa/nullfs.c:1.9 src/sys/lib/libsa/nullfs.c:1.10 --- src/sys/lib/libsa/nullfs.c:1.9 Sun Dec 11 12:24:46 2005 +++ src/sys/lib/libsa/nullfs.c Thu Jun 16 13:27:58 2011 @@ -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 @@ } #ifndef LIBSA_NO_FS_CLOSE -int +__compactcall int null_close(struct open_file *f) { @@ -82,7 +82,7 @@ } #endif -int +__compactcall int null_read(struct open_file *f, void *buf, size_t size, size_t *resid) { @@ -90,7 +90,7 @@ } #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 @@ #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 @@ } #endif -int +__compactcall int null_stat(struct open_file *f, struct stat *sb) { Index: src/sys/lib/libsa/nfs.c diff -u src/sys/lib/libsa/nfs.c:1.45 src/sys/lib/libsa/nfs.c:1.46 --- src/sys/lib/libsa/nfs.c:1.45 Sat Jan 17 14:00:36 2009 +++ src/sys/lib/libsa/nfs.c Thu Jun 16 13:27:58 2011 @@ -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 @@ * 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 @@ 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 @@ /* * 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 @@ /* * 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 @@ 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; Index: src/sys/lib/libsa/tftp.c diff -u src/sys/lib/libsa/tftp.c:1.31 src/sys/lib/libsa/tftp.c:1.32 --- src/sys/lib/libsa/tftp.c:1.31 Wed May 11 16:23:40 2011 +++ src/sys/lib/libsa/tftp.c Thu Jun 16 13:27:58 2011 @@ -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 @@ } #endif -int +__compactcall int tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; @@ -275,7 +275,7 @@ 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 @@ return 0; } -int +__compactcall int tftp_close(struct open_file *f) { struct tftp_handle *tftpfile; @@ -372,7 +372,7 @@ return 0; } -int +__compactcall int tftp_write(struct open_file *f, void *start, size_t size, size_t *resid) { @@ -415,7 +415,7 @@ return filesize; } -int +__compactcall int tftp_stat(struct open_file *f, struct stat *sb) { struct tftp_handle *tftpfile; @@ -429,7 +429,7 @@ return 0; } -off_t +__compactcall off_t tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; Index: src/sys/lib/libsa/ufs.c diff -u src/sys/lib/libsa/ufs.c:1.54 src/sys/lib/libsa/ufs.c:1.55 --- src/sys/lib/libsa/ufs.c:1.54 Wed Nov 19 12:36:41 2008 +++ src/sys/lib/libsa/ufs.c Thu Jun 16 13:27:58 2011 @@ -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 @@ /* * Open a file. */ -int +__compactcall int ufs_open(const char *path, struct open_file *f) { #ifndef LIBSA_FS_SINGLECOMPONENT @@ -750,7 +750,7 @@ return rc; } -int +__compactcall int ufs_close(struct open_file *f) { struct file *fp = (struct file *)f->f_fsdata; @@ -770,7 +770,7 @@ * 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 @@ * 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 @@ #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 @@ } #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; Index: src/sys/lib/libsa/ustarfs.c diff -u src/sys/lib/libsa/ustarfs.c:1.32 src/sys/lib/libsa/ustarfs.c:1.33 --- src/sys/lib/libsa/ustarfs.c:1.32 Sat Jan 17 14:00:36 2009 +++ src/sys/lib/libsa/ustarfs.c Thu Jun 16 13:27:58 2011 @@ -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 @@ return 0; } -int +__compactcall int ustarfs_open(const char *path, struct open_file *f) { ust_active_t *ustf; @@ -442,7 +442,7 @@ } #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 @@ #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 @@ } #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 @@ return e; } -int +__compactcall int ustarfs_stat(struct open_file *f, struct stat *sb) { int mode, uid, gid; @@ -538,7 +538,7 @@ } #ifndef LIBSA_NO_FS_CLOSE -int +__compactcall int ustarfs_close(struct open_file *f) { if (f == NULL || f->f_fsdata == NULL)