The FreeSpace module provides two SWIs:

Free_Register  
       
Entry:
        r0 - Filing system number
        r1 - Address of routine to call to get free space info (see below)
        r2 - r12 on entry to the above routine.

Exit:
        Registers preserved.

        This must be called in order for the free space module to provide an interactive free space display for a filing system (it is done automatically by the free space module for the following filing systems: ADFS RAMFS NETFS NFS SCSIFS).


Free_Deregister

        r0 - Filing system number.
        
        This removes the filing system from the list of known  filing systems.


In 32-bit systems, the processor will be in SVC32 on entry.


FS_Entry reason codes: (On entry to routine pointed to by r1 in above SWI)


             0 - NoOp  - Just return.
             1 - Get device name

                r0 - 1 (Reason code)
                r1 - FS number.
                r2 -> Buffer.
                r3 -> device name / id.
                 
                Exit:

                r0 - length of name 
                r1 - preserved.
                r2 - preserved.
                r3 - preserved.

            
             2 - Get free space for device.

                r0 - 2 (Reason code)
                r1 - FS number.
                r2 -> Buffer
                r3 -> Device name / id .

                Exit:

                Registers preserved.

                [r2]    - Total size of device.
                [r2+4]  - Free space on device.
                [r2+8]  - Used space on device.

             3 - Compare device.

                r0 - 3 (Reason code)
                r1 - FS number.
                r2 -> filename.
                r3 -> Device id.
                r6 -> Special field.

                Exit:   

                Registers preserved.

                Z set if r2 & r6 result in a file on the device pointed to by
                r3.

                This call can simply return with Z set if the filing system
                is a FAST filing system (E.G. RAMFS).

             
             4 - Get free space for device (64 bit variant)
                
                r0 - 4 (Reason code)
                r1 - FS number
                r2 -> Buffer
                r3 -> Device name / id .

                Exit:

                R0 = 0
                Other registers preserved.

                [r2]    - Total size of device (2 words, low first)
                [r2+8]  - Free space on device (2 words, low first)
                [r2+16] - Used space on device (2 words, low first)
