Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sysmips(2) — Kubota Pacific 4.1 System Software

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sync(2)

a.out(4)

swap(1M)

SYSMIPS(2)  —  Kubota Pacfic Computer Inc. (System Calls)

NAME

sysmips − machine specific functions

SYNOPSIS

#include <sys/sysmips.h>

int sysmips (cmd, arg1, arg2, arg3)

int cmd, arg1, arg2, arg3;

DESCRIPTION

sysmips implements machine specific functions.  The cmd argument determines the function performed.  The number of arguments expected is dependent on the function. 

Command SETNAME

When cmd is SETNAME, the name of the system may be changed.  One argument, the address of a string containing the new name of the system, is expected.  This name is copied into the kernel utsname data structure, into both the sysname and nodename fields.  It is also copied into hostname so that future calls to hostname (2-BSD) will return this value.  You must be the super-user to use this function. 

Command FLUSH_CACHE

This function flushes both data and instruction caches on all processors.  You need not be super-user to use this function. 

Command FLUSH_ICACHE

This function flushes the instruction cache on all processors.  You need not be super-user to use this function. 

Command ENABLE_CPU

This function allows the processor specified by the first argument to dispatch processes (processors are all normally enabled).  Must be super-user to use this function. 

Command DISABLE_CPU

This function prevents the processor specified from dispatching.  There is big time trouble if the last processor in the system!  You must be super-user to use this function. 

Command SLED_ON

This function turns on the front panel yellow light emitting diode (LED).  Must be super-user to use this function. 

Command SLED_OFF

This function turns off the front panel yellow light emitting diode (LED).  Must be super-user to use this function. 

Command SLED_FLASH

This function causes front panel yellow light emitting diode (LED) to flash approximately once a second.  Must be super-user to use this function. 

Command SREAD_NVRAM

This function reads the contents of the non-volatile memory which is maintained on the system I/O board.  Transfers the contents into the byte array pointed to by the first argument.  There are 2048 bytes of nvram, organized as a list of null delimited strings of the form <nvram name>=<nvram value>.  Need not be super-user to use this function. 

Command SWRITE_NVRAM

This function expects the first argument to be a pointer to a string of the form <nvram name>=<nvram value>.  The nvram string identified by <nvram name> is replaced by <nvram value>.  If <nvram value> is null, then <nvram name> is removed from nvram.  Must be super-user to use this function. 

Command SREAD_IDPROM

This function transfers the contents of the ID PROM on each of the cpu boards present in the system into the byte array pointed to by the first argument.  Each cpu board maintains 32 bytes of ID PROM information and there is a limit of 4 cpu boards per system.  The specified array must be at least 128 bytes long.  Need not be super-user to use this function. 

Command SBOOT_CPU

This function returns the cpu id of the boot processor.  Need not be super-user to use this function. 

Command SFORCE_RUN

This function forces the calling process (or thread of a multi-threaded process) to always execute on the cpu specified in the first argument.  For instance, sysmips(SFORCE_RUN, 2) would force a process to always run on cpu 2.  Need not be super-user to use this function.

Command SFORCE_NORUN

This function forces the calling process (or thread of a multi-threaded process) to never execute on the cpu specified in the first argument.  For instance, sysmips(SFORCE_NORUN, 2) would force a process off of cpu 2 (if it were currently executing on cpu 2) and would not schedule the process on cpu 2 in the future.  Need not be super-user to use this function.

Command WHICHPROC

This function returns the processor id of the cpu that is executing the calling process.  Processor id’s are 0, 1, 2, etc. 

Command PROCPRESENT

This function returns a bit mask indicating which processors are present in the system and which are currently enabled.  Each bit corresponds to a processor id.  For instance, if processor id 0 is present and enabled, bit 0 of the return value is set, if processor id 1 is present and enabled, bit 1 of the return value is set, etc. 

Command SMIPSDENORM

Denormalized floating point numbers are handled differently by the Mips 3010 FPU and the Stardent 1500/3000 vector FPU.  The vector FPU replaces “denorms” by zero while the Mips FPU causes a trap.  Setting arg1 to 1 causes the Mips FPU to treat “denorms” the same way as the vector FPU.  Setting arg1 to zero returns to the default Mips behavior. 

Command SMIPSSWPI

When cmd is SMIPSSWPI, individual swapping areas may be added, deleted or the current areas determined.  The address of an appropriately primed swap buffer is passed as the only argument.  (Refer to sys/swap.h header file for details of loading the buffer.) 

The format of the swap buffer is:

  struct swapint {
     charsi_cmd;/∗command: list, add, delete∗/
     char∗si_buf;/∗swap file path pointer∗/
     intsi_swplo;/∗start block∗/
     intsi_nblks;/∗swap size∗/
  }

Note that the add and delete options of the command may only be exercised by the super-user. 

Typically, a swap area is added by a single call to sysmips. First, the swap buffer is primed with appropriate entries for the structure members. Then sysmips is invoked. 

#include <sys/sysmips.h>
#include <sys/swap.h>

struct swapint swapbuf;/∗swap into buffer ptr∗/

sysmips(SMIPSSWPI, &swapbuf);

If this command succeeds, it returns 0 to the calling process.  This command fails, returning -1, if one or more of the following is true:

[EFAULT]Swapbuf points to an invalid address

[EFAULT]Swapbuf.si_buf points to an invalid address

[ENOTBLK]Swap area specified is not a block special device

[EEXIST]Swap area specified has already been added

[ENOSPC]Too many swap areas in use (if adding)

[ENOMEM]Tried to delete last remaining swap area

[EINVAL]Bad arguments

[EINVAL]Specified a non-existent cpu

[ENOMEM]No place to put swapped pages when deleting a swap area

Command STIME

When cmd is STIME, an argument of type long is expected.  This function sets the system time and date.  The argument contains the time as measured in seconds from 00:00:00 GMT January 1, 1970.  Note that this command is only available to the super-user. 

SEE ALSO

sync(2), a.out(4). 

swap(1M) in the SystemAdministrator’sReferenceManual. 

DIAGNOSTICS

Upon successful completion, the value returned depends on cmd as follows:

SBOOT_CPU: returns the cpu id of the boot processor

WHICHPROC: returns the cpu id of the current processor

PROCPRESENT: returns a bit mask of present and enabled processors

all others: return 0

Otherwise, a value of −1 is returned and errno is set to indicate the error. When cmd is invalid, errno is set to EINVAL on return. 
 

March 13, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026