#include "scsi.h"
#include "uaenative.h"
#include "tabletlibrary.h"
+#include "cia.h"
+#include "picasso96.h"
#include "cpuboard.h"
#include "rommgr.h"
#ifdef RETROPLATFORM
nvol = my_strdup (p + i);
}
if (!nvol && archivehd >= 0) {
- TCHAR *s = NULL;
if (volname && _tcslen (volname) > 0)
nvol = my_strdup (volname);
else
return 1;
}
-
-void filesys_addexternals (void);
-
static void allocuci (struct uae_prefs *p, int nr, int idx, int unitnum)
{
struct uaedev_config_data *uci = &p->mountconfig[nr];
/* ExKeys */
ExamineKey examine_keys[EXKEYS];
int next_exkey;
- unsigned long total_locked_ainos;
+ unsigned int total_locked_ainos;
/* ExAll */
ExAllKey exalls[EXALLKEYS];
struct lockrecord *waitingrecords;
a_inode rootnode;
- unsigned long aino_cache_size;
+ unsigned int aino_cache_size;
a_inode *aino_hash[MAX_AINO_HASH];
- unsigned long nr_cache_hits;
- unsigned long nr_cache_lookups;
+ unsigned int nr_cache_hits;
+ unsigned int nr_cache_lookups;
struct notify *notifyhash[NOTIFY_HASH_SIZE];
return 0;
}
+#if 0
int hardfile_remount (int nr)
{
/* this does work but every media reinsert duplicates the device.. */
#endif
return 1;
}
-
+#endif
bool filesys_do_disk_change (int cdunitnum, bool insert)
{
/* Still in use */
return;
- TRACE3((_T("Recycling; cache size %d, total_locked %d\n"),
+ TRACE3((_T("Recycling; cache size %u, total_locked %d\n"),
unit->aino_cache_size, unit->total_locked_ainos));
if (unit->aino_cache_size > 5000 + unit->total_locked_ainos) {
/* Reap a few. */
static TCHAR *get_nname (Unit *unit, a_inode *base, TCHAR *rel, TCHAR **modified_rel, uae_u64 *uniq_ext)
{
TCHAR *found;
- TCHAR *p = 0;
*modified_rel = 0;
dumplock (Unit *unit, uaecptr lock)
{
a_inode *a;
- TRACE((_T("LOCK: 0x%lx"), lock));
+ TRACE((_T("LOCK: 0x%x"), lock));
if (!lock) {
TRACE((_T("\n")));
return;
}
- TRACE((_T("{ next=0x%lx, mode=%ld, handler=0x%lx, volume=0x%lx, aino %lx "),
+ TRACE((_T("{ next=0x%x, mode=%d, handler=0x%x, volume=0x%x, aino %x "),
get_long (lock) << 2, get_long (lock + 8),
get_long (lock + 12), get_long (lock + 16),
get_long (lock + 4)));
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
uaecptr name = GET_PCK_ARG2 (packet) << 2;
- long mode = GET_PCK_ARG3 (packet);
+ int mode = GET_PCK_ARG3 (packet);
a_inode *a;
int err;
for (Unit *u = units; u; u = u->next) {
if (u->volflags & (MYVOLUMEINFO_ARCHIVE | MYVOLUMEINFO_CDFS))
continue;
- a3 = find_aino (u, NULL, link, &err);
+ a3 = find_aino (u, 0, link, &err);
if (err || !a3)
continue;
_tcscpy (tmp2, a1->nname);
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
a_inode *a;
- TRACE((_T("ACTION_FREE_LOCK(0x%lx)\n"), lock));
+ TRACE((_T("ACTION_FREE_LOCK(0x%x)\n"), lock));
DUMPLOCK(unit, lock);
a = aino_from_lock (unit, lock);
action_dup_lock (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
- TRACE((_T("ACTION_DUP_LOCK(0x%lx)\n"), lock));
+ TRACE((_T("ACTION_DUP_LOCK(0x%x)\n"), lock));
if (!lock) {
PUT_PCK_RES1 (packet, 0);
return;
action_lock_from_fh (Unit *unit, dpacket packet)
{
Key *k = lookup_key (unit, GET_PCK_ARG1 (packet));
- TRACE((_T("ACTION_COPY_DIR_FH(0x%lx,'%s')\n"), GET_PCK_ARG1 (packet), k ? k->aino->aname : _T("<null>")));
+ TRACE((_T("ACTION_COPY_DIR_FH(0x%x,'%s')\n"), GET_PCK_ARG1 (packet), k ? k->aino->aname : _T("<null>")));
if (k == 0) {
PUT_PCK_RES1 (packet, DOS_FALSE);
return;
static bool get_statinfo(Unit *unit, a_inode *aino, struct mystat *statbuf)
{
bool ok = true;
- memset (statbuf, 0, sizeof statbuf);
+ memset (statbuf, 0, sizeof(struct mystat));
/* No error checks - this had better work. */
if (unit->volflags & MYVOLUMEINFO_ARCHIVE)
ok = zfile_stat_archive (aino->nname, statbuf) != 0;
int i, n, entrytype, blocksize;
uae_s64 numblocks;
int fsdb_can = fsdb_cando (unit);
- TCHAR *xs;
+ const TCHAR *xs;
char *x, *x2;
if (aino->vfso) {
prev->next = lr->next;
else
unit->waitingrecords = lr->next;
- write_log (_T("queued record released '%s',%d,%d,%d,%d\n"), k->aino->nname, lr->pos, lr->len, lr->mode, lr->timeout);
+ write_log (_T("queued record released '%s',%llud,%llu,%d,%d\n"), k->aino->nname, lr->pos, lr->len, lr->mode, lr->timeout);
// mark packet as complete
put_long (lr->msg + 4, 0xffffffff);
xfree (lr);
int i;
int size, size2;
int entrytype;
- TCHAR *xs = NULL, *commentx = NULL;
+ const TCHAR *xs = NULL, *commentx = NULL;
uae_u32 flags = 15;
int days, mins, ticks;
struct mystat statbuf;
uaecptr info = GET_PCK_ARG2 (packet) << 2;
a_inode *aino = 0;
- TRACE((_T("ACTION_EXAMINE_OBJECT(0x%lx,0x%lx)\n"), lock, info));
+ TRACE((_T("ACTION_EXAMINE_OBJECT(0x%x,0x%x)\n"), lock, info));
DUMPLOCK(unit, lock);
if (lock != 0)
a_inode *aino = 0, *daino = 0;
uae_u32 uniq;
- TRACE((_T("ACTION_EXAMINE_NEXT(0x%lx,0x%lx,%d)\n"), lock, info, largefilesize));
+ TRACE((_T("ACTION_EXAMINE_NEXT(0x%x,0x%x,%d)\n"), lock, info, largefilesize));
gui_flicker_led (UNIT_LED(unit), unit->unit, 1);
DUMPLOCK(unit, lock);
: O_RDWR)
| (create ? O_CREAT : 0)
| (create == 2 ? O_TRUNC : 0));
-
+
fd = fs_openfile (unit, aino, openmode | O_BINARY);
if (fd == NULL) {
if (aino_created)
mode_t openmode;
int mode;
- TRACE((_T("ACTION_FH_FROM_LOCK(0x%lx,0x%lx)\n"), fh, lock));
+ TRACE((_T("ACTION_FH_FROM_LOCK(0x%x,0x%x)\n"), fh, lock));
DUMPLOCK(unit,lock);
if (!lock) {
action_end (Unit *unit, dpacket packet)
{
Key *k;
- TRACE((_T("ACTION_END(0x%lx)\n"), GET_PCK_ARG1 (packet)));
+ TRACE((_T("ACTION_END(0x%x)\n"), GET_PCK_ARG1 (packet)));
k = lookup_key (unit, GET_PCK_ARG1 (packet));
if (k != 0) {
/* PUT_PCK_RES2 (packet, EINVAL); */
return;
}
- TRACE((_T("ACTION_READ(%s,0x%lx,%ld)\n"), k->aino->nname, addr, size));
+ TRACE((_T("ACTION_READ(%s,0x%x,%d)\n"), k->aino->nname, addr, size));
gui_flicker_led (UNIT_LED(unit), unit->unit, 1);
if (size == 0) {
}
gui_flicker_led (UNIT_LED(unit), unit->unit, 2);
- TRACE((_T("ACTION_WRITE(%s,0x%lx,%ld)\n"), k->aino->nname, addr, size));
+ TRACE((_T("ACTION_WRITE(%s,0x%x,%d)\n"), k->aino->nname, addr, size));
if (unit->ui.readonly || unit->ui.locked || k->aino->vfso) {
PUT_PCK_RES1 (packet, DOS_FALSE);
action_seek (Unit *unit, dpacket packet)
{
Key *k = lookup_key (unit, GET_PCK_ARG1 (packet));
- long pos = (uae_s32)GET_PCK_ARG2 (packet);
- long mode = (uae_s32)GET_PCK_ARG3 (packet);
+ int pos = (uae_s32)GET_PCK_ARG2 (packet);
+ int mode = (uae_s32)GET_PCK_ARG3 (packet);
uae_s64 res;
uae_s64 cur;
int whence = SEEK_CUR;
whence = SEEK_SET;
cur = k->file_pos;
- TRACE((_T("ACTION_SEEK(%s,%d,%d)=%d\n"), k->aino->nname, pos, mode, cur));
+ TRACE((_T("ACTION_SEEK(%s,%d,%d)=%lld\n"), k->aino->nname, pos, mode, cur));
gui_flicker_led (UNIT_LED(unit), unit->unit, 1);
filesize = key_filesize(k);
a_inode *a;
int err;
- TRACE((_T("ACTION_SET_PROTECT(0x%lx,\"%s\",0x%lx)\n"), lock, bstr (unit, name), mask));
+ TRACE((_T("ACTION_SET_PROTECT(0x%x,\"%s\",0x%x)\n"), lock, bstr (unit, name), mask));
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
commented = NULL;
}
}
- TRACE ((_T("ACTION_SET_COMMENT(0x%lx,\"%s\")\n"), lock, commented));
+ TRACE ((_T("ACTION_SET_COMMENT(0x%x,\"%s\")\n"), lock, commented));
a = find_aino (unit, lock, bstr (unit, name), &err);
if (err != 0) {
uaecptr lock1 = GET_PCK_ARG1 (packet) << 2;
uaecptr lock2 = GET_PCK_ARG2 (packet) << 2;
- TRACE((_T("ACTION_SAME_LOCK(0x%lx,0x%lx)\n"), lock1, lock2));
+ TRACE((_T("ACTION_SAME_LOCK(0x%x,0x%x)\n"), lock1, lock2));
DUMPLOCK(unit, lock1); DUMPLOCK(unit, lock2);
if (!lock1 || !lock2) {
#define CHANGE_LOCK 0
#define CHANGE_FH 1
/* will be CHANGE_FH or CHANGE_LOCK value */
- long type = GET_PCK_ARG1 (packet);
+ int type = GET_PCK_ARG1 (packet);
/* either a file-handle or lock */
uaecptr object = GET_PCK_ARG2 (packet) << 2;
/* will be EXCLUSIVE_LOCK/SHARED_LOCK if CHANGE_LOCK,
* or MODE_OLDFILE/MODE_NEWFILE/MODE_READWRITE if CHANGE_FH *
* Above is wrong, it is always *_LOCK. TW. */
- long mode = GET_PCK_ARG3 (packet);
+ int mode = GET_PCK_ARG3 (packet);
unsigned long uniq;
a_inode *a = NULL, *olda = NULL;
int err = 0;
- TRACE((_T("ACTION_CHANGE_MODE(0x%lx,%d,%d)\n"), object, type, mode));
+ TRACE((_T("ACTION_CHANGE_MODE(0x%x,%d,%d)\n"), object, type, mode));
if (! object || (type != CHANGE_FH && type != CHANGE_LOCK)) {
PUT_PCK_RES1 (packet, DOS_FALSE);
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
- TRACE((_T("ACTION_PARENT(0x%lx)\n"),lock));
+ TRACE((_T("ACTION_PARENT(0x%x)\n"),lock));
if (!lock) {
PUT_PCK_RES1 (packet, 0);
a_inode *aino;
int err;
- TRACE((_T("ACTION_CREATE_DIR(0x%lx,\"%s\")\n"), lock, bstr (unit, name)));
+ TRACE((_T("ACTION_CREATE_DIR(0x%x,\"%s\")\n"), lock, bstr (unit, name)));
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
a_inode *aino = 0;
uaecptr info = GET_PCK_ARG2 (packet) << 2;
- TRACE((_T("ACTION_EXAMINE_FH(0x%lx,0x%lx,%d)\n"),
+ TRACE((_T("ACTION_EXAMINE_FH(0x%x,0x%x,%d)\n"),
GET_PCK_ARG1 (packet), GET_PCK_ARG2 (packet), largefilesize ));
k = lookup_key (unit, GET_PCK_ARG1 (packet));
{
Key *k, *k1;
off_t offset = GET_PCK_ARG2 (packet);
- long mode = (uae_s32)GET_PCK_ARG3 (packet);
+ int mode = (uae_s32)GET_PCK_ARG3 (packet);
int whence = SEEK_CUR;
if (mode > 0)
a_inode *a;
int err;
- TRACE((_T("ACTION_DELETE_OBJECT(0x%lx,\"%s\")\n"), lock, bstr (unit, name)));
+ TRACE((_T("ACTION_DELETE_OBJECT(0x%x,\"%s\")\n"), lock, bstr (unit, name)));
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
struct mytimeval tv;
int err = 0;
- TRACE((_T("ACTION_SET_DATE(0x%lx,\"%s\")\n"), lock, bstr (unit, name)));
+ TRACE((_T("ACTION_SET_DATE(0x%x,\"%s\")\n"), lock, bstr (unit, name)));
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
Key *k1, *knext;
int wehavekeys = 0;
- TRACE((_T("ACTION_RENAME_OBJECT(0x%lx,\"%s\","), lock1, bstr (unit, name1)));
- TRACE((_T("0x%lx,\"%s\")\n"), lock2, bstr (unit, name2)));
+ TRACE((_T("ACTION_RENAME_OBJECT(0x%x,\"%s\","), lock1, bstr (unit, name1)));
+ TRACE((_T("0x%x,\"%s\")\n"), lock2, bstr (unit, name2)));
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
{
Key *k = lookup_key (unit, GET_PCK64_ARG1 (packet));
uae_s64 pos = GET_PCK64_ARG2 (packet);
- long mode = GET_PCK64_ARG3 (packet);
+ int mode = (uae_s32)GET_PCK64_ARG3 (packet);
long whence = SEEK_CUR;
uae_s64 res, cur;
{
Key *k, *k1;
uae_s64 offset = GET_PCK64_ARG2 (packet);
- long mode = (uae_s32)GET_PCK64_ARG3 (packet);
+ int mode = (uae_s32)GET_PCK64_ARG3 (packet);
int whence = SEEK_CUR;
PUT_PCK64_RES0 (packet, DP64_INIT);
if (mode < 0)
whence = SEEK_SET;
- TRACE((_T("ACTION_CHANGE_FILE_SIZE64(0x%lx, %lld, 0x%x)\n"), GET_PCK64_ARG1 (packet), offset, mode));
+ TRACE((_T("ACTION_CHANGE_FILE_SIZE64(0x%x, %lld, 0x%x)\n"), GET_PCK64_ARG1 (packet), offset, mode));
k = lookup_key (unit, GET_PCK64_ARG1 (packet));
if (k == 0) {
PUT_PCK64_RES2 (packet, ERROR_INVALID_LOCK);
return;
}
+ TRACE((_T("ACTION_GET_FILE_SIZE64(%s)\n"), k->aino->nname));
filesize = key_filesize(k);
TRACE((_T("ACTION_GET_FILE_SIZE64(%s)=%lld\n"), k->aino->nname, filesize));
if (filesize >= 0) {
uaecptr info = GET_PCK_ARG2 (packet) << 2;
a_inode *aino = 0;
- TRACE((_T("ACTION_EXAMINE_OBJECT(0x%lx,0x%lx)\n"), lock, info));
+ TRACE((_T("ACTION_EXAMINE_OBJECT(0x%x,0x%x)\n"), lock, info));
DUMPLOCK(unit, lock);
if (lock != 0)
{
Key *k, *k1;
uae_s64 offset = get_quadp(GET_PCK_ARG2 (packet));
- long mode = (uae_s32)GET_PCK_ARG3 (packet);
+ int mode = (uae_s32)GET_PCK_ARG3 (packet);
int whence = SEEK_CUR;
if (mode > 0)
if (mode < 0)
whence = SEEK_SET;
- TRACE((_T("ACTION_SET_FILE_SIZE64(0x%lx, %lld, 0x%x)\n"), GET_PCK_ARG1 (packet), offset, mode));
+ TRACE((_T("ACTION_SET_FILE_SIZE64(0x%x, %lld, 0x%x)\n"), GET_PCK_ARG1 (packet), offset, mode));
k = lookup_key (unit, GET_PCK_ARG1 (packet));
if (k == 0) {
{
Key *k = lookup_key(unit, GET_PCK_ARG1(packet));
uae_s64 pos = get_quadp(GET_PCK64_ARG2(packet));
- long mode = GET_PCK_ARG3(packet);
+ int mode = GET_PCK_ARG3(packet);
long whence = SEEK_CUR;
uae_s64 res, cur;
uae_s32 type = GET_PCK_TYPE (pck);
PUT_PCK_RES2 (pck, 0);
- TRACE((_T("unit=%x packet=%d\n"), unit, type));
+ TRACE((_T("unit=%p packet=%d\n"), unit, type));
if (unit->inhibited && filesys_isvolume (unit)
&& type != ACTION_INHIBIT && type != ACTION_MORE_CACHE
&& type != ACTION_DISK_INFO) {
PUT_PCK_RES1 (packet_addr, DOS_FALSE);
PUT_PCK_RES2 (packet_addr, ERROR_ACTION_NOT_KNOWN);
}
- TRACE((_T("reply: %8lx, %ld\n"), GET_PCK_RES1 (packet_addr), GET_PCK_RES2 (packet_addr)));
+ TRACE((_T("reply: %8x, %d\n"), GET_PCK_RES1 (packet_addr), GET_PCK_RES2 (packet_addr)));
error2:
return 0;
}
-extern void picasso96_alloc (TrapContext*);
static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context)
{
int ret = -1;
return ret;
}
-
-static uae_u8 *cdfs_handler;
-static int cdfs_handler_len;
-
/* Remember a pointer AmigaOS gave us so we can later use it to identify
* which unit a given startup message belongs to. */
static uae_u32 REGPARAM2 filesys_dev_remember (TrapContext *context)
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]);
}
-int rdb_checksum (uae_char *id, uae_u8 *p, int block)
+static int rdb_checksum (const uae_char *id, uae_u8 *p, int block)
{
uae_u32 sum = 0;
int i, blocksize;
return 1;
}
-extern void cia_heartbeat (void);
void filesys_vsync (void)
{
Unit *u;