Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

stram.c File Reference

#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/kdev_t.h>
#include <linux/major.h>
#include <linux/init.h>
#include <linux/swap.h>
#include <linux/malloc.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/shm.h>
#include <asm/setup.h>
#include <asm/machdep.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/atarihw.h>
#include <asm/atari_stram.h>
#include <asm/io.h>
#include <asm/semaphore.h>

Include dependency graph for stram.c:

Go to the source code of this file.

Defines

#define DPRINTK(fmt, args...)
#define ALIGN_IF_SWAP(x)   (x)
#define SWAP_NR(addr)   (((unsigned long)(addr)-swap_start) >> PAGE_SHIFT)
#define SWAP_ADDR(nr)   ((void *)(swap_start + ((nr)<<PAGE_SHIFT)))
#define N_PAGES(n)   ((n) >> PAGE_SHIFT)
#define MAX_STRAM_FRACTION_NOM   1
#define MAX_STRAM_FRACTION_DENOM   3
#define BLOCK_FREE   0x01
#define BLOCK_KMALLOCED   0x02
#define BLOCK_STATIC   0x04
#define BLOCK_GFP   0x08
#define BLOCK_INSWAP   0x10
#define N_STATIC_BLOCKS   20

Typedefs

typedef stram_block BLOCK

Functions

static int get_gfp_order (unsigned long size)
static void reserve_region (unsigned long addr, unsigned long end)
static BLOCKadd_region (void *addr, unsigned long size)
static BLOCKfind_region (void *addr)
static int remove_region (BLOCK *block)
void __init atari_stram_init (void)
void __init atari_stram_reserve_pages (unsigned long start_mem)
void * atari_stram_alloc (long size, unsigned long *start_mem, const char *owner)
void atari_stram_free (void *addr)

Variables

static unsigned long rsvd_stram_beg
static unsigned long rsvd_stram_end
static unsigned long stram_start
static unsigned long stram_end
static int mem_init_done = 0
static int kernel_in_stram
static BLOCKalloc_list = NULL
static BLOCK static_blocks [N_STATIC_BLOCKS]


Define Documentation

#define ALIGN_IF_SWAP x   )     (x)
 

Definition at line 129 of file stram.c.

Referenced by atari_stram_alloc(), and atari_stram_init().

#define BLOCK_FREE   0x01
 

Definition at line 169 of file stram.c.

Referenced by add_region(), atari_stram_init(), and remove_region().

#define BLOCK_GFP   0x08
 

Definition at line 172 of file stram.c.

Referenced by atari_stram_alloc(), and atari_stram_free().

#define BLOCK_INSWAP   0x10
 

Definition at line 173 of file stram.c.

Referenced by atari_stram_alloc(), atari_stram_free(), and atari_stram_reserve_pages().

#define BLOCK_KMALLOCED   0x02
 

Definition at line 170 of file stram.c.

Referenced by add_region(), and remove_region().

#define BLOCK_STATIC   0x04
 

Definition at line 171 of file stram.c.

Referenced by atari_stram_alloc(), atari_stram_free(), and atari_stram_reserve_pages().

#define DPRINTK fmt,
args...   ) 
 

Definition at line 46 of file stram.c.

