Rom redirect function table, Table 23-1. rom redirect functions – Maxim Integrated High-Speed Microcontroller Users Guide: Network Microcontroller Supplement User Manual

Page 217

Advertising
background image

ROM REDIRECT FUNCTION TABLE

Since the socket interface is used by both NetBoot (from DS80C400 silicon software) and the user code (possibly running under a run-

time environment or operating system), the code must be flexible enough to support all types of memory managers, as well as task and

thread schedulers. Therefore, the DS80C400 silicon software socket interface code does not call these functions directly, but it makes

use of a function redirect table. During a NetBoot, the DS80C400 silicon software provides its own minimal implementations of these func-

tions. However, to use the socket layer from an application, users can substitute their own implementations for the functions in Table 23-1.

Table 23-1. ROM REDIRECT FUNCTIONS

Functions should be replaced in groups, e.g., if the user provides his/her own memory manager, all the memory manager functions

should be replaced.

Note: All DS80C400 silicon software functions (including the exported functions) make heavy use of this table.

Therefore, it must always exist, either in its default state or modified by the user. The function redirect table that is contained in the

DS80C400 silicon software is copied to memory using the

ROM_redirect_init function. NetBoot calls this function. If the user does not

use NetBoot,

ROM_Redirect_Init must be called. ROM_Redirect_Init restores the function redirect table without altering any other

state.

FUNCTION

TABLE

OFFSET

DESCRIPTION

bootstate

00h

Reserved for use by Maxim

kernelmalloc

03h

See rom_kernelmalloc

kernelfree

06h

See rom_kernelfree

malloc

09h

See rom_malloc

free

0Ch

See rom_free

mallocdirty

0Fh

See rom_mallocdirty

deref

12h

See rom_deref

M

E

M

O

R

Y

M

A

N

A

G

E

R

underef

54h

Opposite of deref (12h)

getfreeram

15h

See rom_getfreeram

gettimemilli s

18h

Returns uptime since the sy stem was initialized in milli seconds

getthreadID

1Bh

Returns thread ID

threadresume

1Eh

Resumes thread

threadIOsleep

21h

Sleeps, waiting for I/O

threadIOsleepNC

24h

Sleeps, waiting for I/O (run from critical section)

threadsave

27h

Saves thread

threadrestore

2Ah

Restores thread

T

A

S

K

M

A

N

A

G

E

R

sleep

2Dh

Sleeps for a number of milliseconds

gettaskID

30h

See task_getcurrent

infosendchar

33h

Prints debug character to debug port

IPchecksum

36h

Computes IP checksum

reserved

39h

Reserved for use by Maxim

DHCPnotify

3Ch

See rom_dhcp_notify

taskcreate

3Fh

See task_create

taskduplicate

42h

See task_duplicate

taskdestroy

45h

See task_destroy

T

A

S

K

M

A

N

A

G

E

R

(H

O

O

K

S

)

taskswitchin

48h

See rom_task_switch_in

taskswitchout

4Bh

See rom_task_switch_out

getMACID

4Eh

Reads MAC ID from DS2502 1-Wire device and IP/gateway/TFTP server

from other 1-Wire device

reserved

51h

Reserved for use by Maxim

userIOpoll

57h

Called by scheduler

errornotification

5Ah

Called when out of memory or other error detected

High-Speed Microcontroller User’s

Guide: Network Microcontroller

Supplement

217

Maxim Integrated

Advertising