@@ -238,133 +238,6 @@ static inline uint8_t mmio_read_byte(void *addr)
238
238
return * ((uint8_t * )addr );
239
239
}
240
240
241
- /** Sets bits in a 32 bit value from a memory mapped IO device.
242
- *
243
- * @param mask Contains the bits to set at the memory address.
244
- * Bits set in this mask are set in the memory
245
- * location.
246
- * @param addr The memory address to read from/write to.
247
- */
248
- static inline void mmio_or_long (uint32_t mask , void * addr )
249
- {
250
- * ((uint32_t * )addr ) |= mask ;
251
- }
252
-
253
- /** Sets bits in a 16 bit value from a memory mapped IO device.
254
- *
255
- * @param mask Contains the bits to set at the memory address.
256
- * Bits set in this mask are set in the memory
257
- * location.
258
- * @param addr The memory address to read from/write to.
259
- */
260
- static inline void mmio_or_word (uint32_t mask , void * addr )
261
- {
262
- * ((uint16_t * )addr ) |= mask ;
263
- }
264
-
265
- /** Sets bits in an 8 bit value from a memory mapped IO device.
266
- *
267
- * @param mask Contains the bits to set at the memory address.
268
- * Bits set in this mask are set in the memory
269
- * location.
270
- * @param addr The memory address to read from/write to.
271
- */
272
- static inline void mmio_or_byte (uint32_t mask , void * addr )
273
- {
274
- * ((uint8_t * )addr ) |= mask ;
275
- }
276
-
277
- /** Clears bits in a 32 bit value from a memory mapped IO device.
278
- *
279
- * @param mask Contains the bits to clear at the memory address.
280
- * Bits set in this mask are cleared in the memory
281
- * location.
282
- * @param addr The memory address to read from/write to.
283
- */
284
- static inline void mmio_and_long (uint32_t mask , void * addr )
285
- {
286
- * ((uint32_t * )addr ) &= ~mask ;
287
- }
288
-
289
- /** Clears bits in a 16 bit value from a memory mapped IO device.
290
- *
291
- * @param mask Contains the bits to clear at the memory address.
292
- * Bits set in this mask are cleared in the memory
293
- * location.
294
- * @param addr The memory address to read from/write to.
295
- */
296
- static inline void mmio_and_word (uint32_t mask , void * addr )
297
- {
298
- * ((uint16_t * )addr ) &= ~mask ;
299
- }
300
-
301
- /** Clears bits in an 8 bit value from a memory mapped IO device.
302
- *
303
- * @param mask Contains the bits to clear at the memory address.
304
- * Bits set in this mask are cleared in the memory
305
- * location.
306
- * @param addr The memory address to read from/write to.
307
- */
308
- static inline void mmio_and_byte (uint32_t mask , void * addr )
309
- {
310
- * ((uint8_t * )addr ) &= ~mask ;
311
- }
312
-
313
- /** Performs a read-modify-write cycle for a 32 bit value from a MMIO device.
314
- *
315
- * Reads a 32 bit value from a memory mapped IO device, sets and clears
316
- * bits and writes the value back. If a bit is specified in both, the 'set'
317
- * and in the 'clear' mask, it is undefined whether the resulting bit is set
318
- * or cleared.
319
- *
320
- * @param set Contains the bits to set. Bits set in this mask
321
- * are set at the memory address.
322
- * @param clear Contains the bits to clear. Bits set in this
323
- * mask are cleared at the memory address.
324
- * @param addr The memory address to read from/write to.
325
- */
326
- static inline void mmio_rmw_long (uint32_t set , uint32_t clear , void * addr )
327
- {
328
- * ((uint32_t * )addr ) =
329
- (* ((uint32_t * )addr ) & ~clear ) | set ;
330
- }
331
-
332
- /** Performs a read-modify-write cycle for a 16 bit value from a MMIO device.
333
- *
334
- * Reads a 16 bit value from a memory mapped IO device, sets and clears
335
- * bits and writes the value back. If a bit is specified in both, the 'set'
336
- * and in the 'clear' mask, it is undefined whether the resulting bit is set
337
- * or cleared.
338
- *
339
- * @param set Contains the bits to set. Bits set in this mask
340
- * are set at the memory address.
341
- * @param clear Contains the bits to clear. Bits set in this
342
- * mask are cleared at the memory address.
343
- * @param addr The memory address to read from/write to.
344
- */
345
- static inline void mmio_rmw_word (uint32_t set , uint32_t clear , void * addr )
346
- {
347
- * ((uint16_t * )addr ) =
348
- (* ((uint16_t * )addr ) & ~clear ) | set ;
349
- }
350
-
351
- /** Performs a read-modify-write cycle for an 8 bit value from a MMIO device.
352
- *
353
- * Reads an 8 bit value from a memory mapped IO device, sets and clears
354
- * bits and writes the value back. If a bit is specified in both, the 'set'
355
- * and in the 'clear' mask, it is undefined whether the resulting bit is set
356
- * or cleared.
357
- *
358
- * @param set Contains the bits to set. Bits set in this mask
359
- * are set at the memory address.
360
- * @param clear Contains the bits to clear. Bits set in this
361
- * mask are cleared at the memory address.
362
- * @param addr The memory address to read from/write to.
363
- */
364
- static inline void mmio_rmw_byte (uint32_t set , uint32_t clear , void * addr )
365
- {
366
- * ((uint8_t * )addr ) = (* ((uint8_t * )addr ) & ~clear ) | set ;
367
- }
368
241
369
242
/** Writes a 32 bit value to a memory mapped IO device (ROM code version).
370
243
*
@@ -429,139 +302,6 @@ static inline uint8_t __mmio_read_byte(void *addr)
429
302
return * ((uint8_t * )addr );
430
303
}
431
304
432
- /** Sets bits in a 32 bit value from a MMIO device (ROM code version).
433
- *
434
- * @param mask Contains the bits to set at the memory address.
435
- * Bits set in this mask are set in the memory
436
- * location.
437
- * @param addr The memory address to read from/write to.
438
- */
439
- static inline void __mmio_or_long (uint32_t mask , void * addr )
440
- {
441
- * ((uint32_t * )addr ) |= mask ;
442
- }
443
-
444
- /** Sets bits in a 16 bit value from a MMIO device (ROM code version).
445
- *
446
- * @param mask Contains the bits to set at the memory address.
447
- * Bits set in this mask are set in the memory
448
- * location.
449
- * @param addr The memory address to read from/write to.
450
- */
451
- static inline void __mmio_or_word (uint32_t mask , void * addr )
452
- {
453
- * ((uint16_t * )addr ) |= mask ;
454
- }
455
-
456
- /** Sets bits in an 8 bit value from a MMIO device (ROM code version).
457
- *
458
- * @param mask Contains the bits to set at the memory address.
459
- * Bits set in this mask are set in the memory
460
- * location.
461
- * @param addr The memory address to read from/write to.
462
- */
463
- static inline void __mmio_or_byte (uint32_t mask , void * addr )
464
- {
465
- * ((uint8_t * )addr ) |= mask ;
466
- }
467
-
468
- /** Clears bits in a 32 bit value from a MMIO device (ROM code version).
469
- *
470
- * @param mask Contains the bits to clear at the memory address.
471
- * Bits set in this mask are cleared in the memory
472
- * location.
473
- * @param addr The memory address to read from/write to.
474
- */
475
- static inline void __mmio_and_long (uint32_t mask , void * addr )
476
- {
477
- * ((uint32_t * )addr ) &= ~mask ;
478
- }
479
-
480
- /** Clears bits in a 16 bit value from a MMIO device (ROM code version).
481
- *
482
- * @param mask Contains the bits to clear at the memory address.
483
- * Bits set in this mask are cleared in the memory
484
- * location.
485
- * @param addr The memory address to read from/write to.
486
- */
487
- static inline void __mmio_and_word (uint32_t mask , void * addr )
488
- {
489
- * ((uint16_t * )addr ) &= ~mask ;
490
- }
491
-
492
- /** Clears bits in an 8 bit value from a MMIO device (ROM code version).
493
- *
494
- * @param mask Contains the bits to clear at the memory address.
495
- * Bits set in this mask are cleared in the memory
496
- * location.
497
- * @param addr The memory address to read from/write to.
498
- */
499
- static inline void __mmio_and_byte (uint32_t mask , void * addr )
500
- {
501
- * ((uint8_t * )addr ) &= ~mask ;
502
- }
503
-
504
- /** Performs a read-modify-write cycle for a 32 bit value from a MMIO device
505
- * (ROM code version).
506
- *
507
- * Reads a 32 bit value from a memory mapped IO device, sets and clears
508
- * bits and writes the value back. If a bit is specified in both, the 'set'
509
- * and in the 'clear' mask, it is undefined whether the resulting bit is set
510
- * or cleared.
511
- *
512
- * @param set Contains the bits to set. Bits set in this mask
513
- * are set at the memory address.
514
- * @param clear Contains the bits to clear. Bits set in this
515
- * mask are cleared at the memory address.
516
- * @param addr The memory address to read from/write to.
517
- */
518
- static inline void
519
- __mmio_rmw_long (uint32_t set , uint32_t clear , void * addr )
520
- {
521
- * ((uint32_t * )addr ) =
522
- (* ((uint32_t * )addr ) & ~clear ) | set ;
523
- }
524
-
525
- /** Performs a read-modify-write cycle for a 16 bit value from a MMIO device
526
- * (ROM code version).
527
- *
528
- * Reads a 16 bit value from a memory mapped IO device, sets and clears
529
- * bits and writes the value back. If a bit is specified in both, the 'set'
530
- * and in the 'clear' mask, it is undefined whether the resulting bit is set
531
- * or cleared.
532
- *
533
- * @param set Contains the bits to set. Bits set in this mask
534
- * are set at the memory address.
535
- * @param clear Contains the bits to clear. Bits set in this
536
- * mask are cleared at the memory address.
537
- * @param addr The memory address to read from/write to.
538
- */
539
- static inline void
540
- __mmio_rmw_word (uint32_t set , uint32_t clear , void * addr )
541
- {
542
- * ((uint16_t * )addr ) =
543
- (* ((uint16_t * )addr ) & ~clear ) | set ;
544
- }
545
-
546
- /** Performs a read-modify-write cycle for an 8 bit value from a MMIO device
547
- * (ROM code version).
548
- *
549
- * Reads an 8 bit value from a memory mapped IO device, sets and clears
550
- * bits and writes the value back. If a bit is specified in both, the 'set'
551
- * and in the 'clear' mask, it is undefined whether the resulting bit is set
552
- * or cleared.
553
- *
554
- * @param set Contains the bits to set. Bits set in this mask
555
- * are set at the memory address.
556
- * @param clear Contains the bits to clear. Bits set in this
557
- * mask are cleared at the memory address.
558
- * @param addr The memory address to read from/write to.
559
- */
560
- static inline void
561
- __mmio_rmw_byte (uint32_t set , uint32_t clear , void * addr )
562
- {
563
- * ((uint8_t * )addr ) = (* ((uint8_t * )addr ) & ~clear ) | set ;
564
- }
565
305
566
306
/** Reads a 32 Bit memory mapped IO register, mask it and write it back into
567
307
* memory mapped IO register.
0 commit comments