Home | History | Annotate | Download | only in ppc

Lines Matching defs:shm

28 #include <sys/shm.h>
34 shm - map unix shared memory into psim address space
50 The SHM area is assumed to be of the same length.
59 Enable tracing of the shm:
61 | bash$ psim -t shm-device \
67 | -o '/shm@0x0c000000/reg 0x0c000000 0x80000' \
68 | -o '/shm@0x0c000000/key 0x12345678' \
71 -o '/shm@0x0c000000/reg 0x0c000000 0x80000' \
72 -o '/shm@0x0c000000/key 0x12345678' ../psim-hello/hello
93 hw_shm_device *shm = (hw_shm_device*)device_data(me);
101 shm->key = (key_t) device_find_integer_property(me, "key");
102 DTRACE(shm, ("shm key (0x%08jx)\n", (intmax_t)shm->key) );
109 shm->physical_address = 0xffffffff;
110 shm->sizeof_memory = 0xffffffff;
116 if ( shm->physical_address != 0xffffffff )
119 shm->physical_address = reg.address.cells[i];
120 DTRACE(shm, ("shm physical_address=0x%x\n", shm->physical_address));
122 shm->sizeof_memory = reg.size.cells[i];
123 DTRACE(shm, ("shm length=0x%x\n", shm->sizeof_memory));
126 if ( shm->physical_address == 0xffffffff )
129 if ( shm->sizeof_memory == 0xffffffff )
133 shm->id = shmget(shm->key, shm->sizeof_memory, IPC_CREAT | 0660);
134 if (shm->id == -1)
137 shm->shm_address = shmat(shm->id, (char *)0, SHM_RND);
138 if (shm->shm_address == (void *)-1)
168 hw_shm_device *shm = (hw_shm_device*)device_data(me);
172 DTRACE(shm, ("read %p %x %x %x\n", \
173 shm->shm_address, shm->physical_address, addr, nr_bytes) );
175 memcpy(dest, &shm->shm_address[addr - shm->physical_address], nr_bytes);
189 hw_shm_device *shm = (hw_shm_device*)device_data(me);
193 DTRACE(shm, ("write %p %x %x %x\n", \
194 shm->shm_address, shm->physical_address, addr, nr_bytes) );
196 memcpy(&shm->shm_address[addr - shm->physical_address], source, nr_bytes);
216 hw_shm_device *shm = ZALLOC(hw_shm_device);
217 return shm;
223 { "shm", hw_shm_create, &hw_shm_callbacks },