Skip to content

Commit 5bbcdb1

Browse files
authored
Merge pull request #743 from uyjulian/expose_getdevtype
[iomanX] expose iomanX_GetDevType and iomanX_StdioInit
2 parents 0f60997 + cec0f2a commit 5bbcdb1

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

iop/system/iomanx/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ IOP_INCS += \
1515
-I$(PS2SDKSRC)/iop/system/loadcore/include \
1616
-I$(PS2SDKSRC)/iop/system/stdio/include \
1717
-I$(PS2SDKSRC)/iop/system/sysclib/include \
18-
-I$(PS2SDKSRC)/iop/system/sysmem/include
18+
-I$(PS2SDKSRC)/iop/system/sysmem/include \
19+
-I$(PS2SDKSRC)/iop/system/threadman/include
1920

2021
IOP_OBJS = iomanX.o ioman_sbv.o exports.o imports.o
2122

iop/system/iomanx/include/iomanX.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ extern int iomanX_ioctl2(int fd, int cmd, void *arg, unsigned int arglen, void *
166166
extern int iomanX_AddDrv(iomanX_iop_device_t *device);
167167
extern int iomanX_DelDrv(const char *name);
168168

169+
extern unsigned int iomanX_GetDevType(int fd);
169170
extern void iomanX_StdioInit(int mode);
170171

171172
#ifdef _IOP
@@ -205,6 +206,7 @@ extern void iomanX_StdioInit(int mode);
205206
#define I_iomanX_AddDrv DECLARE_IMPORT(20, iomanX_AddDrv)
206207
#define I_iomanX_DelDrv DECLARE_IMPORT(21, iomanX_DelDrv)
207208
#endif
209+
#define I_iomanX_GetDevType DECLARE_IMPORT(22, iomanX_GetDevType)
208210
#define I_iomanX_StdioInit DECLARE_IMPORT(23, iomanX_StdioInit)
209211
#endif
210212

iop/system/iomanx/src/exports.tab

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ DECLARE_EXPORT_TABLE(iomanx, 1, 1)
2323
DECLARE_EXPORT(_retonly)
2424
/*20*/ DECLARE_EXPORT(iomanX_AddDrv)
2525
DECLARE_EXPORT(iomanX_DelDrv)
26-
DECLARE_EXPORT(_retonly)
27-
DECLARE_EXPORT(_retonly)
26+
DECLARE_EXPORT(iomanX_GetDevType)
27+
DECLARE_EXPORT(iomanX_StdioInit)
2828
DECLARE_EXPORT(_retonly)
2929
/*25*/ DECLARE_EXPORT(iomanX_rename)
3030
DECLARE_EXPORT(iomanX_chdir)

iop/system/iomanx/src/imports.lst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
intrman_IMPORTS_start
3+
I_CpuSuspendIntr
4+
I_CpuResumeIntr
5+
intrman_IMPORTS_end
6+
27
sysmem_IMPORTS_start
38
I_Kprintf
49
sysmem_IMPORTS_end
@@ -13,6 +18,7 @@ I_RegisterLibraryEntries
1318
I_QueryLibraryEntryTable
1419
I_FlushDcache
1520
I_FlushIcache
21+
I_QueryBootMode
1622
loadcore_IMPORTS_end
1723

1824
sysclib_IMPORTS_start
@@ -26,7 +32,7 @@ I_strncpy
2632
I_strtol
2733
sysclib_IMPORTS_end
2834

29-
intrman_IMPORTS_start
30-
I_CpuSuspendIntr
31-
I_CpuResumeIntr
32-
intrman_IMPORTS_end
35+
thbase_IMPORTS_start
36+
I_ReferThreadStatus
37+
I_ChangeThreadPriority
38+
thbase_IMPORTS_end

iop/system/iomanx/src/iomanX.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ extern struct irx_export_table _exp_ioman;
5252
#define MAX_FILES 32
5353
#endif
5454

55-
#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK
5655
void iomanX_StdioInit(int mode);
5756
static int open_tty_handles(const char *tty_name);
58-
#endif
5957
static int xx_stat(int op, const char *name, iox_stat_t *stat, unsigned int statmask);
6058
static int xx_rename(int op, const char *oldname, const char *newname);
6159
static int xx_dir(int op, const char *name, int mode);
@@ -64,13 +62,9 @@ static iomanX_iop_file_t *new_iob(void);
6462
static iomanX_iop_file_t *get_iob(int fd);
6563
static iomanX_iop_device_t *lookup_dev(const char *name, int show_unkdev_msg);
6664
static const char *parsefile(const char *path, iomanX_iop_device_t **p_device, int *p_unit);
67-
#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK
68-
static int tty_noop(void);
69-
unsigned int iomanX_GetDevType(int fd);
70-
#endif
7165
static void ShowDrv(void);
72-
#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK
7366
static void register_tty(void);
67+
#ifdef _IOP
7468
static void register_dummytty(void);
7569
#endif
7670

@@ -83,7 +77,6 @@ struct ioman_dev_listentry
8377
#endif
8478

8579
static int showdrvflag = 1;
86-
#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK
8780

8881
IOMANX_RETURN_VALUE_IMPL(0);
8982

@@ -123,6 +116,7 @@ static iomanX_iop_device_t dev_tty = {
123116
"CONSOLE",
124117
&dev_tty_dev_operations,
125118
};
119+
#ifdef _IOP
126120
static iomanX_iop_device_t dev_dummytty = {
127121
"dummytty",
128122
IOP_DT_CHAR,
@@ -378,7 +372,6 @@ iomanX_iop_file_t *get_file(int fd)
378372
}
379373
#endif
380374

381-
#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK
382375
void iomanX_StdioInit(int mode)
383376
{
384377
#ifdef _IOP
@@ -432,7 +425,6 @@ static int open_tty_handles(const char *tty_name)
432425
return -1;
433426
return 0;
434427
}
435-
#endif
436428

437429
int iomanX_open(const char *name, int flags, ...)
438430
{
@@ -1212,7 +1204,6 @@ int iomanX_DelDrv(const char *name)
12121204
#endif
12131205
}
12141206

1215-
#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK
12161207
unsigned int iomanX_GetDevType(int fd)
12171208
{
12181209
iomanX_iop_file_t *f;
@@ -1222,7 +1213,6 @@ unsigned int iomanX_GetDevType(int fd)
12221213
return handle_result(-EBADF, f, 0);
12231214
return f->device->type;
12241215
}
1225-
#endif
12261216

12271217
static void ShowDrv(void)
12281218
{
@@ -1247,13 +1237,13 @@ static void ShowDrv(void)
12471237
showdrvflag = 0;
12481238
}
12491239

1250-
#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK
12511240
static void register_tty(void)
12521241
{
12531242
iomanX_DelDrv(dev_tty.name);
12541243
iomanX_AddDrv(&dev_tty);
12551244
}
12561245

1246+
#ifdef _IOP
12571247
static void register_dummytty(void)
12581248
{
12591249
iomanX_DelDrv(dev_dummytty.name);

iop/system/iomanx/src/irx_imports.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
#include "irx.h"
1717

1818
/* Please keep these in alphabetical order! */
19+
#include "intrman.h"
1920
#include "loadcore.h"
2021
#include "stdio.h"
2122
#include "sysclib.h"
2223
#include "sysmem.h"
23-
#include "intrman.h"
24+
#include "thbase.h"
2425

2526
#endif /* IOP_IRX_IMPORTS_H */

0 commit comments

Comments
 (0)