Referenced by __initfunc(), allocate_dmabuf(), ami_decode_var(), amiga_claim_resources(), amiga_frob_control(), amiga_read_control(), amiga_read_status(), amiga_release_resources(), amiga_write_control(), amiga_write_data(), amiga_write_status(), assert_server_locked(), atari_stram_alloc(), atari_stram_free(), atari_stram_reserve_pages(), autofs_catatonic_mode(), autofs_expire(), autofs_hash_enum(), autofs_hash_insert(), autofs_hash_lookup(), autofs_notify_daemon(), autofs_put_super(), autofs_read_super(), autofs_root_ioctl(), autofs_root_lookup(), autofs_root_symlink(), autofs_wait(), build_tachyon_header(), clean_up_memory(), cleanup_via82cxxx_audio(), completion_message_handler(), cv64_board_init(), cv64_compute_clock(), cv64_load_video_mode(), cv64_write_port(), cv_has_4mb(), cvision_bitblt(), cvision_clear(), cvscreen(), Cyber_BitBLT(), Cyber_decode_var(), Cyber_encode_fix(), Cyber_encode_var(), Cyber_getcolreg(), Cyber_init(), Cyber_RectFill(), cyber_set_video(), Cyber_setcolreg(), Cyber_WaitBlit(), Cyber_WaitQueue(), Cyberfb_blank(), cyberfb_get_cmap(), cyberfb_get_fix(), cyberfb_get_par(), cyberfb_get_var(), cyberfb_set_cmap(), cyberfb_set_disp(), cyberfb_set_par(), cyberfb_set_var(), Cyberfb_switch(), Cyberfb_updatevar(), dec_timer_users(), do_fb_set_var(), do_install_cmap(), do_ncp_rpc_call(), drain_dac(), ess_ioctl(), ess_play_setup(), ess_rec_setup(), ess_update_ptr(), ess_write(), ether_crc(), fbcon_init(), free_dmabuf(), get_dmaa(), get_dmac(), gfx_on_off(), handle_FM_interrupt(), handle_Inbound_SCSI_Status_interrupt(), handle_MFS_interrupt(), handle_OCI_interrupt(), handle_SFS_interrupt(), inc_timer_users(), init_via82cxxx_audio(), initial_tok_int(), internal_command(), iph5526_detect(), lance_interrupt(), lance_rx(), lance_set_mac_address(), m3_ac97_read(), m3_ac97_write(), m3_add_list(), m3_codec_reset(), m3_remove_list(), maestro_install(), maestro_notifier(), mdio_read(), mdio_write(), mfc3_claim_resources(), mfc3_frob_control(), mfc3_read_control(), mfc3_read_status(), mfc3_release_resources(), mfc3_write_control(), mfc3_write_data(), mfc3_write_status(), ncp_add_pstring(), ncp_conn_logged_in(), ncp_create_new(), ncp_do_readdir(), ncp_file_read(), ncp_file_write(), ncp_free_dir_cache(), ncp_get_known_namespace(), ncp_get_volume_info_with_number(), ncp_init_root(), ncp_ioctl(), ncp_lock_server(), ncp_lookup_volume(), ncp_make_open(), ncp_mkdir(), ncp_mmap(), ncp_notify_change(), ncp_read_super(), ncp_read_volume_list(), ncp_readdir(), ncp_rename(), ncp_request2(), ncp_rmdir(), ncp_unlink(), netdev_ioctl(), partprod(), pm2fb_decode_var(), pm2fb_reset(), pm2fb_setcolreg(), prog_dmabuf(), read_eeprom(), read_novram(), rng_cleanup(), rng_disable(), rng_enable(), rng_init(), rng_init_one(), rtl8139_close(), rtl8139_get_stats(), rtl8139_hw_start(), rtl8139_init_board(), rtl8139_init_one(), rtl8139_init_ring(), rtl8139_interrupt(), rtl8139_open(), rtl8139_remove_one(), rtl8139_rx_err(), rtl8139_rx_interrupt(), rtl8139_set_rx_mode(), rtl8139_start_xmit(), rtl8139_thread_iter(), rtl8139_tx_interrupt(), rtl8139_tx_timeout(), rtl8139_weird_interrupt(), rtl_check_media(), rx_net_mfs_packet(), rx_net_packet(), seagate_reconnect_intr(), seagate_st0x_queue_command(), set_dmaa(), set_dmac(), set_multicast_list(), start_adc(), start_dac(), stop_dac(), tachyon_interrupt_handler(), tok_close(), tok_interrupt(), tok_open_adapter(), tok_send_packet(), tok_set_multicast_list(), tr_rx(), tr_tx(), tx_arp_packet(), tx_exchange(), tx_ip_packet(), via_ac97_cleanup(), via_ac97_init(), via_ac97_read_reg(), via_ac97_reset(), via_ac97_wait_idle(), via_ac97_write_reg(), via_chan_free(), via_chan_init(), via_chan_pcm_fmt(), via_chan_set_fmt(), via_chan_set_speed(), via_chan_set_stereo(), via_dsp_cleanup(), via_dsp_do_write(), via_dsp_drain_dac(), via_dsp_init(), via_dsp_ioctl(), via_dsp_ioctl_space(), via_dsp_open(), via_dsp_poll(), via_dsp_read(), via_dsp_release(), via_dsp_write(), via_init_one(), via_interrupt(), via_interrupt_cleanup(), via_interrupt_disable(), via_interrupt_init(), via_llseek(), via_mixer_open(), via_remove_one(), via_set_rate(), and via_stop_everything().

#define MAX_STRAM_FRACTION_DENOM   3
 

Definition at line 145 of file stram.c.

Referenced by atari_stram_reserve_pages().

#define MAX_STRAM_FRACTION_NOM   1
 

Definition at line 144 of file stram.c.

Referenced by atari_stram_reserve_pages().

#define N_PAGES n   )     ((n) >> PAGE_SHIFT)
 

Definition at line 139 of file stram.c.

Referenced by atari_stram_alloc(), atari_stram_free(), atari_stram_reserve_pages(), and get_gfp_order().

#define N_STATIC_BLOCKS   20
 

Definition at line 182 of file stram.c.

Referenced by add_region(), and atari_stram_init().

#define SWAP_ADDR nr   )     ((void *)(swap_start + ((nr)<<PAGE_SHIFT)))
 

Definition at line 136 of file stram.c.

#define SWAP_NR addr   )     (((unsigned long)(addr)-swap_start) >> PAGE_SHIFT)
 

Definition at line 133 of file stram.c.

Referenced by atari_stram_alloc(), atari_stram_free(), and atari_stram_reserve_pages().


Typedef Documentation

typedef struct stram_block BLOCK
 


Function Documentation

static BLOCK * add_region void *  addr,
unsigned long  size
[static]
 

