Ignore:
Timestamp:
Jun 19, 2005, 6:10:41 AM (20 years ago)
Author:
bird
Message:

o File resize optimization: The JFS, HPFS and probably NET

will never return space which isn't zeroed when expanding
a file. Associate a file system information object with the
filehandles to keep track of such features. This also fixes
the fsStatFH() implementation trouble.
This attribute doesn't apply to CDFS. While RAMFS fails
the test, it zeros at open but not at setfilesize.

o Fixed invalid inode and dev numbers for new files, was passing

the wrong path around.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/386/builtin.h

    • Property cvs2svn:cvs-rev changed from 1.11 to 1.12
    r2047 r2048  
    148148}
    149149
    150 
    151150/**
    152151 * Atomically increments a 32-bit unsigned value.
     
    164163 * Atomically increments a 32-bit unsigned value.
    165164 *
     165 * @returns The new value.
    166166 * @param   pu32    Pointer to the value to increment.
    167167 */
    168 static __inline__ void __atomic_increment_u32(uint32_t __volatile__ *pu32)
    169 {
    170     __asm__ __volatile__("lock; incl %0"
    171                          : "=m" (*pu32)
    172                          : "m"  (*pu32));
     168static __inline__ uint32_t __atomic_increment_u32(uint32_t __volatile__ *pu32)
     169{
     170    uint32_t u32;
     171    __asm__ __volatile__("lock; xadd %0, %1\n\t"
     172                         "incl %0\n\t"
     173                         : "=r" (u32),
     174                           "=m" (*pu32)
     175                         : "0" (1)
     176                         : "memory");
     177    return u32;
     178}
     179
     180/**
     181 * Atomically increments a 32-bit signed value.
     182 *
     183 * @returns The new value.
     184 * @param   pi32    Pointer to the value to increment.
     185 */
     186static __inline__ uint32_t __atomic_increment_s32(int32_t __volatile__ *pi32)
     187{
     188    int32_t i32;
     189    __asm__ __volatile__("lock; xadd %0, %1\n\t"
     190                         "incl %0\n\t"
     191                         : "=r" (i32),
     192                           "=m" (*pi32)
     193                         : "0" (1)
     194                         : "memory");
     195    return i32;
    173196}
    174197
     
    200223 * Atomically decrements a 32-bit unsigned value.
    201224 *
    202  * @param   pu      Pointer to the value to decrement.
    203  */
    204 static __inline__ void __atomic_decrement_u32(__volatile__ uint32_t *pu32)
    205 {
    206     __asm__ __volatile__("lock; decl %0"
    207                          : "=m" (*pu32)
    208                          : "m"  (*pu32));
     225 * @returns The new value.
     226 * @param   pu32      Pointer to the value to decrement.
     227 */
     228static __inline__ uint32_t __atomic_decrement_u32(__volatile__ uint32_t *pu32)
     229{
     230    uint32_t u32;
     231    __asm__ __volatile__("lock; xadd %0, %1\n\t"
     232                         "decl %0\n\t"
     233                         : "=r" (u32),
     234                           "=m" (*pu32)
     235                         : "0" (-1)
     236                         : "memory");
     237    return u32;
     238}
     239
     240/**
     241 * Atomically decrements a 32-bit signed value.
     242 *
     243 * @returns The new value.
     244 * @param   pi32    Pointer to the value to decrement.
     245 */
     246static __inline__ uint32_t __atomic_decrement_s32(__volatile__ int32_t *pi32)
     247{
     248    int32_t i32;
     249    __asm__ __volatile__("lock; xadd %0, %1\n\t"
     250                         "decl %0\n\t"
     251                         : "=r" (i32),
     252                           "=m" (*pi32)
     253                         : "0" (-1)
     254                         : "memory");
     255    return i32;
    209256}
    210257
     
    212259 * Atomically decrements a 16-bit unsigned value.
    213260 *
     261 * @returns The new value.
    214262 * @param   pu16    Pointer to the value to decrement.
    215263 */
Note: See TracChangeset for help on using the changeset viewer.