readdiskid.c
714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <ultra64.h>
#ifndef _LONGCMD
#include <leo.h>
#else
#include <leosp.h>
#endif
extern s32 __leoActive;
s32 LeoReadDiskID(LEOCmd *cmdBlock, LEODiskID *vaddr, OSMesgQueue *mq)
{
/*
* Check for existence of Leo Manager
*/
if (!__leoActive) {
return(-1);
}
/*
* Fill up command block
*/
cmdBlock->header.command = LEO_COMMAND_READ_DISK_ID;
cmdBlock->header.reserve1 = 0;
cmdBlock->header.control = 0;
cmdBlock->header.reserve3 = 0;
cmdBlock->data.readdiskid.buffer_pointer = vaddr;
if (mq != NULL)
{
cmdBlock->header.control |= LEO_CONTROL_POST;
cmdBlock->header.post = mq;
}
leoCommand((void *)cmdBlock);
return 0;
} /* LeoReadDiskID */