Definition at line 1305 of file stram.c.

References BLOCK_FREE, BLOCK_KMALLOCED, stram_block::flags, KERN_ERR, kmalloc(), long, mem_init_done, N_STATIC_BLOCKS, stram_block::next, NULL, printk, stram_block::size, and stram_block::start.

Referenced by atari_stram_alloc().

Here is the call graph for this function:

void* atari_stram_alloc long  size,
unsigned long start_mem,
const char *  owner
 

Definition at line 424 of file stram.c.

References add_region(), addr, ALIGN_IF_SWAP, BLOCK_GFP, BLOCK_INSWAP, BLOCK_STATIC, DPRINTK, stram_block::flags, free_pages(), get_gfp_order(), KERN_ERR, kernel_in_stram, mem_init_done, N_PAGES, NULL, stram_block::owner, printk, rsvd_stram_end, stram_end, SWAP_NR, and xffffffff.

Referenced by __initfunc(), acsi_init(), atari_scsi_detect(), and slm_init().

Here is the call graph for this function:

void atari_stram_free void *  addr  ) 
 

Definition at line 512 of file stram.c.

References BLOCK_GFP, BLOCK_INSWAP, BLOCK_STATIC, DPRINTK, fail, find_region(), stram_block::flags, free_pages(), get_gfp_order(), KERN_ERR, N_PAGES, stram_block::owner, printk, remove_region(), stram_block::size, stram_block::start, and SWAP_NR.

Here is the call graph for this function:

void __init atari_stram_init void   ) 
 

Definition at line 257 of file stram.c.

References addr, ALIGN_IF_SWAP, BLOCK_FREE, stram_block::flags, i, kernel_in_stram, long, m68k_memory, m68k_num_memory, N_STATIC_BLOCKS, panic(), phys_to_virt, rsvd_stram_beg, rsvd_stram_end, stram_end, stram_start, and x800.

Referenced by __initfunc().

Here is the call graph for this function:

void __init atari_stram_reserve_pages unsigned long  start_mem  ) 
 

Definition at line 288 of file stram.c.

References BLOCK_INSWAP, BLOCK_STATIC, DPRINTK, stram_block::flags, KERN_ERR, kernel_in_stram, MACH_IS_HADES, mach_max_dma_address, MAP_NR, max_mapnr, MAX_STRAM_FRACTION_DENOM, MAX_STRAM_FRACTION_NOM, mem_init_done, mem_map, N_PAGES, stram_block::next, num_physpages, p, PAGE_SHIFT, PAGE_SIZE, printk, reserve_region(), rsvd_stram_beg, rsvd_stram_end, set_bit, stram_block::start, stram_end, stram_start, and SWAP_NR.

Referenced by __initfunc().

Here is the call graph for this function:

static BLOCK * find_region void *  addr  )  [static]
 

Definition at line 1341 of file stram.c.

References stram_block::next, NULL, and stram_block::start.

Referenced by atari_stram_free().

static int get_gfp_order unsigned long  size  )  [static]
 

Definition at line 1273 of file stram.c.

References N_PAGES, and PAGE_SIZE.

Referenced by atari_stram_alloc(), and atari_stram_free().

static int remove_region BLOCK block  )  [static]
 

Definition at line 1356 of file stram.c.

References BLOCK_FREE, BLOCK_KMALLOCED, kfree(), and stram_block::next.

Referenced by atari_stram_free().

Here is the call graph for this function:

static void reserve_region unsigned long  addr,
unsigned long  end
[static]
 

Definition at line 1289 of file stram.c.

References MAP_NR, mem_map, PAGE_SIZE, and set_bit.

Referenced by atari_stram_reserve_pages().


Variable Documentation

BLOCK* alloc_list = NULL [static]
 

Definition at line 176 of file stram.c.

int kernel_in_stram [static]
 

Definition at line 158 of file stram.c.

Referenced by atari_stram_alloc(), atari_stram_init(), and atari_stram_reserve_pages().

int mem_init_done = 0 [static]
 

Definition at line 155 of file stram.c.

Referenced by __initfunc(), __ioremap(), add_region(), atari_stram_alloc(), atari_stram_reserve_pages(), get_pte_slow(), irq_kmalloc(), and MMU_get_page().

unsigned long rsvd_stram_beg [static]
 

Definition at line 148 of file stram.c.

Referenced by atari_stram_init(), and atari_stram_reserve_pages().

unsigned long rsvd_stram_end [static]
 

Definition at line 148 of file stram.c.

Referenced by atari_stram_alloc(), atari_stram_init(), and atari_stram_reserve_pages().

BLOCK static_blocks[N_STATIC_BLOCKS] [static]
 

Definition at line 183 of file stram.c.

unsigned long stram_end [static]
 

Definition at line 151 of file stram.c.

Referenced by atari_stram_alloc(), atari_stram_init(), and atari_stram_reserve_pages().

unsigned long stram_start [static]
 

Definition at line 151 of file stram.c.

Referenced by atari_stram_init(), and atari_stram_reserve_pages().