* Enable old UFS compatibility code for booting from Digital Unix formatted

disks.
* Fix a whole raft of warnings, printf and otherwise.
* Make zalloc work for alpha (just a case of using the right typedef).
* Add some (disabled) malloc debug printing to stand.h.
This commit is contained in:
Doug Rabson 1998-09-26 10:48:50 +00:00
parent 7cff8977ca
commit f069bf5a2c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39672
6 changed files with 46 additions and 7 deletions

View File

@ -85,7 +85,7 @@ open(const char *fname, int mode)
{
struct open_file *f;
int fd, i, error, besterror;
char *file;
const char *file;
if ((fd = o_gethandle()) == -1) {
errno = EMFILE;

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: stand.h,v 1.4 1998/09/18 23:00:57 msmith Exp $
* $Id: stand.h,v 1.5 1998/09/26 01:42:39 msmith Exp $
* From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $
*/
@ -215,6 +215,7 @@ extern u_long random(void);
/* imports from stdlib, locally modified */
extern long strtol(const char *, char **, int);
extern char * strerror(int err);
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;
extern int getopt(int, char * const [], const char *);
@ -303,9 +304,32 @@ extern int null_stat(struct open_file *f, struct stat *sb);
extern int getchar(void);
extern int ischar(void);
extern void putchar(int);
extern int devopen(struct open_file *, const char *, char **);
extern int devopen(struct open_file *, const char *, const char **);
extern int devclose(struct open_file *f);
extern void panic(const char *, ...) __dead2;
extern struct fs_ops *file_system[];
extern struct devsw *devsw[];
#if 0
static inline void *
malloc_debug(size_t size, const char *file, int line)
{
void *p;
printf("%s:%d malloc(%ld)", file, line, size);
p = malloc(size);
printf("=%p\n", p);
return p;
}
static inline void
free_debug(void *p, const char *file, int line)
{
printf("%s:%d free(%p)\n", file, line, p);
free(p);
}
#define malloc(x) malloc_debug(x, __FILE__, __LINE__)
#define free(x) free_debug(x, __FILE__, __LINE__)
#endif

View File

@ -74,6 +74,10 @@
#include "stand.h"
#include "string.h"
#ifdef __alpha__
#define COMPAT_UFS /* DUX has old format file systems */
#endif
static int ufs_open(const char *path, struct open_file *f);
static int ufs_close(struct open_file *f);
static int ufs_read(struct open_file *f, void *buf, size_t size, size_t *resid);

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: zalloc.c,v 1.1 1998/09/26 01:42:39 msmith Exp $
* $Id: zalloc.c,v 1.2 1998/09/26 03:24:14 dillon Exp $
*/
/*
@ -564,7 +564,7 @@ zallocstats(MemPool *mp)
int fcount = 0;
MemNode *mn;
printf("Pool %s, %d bytes reserved", mp->mp_Ident, mp->mp_Size);
printf("Pool %s, %d bytes reserved", mp->mp_Ident, (int) mp->mp_Size);
mn = mp->mp_First;

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: zalloc_defs.h,v 1.1 1998/09/26 01:42:39 msmith Exp $
*/
/*
@ -43,8 +43,14 @@
#include <string.h>
#include "stand.h"
#ifdef __i386__
typedef unsigned int iaddr_t; /* unsigned int same size as pointer */
typedef int saddr_t; /* signed int same size as pointer */
#endif
#ifdef __alpha__
typedef unsigned long iaddr_t; /* unsigned int same size as pointer */
typedef long saddr_t; /* signed int same size as pointer */
#endif
#include "zalloc_mem.h"

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: zalloc_malloc.c,v 1.1 1998/09/26 01:42:39 msmith Exp $
*/
/*
@ -44,6 +44,11 @@ static int MallocCount;
void mallocstats(void);
#endif
#ifdef malloc
#undef malloc
#undef free
#endif
void *
malloc(size_t bytes)
{