Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add an optional MD calling convention flag for use in li...
details: https://anonhg.NetBSD.org/src/rev/d8f1788e8d7f
branches: trunk
changeset: 766129:d8f1788e8d7f
user: joerg <joerg%NetBSD.org@localhost>
date: Thu Jun 16 13:44:56 2011 +0000
description:
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.
diffstat:
sys/lib/libsa/stand.h | 30 +++++++++++++++---------------
sys/sys/cdefs.h | 9 ++++++++-
2 files changed, 23 insertions(+), 16 deletions(-)
diffs (83 lines):
diff -r 106e061a8298 -r d8f1788e8d7f sys/lib/libsa/stand.h
--- a/sys/lib/libsa/stand.h Thu Jun 16 13:27:58 2011 +0000
+++ b/sys/lib/libsa/stand.h Thu Jun 16 13:44:56 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: stand.h,v 1.71 2011/02/25 00:17:36 joerg Exp $ */
+/* $NetBSD: stand.h,v 1.72 2011/06/16 13:44:56 joerg Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -87,14 +87,14 @@
struct open_file;
#define FS_DEF(fs) \
- extern int __CONCAT(fs,_open)(const char *, struct open_file *); \
- extern int __CONCAT(fs,_close)(struct open_file *); \
- extern int __CONCAT(fs,_read)(struct open_file *, void *, \
+ extern __compactcall int __CONCAT(fs,_open)(const char *, struct open_file *); \
+ extern __compactcall int __CONCAT(fs,_close)(struct open_file *); \
+ extern __compactcall int __CONCAT(fs,_read)(struct open_file *, void *, \
size_t, size_t *); \
- extern int __CONCAT(fs,_write)(struct open_file *, void *, \
+ extern __compactcall int __CONCAT(fs,_write)(struct open_file *, void *, \
size_t, size_t *); \
- extern off_t __CONCAT(fs,_seek)(struct open_file *, off_t, int); \
- extern int __CONCAT(fs,_stat)(struct open_file *, struct stat *)
+ extern __compactcall off_t __CONCAT(fs,_seek)(struct open_file *, off_t, int); \
+ extern __compactcall int __CONCAT(fs,_stat)(struct open_file *, struct stat *)
/*
* This structure is used to define file system operations in a file system
@@ -105,12 +105,12 @@
#if !defined(LIBSA_SINGLE_FILESYSTEM)
struct fs_ops {
- int (*open)(const char *, struct open_file *);
- int (*close)(struct open_file *);
- int (*read)(struct open_file *, void *, size_t, size_t *);
- int (*write)(struct open_file *, void *, size_t size, size_t *);
- off_t (*seek)(struct open_file *, off_t, int);
- int (*stat)(struct open_file *, struct stat *);
+ __compactcall int (*open)(const char *, struct open_file *);
+ __compactcall int (*close)(struct open_file *);
+ __compactcall int (*read)(struct open_file *, void *, size_t, size_t *);
+ __compactcall int (*write)(struct open_file *, void *, size_t size, size_t *);
+ __compactcall off_t (*seek)(struct open_file *, off_t, int);
+ __compactcall int (*stat)(struct open_file *, struct stat *);
};
extern struct fs_ops file_system[];
@@ -215,8 +215,8 @@
#ifdef HEAP_VARIABLE
void setheap(void *, void *);
#endif
-void *alloc(size_t);
-void dealloc(void *, size_t);
+void *alloc(size_t) __compactcall;
+void dealloc(void *, size_t) __compactcall;
struct disklabel;
char *getdisklabel(const char *, struct disklabel *);
int dkcksum(const struct disklabel *);
diff -r 106e061a8298 -r d8f1788e8d7f sys/sys/cdefs.h
--- a/sys/sys/cdefs.h Thu Jun 16 13:27:58 2011 +0000
+++ b/sys/sys/cdefs.h Thu Jun 16 13:44:56 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.84 2011/02/19 02:21:21 matt Exp $ */
+/* $NetBSD: cdefs.h,v 1.85 2011/06/16 13:51:26 joerg Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -64,6 +64,13 @@
#endif
/*
+ * Optional marker for size-optimised MD calling convention.
+ */
+#ifndef __compactcall
+#define __compactcall
+#endif
+
+/*
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
* The __CONCAT macro is a bit tricky -- make sure you don't put spaces
Home |
Main Index |
Thread Index |
Old Index