sctp_lock_bsd.h (167598) | sctp_lock_bsd.h (168859) |
---|---|
1#ifndef __sctp_lock_bsd_h__ 2#define __sctp_lock_bsd_h__ 3/*- 4 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 55 unchanged lines hidden (view full) --- 64 65/* 66 * When working with the global SCTP lists we lock and unlock the INP_INFO 67 * lock. So when we go to lookup an association we will want to do a 68 * SCTP_INP_INFO_RLOCK() and then when we want to add a new association to 69 * the sctppcbinfo list's we will do a SCTP_INP_INFO_WLOCK(). 70 */ 71#include <sys/cdefs.h> | 1#ifndef __sctp_lock_bsd_h__ 2#define __sctp_lock_bsd_h__ 3/*- 4 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 55 unchanged lines hidden (view full) --- 64 65/* 66 * When working with the global SCTP lists we lock and unlock the INP_INFO 67 * lock. So when we go to lookup an association we will want to do a 68 * SCTP_INP_INFO_RLOCK() and then when we want to add a new association to 69 * the sctppcbinfo list's we will do a SCTP_INP_INFO_WLOCK(). 70 */ 71#include <sys/cdefs.h> |
72__FBSDID("$FreeBSD: head/sys/netinet/sctp_lock_bsd.h 167598 2007-03-15 11:27:14Z rrs $"); | 72__FBSDID("$FreeBSD: head/sys/netinet/sctp_lock_bsd.h 168859 2007-04-19 11:28:43Z rrs $"); |
73 74 75extern struct sctp_foo_stuff sctp_logoff[]; 76extern int sctp_logoff_stuff; 77 78#define SCTP_IPI_COUNT_INIT() 79 80#define SCTP_STATLOG_INIT_LOCK() --- 219 unchanged lines hidden (view full) --- 300 301#define SCTP_INCR_EP_COUNT() \ 302 do { \ 303 atomic_add_int(&sctppcbinfo.ipi_count_ep, 1); \ 304 } while (0) 305 306#define SCTP_DECR_EP_COUNT() \ 307 do { \ | 73 74 75extern struct sctp_foo_stuff sctp_logoff[]; 76extern int sctp_logoff_stuff; 77 78#define SCTP_IPI_COUNT_INIT() 79 80#define SCTP_STATLOG_INIT_LOCK() --- 219 unchanged lines hidden (view full) --- 300 301#define SCTP_INCR_EP_COUNT() \ 302 do { \ 303 atomic_add_int(&sctppcbinfo.ipi_count_ep, 1); \ 304 } while (0) 305 306#define SCTP_DECR_EP_COUNT() \ 307 do { \ |
308 atomic_add_int(&sctppcbinfo.ipi_count_ep,-1); \ | 308 atomic_subtract_int(&sctppcbinfo.ipi_count_ep, 1); \ |
309 } while (0) 310 311#define SCTP_INCR_ASOC_COUNT() \ 312 do { \ 313 atomic_add_int(&sctppcbinfo.ipi_count_asoc, 1); \ 314 } while (0) 315 316#define SCTP_DECR_ASOC_COUNT() \ 317 do { \ | 309 } while (0) 310 311#define SCTP_INCR_ASOC_COUNT() \ 312 do { \ 313 atomic_add_int(&sctppcbinfo.ipi_count_asoc, 1); \ 314 } while (0) 315 316#define SCTP_DECR_ASOC_COUNT() \ 317 do { \ |
318 atomic_add_int(&sctppcbinfo.ipi_count_asoc, -1); \ | 318 atomic_subtract_int(&sctppcbinfo.ipi_count_asoc, 1); \ |
319 } while (0) 320 321#define SCTP_INCR_LADDR_COUNT() \ 322 do { \ 323 atomic_add_int(&sctppcbinfo.ipi_count_laddr, 1); \ 324 } while (0) 325 326#define SCTP_DECR_LADDR_COUNT() \ 327 do { \ | 319 } while (0) 320 321#define SCTP_INCR_LADDR_COUNT() \ 322 do { \ 323 atomic_add_int(&sctppcbinfo.ipi_count_laddr, 1); \ 324 } while (0) 325 326#define SCTP_DECR_LADDR_COUNT() \ 327 do { \ |
328 atomic_add_int(&sctppcbinfo.ipi_count_laddr, -1); \ | 328 atomic_subtract_int(&sctppcbinfo.ipi_count_laddr, 1); \ |
329 } while (0) 330 331#define SCTP_INCR_RADDR_COUNT() \ 332 do { \ | 329 } while (0) 330 331#define SCTP_INCR_RADDR_COUNT() \ 332 do { \ |
333 atomic_add_int(&sctppcbinfo.ipi_count_raddr,1); \ | 333 atomic_add_int(&sctppcbinfo.ipi_count_raddr, 1); \ |
334 } while (0) 335 336#define SCTP_DECR_RADDR_COUNT() \ 337 do { \ | 334 } while (0) 335 336#define SCTP_DECR_RADDR_COUNT() \ 337 do { \ |
338 atomic_add_int(&sctppcbinfo.ipi_count_raddr,-1); \ | 338 atomic_subtract_int(&sctppcbinfo.ipi_count_raddr,1); \ |
339 } while (0) 340 341#define SCTP_INCR_CHK_COUNT() \ 342 do { \ 343 atomic_add_int(&sctppcbinfo.ipi_count_chunk, 1); \ 344 } while (0) 345 346#define SCTP_DECR_CHK_COUNT() \ 347 do { \ 348 if(sctppcbinfo.ipi_count_chunk == 0) \ 349 panic("chunk count to 0?"); \ | 339 } while (0) 340 341#define SCTP_INCR_CHK_COUNT() \ 342 do { \ 343 atomic_add_int(&sctppcbinfo.ipi_count_chunk, 1); \ 344 } while (0) 345 346#define SCTP_DECR_CHK_COUNT() \ 347 do { \ 348 if(sctppcbinfo.ipi_count_chunk == 0) \ 349 panic("chunk count to 0?"); \ |
350 atomic_add_int(&sctppcbinfo.ipi_count_chunk,-1); \ | 350 atomic_subtract_int(&sctppcbinfo.ipi_count_chunk, 1); \ |
351 } while (0) 352 353#define SCTP_INCR_READQ_COUNT() \ 354 do { \ 355 atomic_add_int(&sctppcbinfo.ipi_count_readq,1); \ 356 } while (0) 357 358#define SCTP_DECR_READQ_COUNT() \ 359 do { \ | 351 } while (0) 352 353#define SCTP_INCR_READQ_COUNT() \ 354 do { \ 355 atomic_add_int(&sctppcbinfo.ipi_count_readq,1); \ 356 } while (0) 357 358#define SCTP_DECR_READQ_COUNT() \ 359 do { \ |
360 atomic_add_int(&sctppcbinfo.ipi_count_readq, -1); \ | 360 atomic_subtract_int(&sctppcbinfo.ipi_count_readq, 1); \ |
361 } while (0) 362 363#define SCTP_INCR_STRMOQ_COUNT() \ 364 do { \ 365 atomic_add_int(&sctppcbinfo.ipi_count_strmoq, 1); \ 366 } while (0) 367 368#define SCTP_DECR_STRMOQ_COUNT() \ 369 do { \ | 361 } while (0) 362 363#define SCTP_INCR_STRMOQ_COUNT() \ 364 do { \ 365 atomic_add_int(&sctppcbinfo.ipi_count_strmoq, 1); \ 366 } while (0) 367 368#define SCTP_DECR_STRMOQ_COUNT() \ 369 do { \ |
370 atomic_add_int(&sctppcbinfo.ipi_count_strmoq,-1); \ | 370 atomic_subtract_int(&sctppcbinfo.ipi_count_strmoq, 1); \ |
371 } while (0) 372 373 | 371 } while (0) 372 373 |
374 375 376 | |
377#endif | 374#endif |