PS2_EE: update to compile on latest ps2 sdk

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
master
Ronnie Sahlberg 2021-10-15 18:14:18 +10:00
parent 52c7bd7bc5
commit 20b39fd251
5 changed files with 14 additions and 9 deletions

View File

@ -217,12 +217,16 @@ void nfs_set_error(struct nfs_context *nfs, char *error_string, ...)
#endif #endif
; ;
#if defined(PS2_EE)
#define RPC_LOG(rpc, level, format, ...) ;
#else
#define RPC_LOG(rpc, level, format, ...) \ #define RPC_LOG(rpc, level, format, ...) \
do { \ do { \
if (level <= rpc->debug) { \ if (level <= rpc->debug) { \
fprintf(stderr, "libnfs:%d " format "\n", level, ## __VA_ARGS__); \ fprintf(stderr, "libnfs:%d " format "\n", level, ## __VA_ARGS__); \
} \ } \
} while (0) } while (0)
#endif
const char *nfs_get_server(struct nfs_context *nfs); const char *nfs_get_server(struct nfs_context *nfs);
const char *nfs_get_export(struct nfs_context *nfs); const char *nfs_get_export(struct nfs_context *nfs);

View File

@ -410,7 +410,8 @@ nfs_pntoh64(const uint32_t *buf)
{ {
uint64_t val; uint64_t val;
val = ntohl(*(uint32_t *)(void *)buf++); val = ntohl(*(uint32_t *)(void *)buf);
buf++;
val <<= 32; val <<= 32;
val |= ntohl(*(uint32_t *)(void *)buf); val |= ntohl(*(uint32_t *)(void *)buf);

View File

@ -239,7 +239,8 @@ void rpc_set_next_xid(struct rpc_context *rpc, uint32_t xid)
int rpc_queue_pdu(struct rpc_context *rpc, struct rpc_pdu *pdu) int rpc_queue_pdu(struct rpc_context *rpc, struct rpc_pdu *pdu)
{ {
int size, recordmarker; int size;
int32_t recordmarker;
assert(rpc->magic == RPC_CONTEXT_MAGIC); assert(rpc->magic == RPC_CONTEXT_MAGIC);
@ -472,7 +473,8 @@ static int rpc_process_call(struct rpc_context *rpc, ZDR *zdr)
if (endpoint == NULL) { if (endpoint == NULL) {
rpc_set_error(rpc, "No endpoint found for CALL " rpc_set_error(rpc, "No endpoint found for CALL "
"program:0x%08x version:%d\n", "program:0x%08x version:%d\n",
call.body.cbody.prog, call.body.cbody.vers); (int)call.body.cbody.prog,
(int)call.body.cbody.vers);
if (!found_program) { if (!found_program) {
return rpc_send_error_reply(rpc, &call, PROG_UNAVAIL, return rpc_send_error_reply(rpc, &call, PROG_UNAVAIL,
0, 0); 0, 0);
@ -502,7 +504,8 @@ int rpc_process_pdu(struct rpc_context *rpc, char *buf, int size)
struct rpc_pdu *pdu, *prev_pdu; struct rpc_pdu *pdu, *prev_pdu;
struct rpc_queue *q; struct rpc_queue *q;
ZDR zdr; ZDR zdr;
int pos, recordmarker = 0; int pos;
int32_t recordmarker = 0;
unsigned int hash; unsigned int hash;
uint32_t xid; uint32_t xid;
char *reasbuf = NULL; char *reasbuf = NULL;
@ -572,7 +575,7 @@ int rpc_process_pdu(struct rpc_context *rpc, char *buf, int size)
} }
pos = zdr_getpos(&zdr); pos = zdr_getpos(&zdr);
if (zdr_int(&zdr, (int *)&xid) == 0) { if (zdr_u_int(&zdr, &xid) == 0) {
rpc_set_error(rpc, "zdr_int reading xid failed"); rpc_set_error(rpc, "zdr_int reading xid failed");
zdr_destroy(&zdr); zdr_destroy(&zdr);
if (reasbuf != NULL) { if (reasbuf != NULL) {

View File

@ -351,7 +351,7 @@ rpc_read_from_socket(struct rpc_context *rpc)
"buffer of %d bytes for " "buffer of %d bytes for "
"pdu, errno:%d. Closing " "pdu, errno:%d. Closing "
"socket.", "socket.",
pdu_size, errno); (int)pdu_size, errno);
return -1; return -1;
} }
memcpy(rpc->inbuf, &rpc->rm_buf, 4); memcpy(rpc->inbuf, &rpc->rm_buf, 4);

View File

@ -30,7 +30,6 @@
#include <ps2ip.h> #include <ps2ip.h>
typedef unsigned long int fsfilcnt_t; typedef unsigned long int fsfilcnt_t;
typedef unsigned long int fsblkcnt_t;
#define getservbyport(a,b) NULL #define getservbyport(a,b) NULL
#define major(a) 0 #define major(a) 0
@ -64,8 +63,6 @@ struct statvfs {
#define close(a) lwip_close(a) #define close(a) lwip_close(a)
#define getlogin_r(a,b) ENXIO #define getlogin_r(a,b) ENXIO
#define srandom srand
#define random rand
#define POLLIN 0x0001 /* There is data to read */ #define POLLIN 0x0001 /* There is data to read */
#define POLLPRI 0x0002 /* There is urgent data to read */ #define POLLPRI 0x0002 /* There is urgent data to read */